Stephen Quinney > PkgForge-1.4.8 > PkgForge::Source::SRPM

Download:
PkgForge-1.4.8.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: v1.4.8   Source  

NAME ^

PkgForge::Source::SRPM - A source RPM class for the LCFG Package Forge

VERSION ^

This documentation refers to PkgForge::Source::SRPM version 1.4.8

SYNOPSIS ^

     use PkgForge::Source::SRPM;

     my $pkg = PkgForge::Source::SRPM->new( file => "foo-1-2.src.rpm" );

     my $ok = eval { $pkg->validate() };

     if ( !$ok || $@ ) {
       warn "$pkg failed to validate: $@\n";
     }

DESCRIPTION ^

This module provides a representation of a source RPM package which is used by the LCFG Package Forge software suite.

ATTRIBUTES ^

These attributes all come from the interface which this module implements, there are no overrides.

basedir

This is the directory in which the source package can be found. If none is given then it defaults to the current directory. The directory must exist.

file

This is the file name of the source package, this attribute is required when creating new objects. The file must exist.

sha1sum

This is the SHA1 checksum of the source package. It will be calculated the first time the attribute is queried.

type

This is a string representing the type of the source package. It is the final part of the name of the module which implements this role. For example, for "PkgForge::Source::SRPM" the type is "SRPM".

SUBROUTINES/METHODS ^

Class Methods

PkgForge::Source::SRPM->can_handle($file)

This class method takes the path to a source file. It returns true or false based on whether or not the module can handle that type of source file. It uses the validate method to do the working of checking the source package. Note that under normal circumstances (i.e. when checking the source package validity) this method must not die.

Instance Methods

gen_sha1sum

This method generates the SHA1 digest for the package and returns it in hexadecimal form. The length of the returned string will be 40 and it will only contain characters from this set: '0'..'9' and 'a'..'f'.

check_sha1sum

This will compare the current value of the SHA1 checksum, as stored in the sha1sum attribute, against the value found by running gen_sha1sum on the package. It returns a boolean value reflecting whether they match.

validate($file)

This does the following validity checks:

The file must exist.
The file must have the '.src.rpm' suffix.
It must be a proper source RPM.
It must contain a specfile with the '.spec' suffix.

If all tests pass then a true value is returned, otherwise the method will die with an appropriate message for the failed test. You will need the RPM2 module for this method to work. It will take either a file name as an argument or use the fullpath method.

DEPENDENCIES ^

This module is powered by Moose. It is based on PkgForge::Source. It requires RPM2 to validate an SRPM.

SEE ALSO ^

PkgForge, PkgForge::Source

PLATFORMS ^

This is the list of platforms on which we have tested this software. We expect this software to work on any Unix-like platform which is supported by Perl.

ScientificLinux5, Fedora13

BUGS AND LIMITATIONS ^

Please report any bugs or problems (or praise!) to bugs@lcfg.org, feedback and patches are also always very welcome.

AUTHOR ^

    Stephen Quinney <squinney@inf.ed.ac.uk>

LICENSE AND COPYRIGHT ^

    Copyright (C) 2010 University of Edinburgh. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the terms of the GPL, version 2 or later.

syntax highlighting: