The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

FreeBSD::Pkgs::FindUpdates - Finds updates for FreeBSD pkgs by checking the ports index.

VERSION

Version 0.3.0

SYNOPSIS

This does use FreeBSD::Ports::INDEXhash. Thus if you want to specifiy the location of the index file, you will want to see the supported methodes for it in that module.

    use FreeBSD::Pkgs::FindUpdates;
    #initiates the module
    my $pkgsupdate = FreeBSD::Pkgs::FindUpdates->new;
    #finds changes
    my %changes=$pkgsupdate->find;
    #prints the upgraded stuff
    while(my ($name, $pkg) = each %{$changes{upgrade}}){
        print $name.' updated from "'.
              $pkg->{oldversion}.'" to "'.
              $pkg->{newversion}."\"\n";
    }
    #prints the downgraded stuff
    while(my ($name, $pkg) = each %{$changes{upgrade}}){
        print $name.' updated from "'.
              $pkg->{oldversion}.'" to "'.
              $pkg->{newversion}."\"\n";
    }

METHODS

new

This initiate the module.

find

This finds any changes creates a hash.

Two arguements are optionally accepted. The first is a hash returned from INDEXhash

    #basic usage...
    my %changes=$pkgsupdate->find;
    
    #create the INDEXhash and pkgdb and then pass it
    my $pkgdb=FreeBSD::Pkgs->new;
    $pkgdb->parseInstalled;
    if ( $pkgdb->error ){
        warn('Error: FreeBSD::Pkgs->new errored');
    }
    
    my %index=INDEXhash;
    my %changes=$pkgsupdate->find(\%index, $pkgdb);
    if ( $pkgsupdate->error ){
        warn('Error:'.$pkgsupdate->error.': '.$pkgsupdate->errorString);
    }

Changes Hash

This hash contains several keys that are listed below. Each is a hash that contain several keys of their own. Please see the sub hash section for information on that.

The name of the installed package is used as the primary key in each.

downgrade

This is a hash that contains a list of packages to be down graded.

from

The keys to this hash are the packages that will be change from. The values are the names that it will changed to.

upgrade

This is a hash that contains a list of packages to be up graded.

same

This means there is no change.

to

The keys to this hash are the packages that will be change to. The values are the names that it will changed from.

sub hash

All three keys contain hashes that then contian these values.

old

This is the name of the currently installed package.

new

This is the name of what it will be changed to if upgraded/downgraded.

oldversion

This is the old version.

newversion

This is the version ofwhat it will be changed toif upgraded/downgraded.

port

This is the port that provides it.

ERROR CODES/HANDLING

Error handling is provided by Error::Helper.

1

FreeBSD::Pkgs errored.

AUTHOR

Zane C. Bowers-Hadley, <vvelox at vvelox.net>

BUGS

Please report any bugs or feature requests to bug-freebsd-pkgs-findupdates at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=FreeBSD-Pkgs-FindUpdates. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc FreeBSD::Pkgs::FindUpdates

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2012 Zane C. Bowers-Hadley, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.