---
name: "Debian::Package::Package"
section: "3pm"
platform: "linux"
package: "pkg-order"
version: "1.12"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/Debian::Package::Package"
---

# Debian::Package::Package(3pm)

```
  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 print
  Debian::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* **Type**s, 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 **Type**a, *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 **Type**a, *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 **Type**a, *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 \<srivasta@debian.org\>

\=cut"
