Debian::Package::Package - Information about a debian package=cut
use Debian::Package::Package;# Initialize the package details with a snippet of a Packages file$pkg = Debian::Package::Package->new('Package_desc' => $description);# Print it back again$pkg->print();
# Exercise new and printDebian::Package::Package->test();
This module implements a Debian::Package::Package object.
new This is the constructor for the package. It takes a required argument, which is a snippet from the Packages file.
Internally, new uses the method initialize. This fixes continuation lines, and sets up key value pairs (escaping and unescaping newlines as it does so.)
init_depends Creates a Dependency List object. Takes a named parameter field. Stored in internal fields whose names start with a blank followed by an underscore " _")
print This method takes the key value pairs that constitute a Package definition and prints it out.
order_string This routine takes the ordering information accumulated in a package and returns it as a string.
check_relations This routine performs the dependency check for the package. For each package in the list, it constructs an complex associative array to be used as an argument to the depend method of one of the dependency lists of the package. It takes a required named argument Field, whose value should be one of Pre-Depends, Depends, Recommends, Suggests, Conflicts, or Replaces. It takes a second required argument, New, which contains a pointer to the new packages list. It takes optional named arguments Consistent, (true if inconsistency in the new list should cause a warning), Installed, (a package list of installed packages), and Warn, which just sends a warning, and does not exclude a Package.
reset_result This routine returns recalculates the results field.
mark This routine takes arequired parameter Mark and marks the package with Mark. This is usually used to mark packages in some fashion so they will not satisfy dependencies (for packages in the installed list marked for removal, for example)
unmark This routine takes a required parameter, Mark and removes Mark from the Package.
test_mark This routine takes two required parameters, Package, and Mark and tests to see if the Package is marked with Mark.
show_mark This routine takes one required parameter, Package, and shows all marks on it.
test A class method has been provided to test this class. Ths uses a dummy package description string, passes it to new, and prints it back out. This module handles storing and retrieving information about the package ascertained by dependency check runs.
new This is the constructor for the package.
set_fatal_failure_on_types This routine adds to the current set of Show stopper Types, taking one required named argument, Type List.
add This routine adds to the current set of dependency results for this package. It takes 3 named arguments, all of them required: Type, one of Conflicts Pre-Depends Depends Recommends Suggests Category, one of Failed Found Warn Conflict Unknown (note, no trailing s)
remove This routine removes a result from the current set of dependency results for this package. It takes 3 named arguments, all of them required: Type, one of Conflicts Pre-Depends Depends Recommends Suggests Category, one of Failed Found Warn Conflict Unknown (note, no trailing s)
print_result This routine prints out the current set of dependency failures for this package. It takes 2 named arguments, both required: Type, one of Conflicts Pre-Depends Depends Recommends Suggests Category, one of Failed Found Warn Conflict Unknown (note, no trailing s). Also, there are two special Typea, All Critical, which print All and Show Stoppers types respectively. Actually, this procedure merely handles the Special types, and passes the work to the next routine.
do_print This routine prints out the current set of dependency failures for this package. It takes 2 named arguments, both required: Type, one of Conflicts Pre-Depends Depends Recommends Suggests Category, one of Failed Found Warn Conflict Unknown (note, no trailing s).
result_as_string This routine returns the current set of dependency failures for this package as a string. It takes 2 named arguments, both required: Type, one of Conflicts Pre-Depends Depends Recommends Suggests Category, one of Failed Found Warn Conflict Unknown (note, no trailing s). Also, there are two special Typea, All Critical, which print All and Show Stoppers types respectively. Actually, this procedure merely handles the Special types, and passes the work to the next routine.
do_string This routine returns the current set of dependency failures for this package as a string. It takes 2 named arguments, both required: Type, one of Conflicts Pre-Depends Depends Recommends Suggests Category, one of Failed Found Warn Conflict Unknown (note, no trailing s).
check This routine returns the number of the current set of dependency failures for this package. It takes 2 named arguments, both required: Type, one of Conflicts Pre-Depends Depends Recommends Suggests Category, one of Failed Found Warn Conflict Unknown (note, no trailing s). Also, there are two special Typea, All Critical, which print All and Show Stoppers types respectively. Actually, this procedure merely handles the Special types, and passes the work to the next routine. This is very inchoate, at the moment, and needs testing. None Known so far. Manoj Srivastava <[email protected]>
=cut"