NAME

slackget10::SpecialFiles::CHECKSUMS - An interface for the special file CHECKSUMS.md5

VERSION

Version 1.0.0

SYNOPSIS

This class contain all methods for the treatment of the CHECKSMUMS.md5 file

    use slackget10::SpecialFiles::CHECKSUMS;

    my $spec_chk = slackget10::SpecialFiles::CHECKSUMS->new('CHECKSUMS.md5','slackware');
    $spec_chk->compile();
    my $ref = $spec_chk->get_checksums('glibc-profile-2.3.4-i486-1');
    print "Checksum for glibc-profile-2.3.4-i486-1.tgz : $ref->{checksum}\n";
    print "Checksum for glibc-profile-2.3.4-i486-1.tgz.asc : $ref->{'signature-checksum'}\n";

WARNINGS

All classes from the slackget10::SpecialFiles:: namespace need the followings methods :

        - a contructor new()
        - a method compil()
        - a method get_result(), which one can be an alias on another method of the class.

Moreover, the get_result() methode need to return a hashref. Keys of this hashref are the filenames.

Classes from ths namespace represent an abstraction of the special file they can manage so informations stored in the returned hashref must have a direct link with this special file.

CONSTUSTOR

new

The constructor take three argument : the file CHECKSUMS.md5 with his all path, a slackget10::Config object and an id name.

        my $spec_chk = slackget10::SpecialFiles::CHECKSUMS->new('/home/packages/CHECKSUMS.md5',$config,'slackware');

The constructor return undef if the file does not exist.

FUNCTIONS

compile

This method take no arguments, and extract the list of couple (file/checksum). Those couple are store into an internal data structure.

        $spec_chk->compile();

get_checksums

This method return a slackget10::Package object containing 2 keys : checksum and signature-checksum, wich are respectively the file checksum and the GnuPG signature (.asc) checksum. The object can contain more inforations (like the package-source and package-location). This method is the same that get_package().

        my $ref = $spec_chk->get_checksums($package_name) ;

This method return undef if $package_name doesn't exist in the data structure.

get_package

Return informations relative to a packages as a slackget10::Package object.

        my $package_object = $spec_chk->get_package($package_name) ;

get_result

Alias for get_checksums()

to_XML

Translate the internale data structure into a single XML string.

WARNING: this method is for debug ONLY, YOU NEVER HAVE TO CALL IT IN NORMAL USE.

AUTHOR

DUPUIS Arnaud, <a.dupuis@infinityperl.org>

BUGS

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

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2005 DUPUIS Arnaud, All Rights Reserved.

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