Debian::Package::Dependency - Meta info for a single dependency.
use Debian::Package::Dependency;# initialize the dependency list object using the value of the# Pre-Depends, Dependes, Recommends, or Suggests field values.$dep_lst =Debian::Package::Dependency->new('string' => "Value",'Type' => "Field"});# Print it back out again$dep_lst->print();
This module implements a Debian::Package::Dependency object.
new This is the constructor for the package. It takes a named argument, string, whose value is the value of an element in a dependecy list, and it takes another named argument Type, which is the name of the field.. This is a fancy way of saying we reord the name, relationship, and version number of the package we have a relationship with, with only the name being required. The relation ship is one of = << <= >>, or >=.
Internally, new uses the method initialize, which does the hard work. Specifically, the package name, and, if relevant, the relationship (as in ==, =>, =<, <<, >>), and the version, of the package the current
package depends on, are recorded.
print This method takes the internal representation of a dependency and prints it. (The format is such that one may reproduce the original line in the Package file).
as_string This method takes the internal representation of a dependency and converts it into a string (Instead of printing it).
match This routine compares two dependecy objects and returns 'Yes' if there is a match. It takes a dependency object as an argument.
depend This method takes Named package lists New and Installed, and check self to see if the dependencies are satisfied. It first checks the package list new, and then the package list installed. Internally, the checking is done using the routine do_depend. This is the routine that adds ordering information to the array if the current packageis not a virtual package. In case there is a version mismatch within the new list, this is a cause for concern, and if the parameter Consistent is defined, it prints a warning on stderr.
do_depend This routine takes a package list, and checks if the current dependency is satisfied by any package therein, either as a real package or a provided one.
order This method takes a named argument, New, which is a pointer to the new packages list, and a named parameter Package, which is a pointer to the package this dependency belongs to (the results are appended to the package object), and, if the dependency type is conflict, it also takes a named argument, Installed, which is a list of packages already installed on the machine.
If there is a dependency from the conflicted-with package tous, this would create a cycle :-⎪ For the common case, itseems more desirable to install the conflict-update first, sowe have to remove the dependency. Also this package has tobe installed with --force-depends then.
This package is not really meant to be accesed directly, Dependency objects are created and manipulated by the dependency list objects. This is very inchoate, at the moment, and needs testing. None Known so far. Manoj Srivastava <[email protected]>