Package dependencies

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search

This document in other languages: Spanish


Packages can depend on each other (e.g., you have to install Firefox before installing some Firefox plugin etc.).

There are three types of dependencies:

depend - depends the current package to another specified package.

chain - chains another specified package to this package.

include - includes another specified package in the overall WPKG process.

Depending on a package[edit]

By using depend you make a package depending on another package, meaning that this package needs the other package for correct functionality. This dependency can already be needed during the installation or upgrade, therefore a dependency is always installed right before the current package independently of the priority of the packages.

The format is very simple, and similar to the one used for profile dependencies

The example used in Packages.xml has been modified to make it dependent on another package called "other-package":

<packages>
<package
 id="example-package"
 name="Example Package"
 revision="1"
 reboot="false"
 priority="0">

 <depends
  package-id="other-package" />

 ...

In this example the 'depends' makes the "other-package" install right before the current package "example-package".

Chaining a package[edit]

By using chain you chain a package to the current package, meaning that if this package is installed, the other package also has to be installed but right after the current package.

Even if a chained package isn't mentioned in Profiles.xml, incrementing its revision will cause it to be upgraded.

Attention: a chained package might also be installed before the package chaining it. This might happen if the chained package is either already installed (possible by another dependency) or has higher priority than the package which references it by chain. If you need to ensure that a package is installed before another one please specify a dependency (see Depending on a package)

The example used in Packages.xml has been modified to make it chain another package called "other-package":

<packages>
<package
 id="example-package"
 name="Example Package"
 revision="1"
 reboot="false"
 priority="0">

 <chain
  package-id="other-package" />

 ...

In this example the 'chain' makes the "other-package" install right after the current package "example-package".

In fact it would be exactly the same if "other-package" would be depending on this package "example-package". But with some packages it may be more logical and even more practical by chaining another package instead of being the other package's dependant.

For example if you have a package "Gimp" for the application "The Gimp" and a package "GimpHelp" containing the Help files of the application. And you want "GimpHelp" always installed together with "Gimp". The "GimpHelp" package depends on "Gimp" as it needs a Gimp installation before it can be installed, so you could use 'depend' in the "GimpHelp" package. But in this case it is more logical to 'chain' "GimpHelp" to "Gimp" as it will be "Gimp" that you would want to assign to a profile.

In general the best practice is that if some main package needs certain other packages (containing components, libraries, frameworks, ...) to be able to work, that main package should depend on the needed other packages. But if (maybe due to a company policy) the main package always needs to be extended with certain packages (help-files, clipart, ...), then you should chain the extending packages from the main package. Be ware that if you don't want certain application extensions to be installed always (for example firefox developer extensions), you should not chain them from the main package, but let them depend on the main package and then assign them individually to the profiles where needed.

Including a package[edit]

By using include you include a package to the list of packages as specified by the profile, meaning that if you install this package the included package will also be installed. This included package will be installed based on its priority. So if the included package has high priority it will be installed early during synchronization. If the included package has low priority it will be installed late. If you would like to enforce a certain installation order please consider to specify a dependency (see Depending on a package) !

The example used in Packages.xml has been modified to make it include another package called "other-package":

<packages>
<package
 id="example-package"
 name="Example Package"
 revision="1"
 reboot="false"
 priority="0">

 <include
  package-id="other-package" />

 ...

In this example the 'include' makes the "other-package" also install if the current package "example-package" is installed.