Version 2 (modified by, 13 years ago) (diff)

Links updated

Debian Pkgmgr Creation Script

The tool is a Python script that generates the required XML files in the Pkgmgr directory for Bcfg2 to install software with the APT driver ("gp" stands for the initials of the author, Guillaume Pratte, as the script is not officially incorporated in Bcfg2 for now, and as an previous version of this script exists as "").

The configuration file

The tool reads it's configuration from a file named $REPOS/etc/debian-pkglist.conf, where $REPOS is the path to the Bcfg2 repository (for example, /var/lib/bcfg2). Here is an example of this file :

deb_url=deb dapper main restricted universe
deb_url2=deb dapper-updates main restricted universe
deb_url3=deb dapper-security main restricted universe

deb_url=deb feisty main universe multiverse restricted
deb_url2=deb feisty-updates main universe multiverse restricted
deb_url3=deb feisty-security main universe multiverse restricted

This will create two files in the Pkgmgr directory, one named "ubuntu-dapper.xml", and the other "ubuntu-feisty.xml". The file is named after the sections of the configuration file (i.e. the file name is the string between the brackets). The ubuntu-dapper.xml file will be the result of the fusion of the three URLs specified. This fusion is done by comparing packages versions with dpkg and keeping only the most recent version of the packages.

Here is a description of the options :


Specify the Debian URL(s) to use to generate the file. The format of this URL is the same as the URLs in /etc/apt/sources.list. Up to 9 URLs can be specified : deb_url, deb_url2, deb_url3, ..., deb_url9. The order of these URLs is not important. If a package is present in more than one URL, the most recent version of the package is kept. The package version comparison is done with the command "dpkg --compare-versions".


The priority to put in the PackageList? tag of the generated XML file. A higher number means a higher priority. This priority is used by Bcfg2 to determine what package version to use if two XML lists contains the same package with a different version number.


A list of one or more architectures. For example :


or :

architectures=i386, amd64

If more than one architecture is specified, groups will be used to differentiate the versions for each architecture in the XML file. Packages which have the same versions across all architectures will have no architecture-based group.


A list of one or more groups that all packages will belong to. As a consequence, packages will be available for the client only if it belong to these groups. It is suggested to use the code name of the distribution as defined in the metadata (for instance, in the bcfg-os.xml file).


This tool is available here :

The file must be saved into $REPOS/etc/ (where $REPOS is the path to the Bcfg2 repository (for example, /var/lib/bcfg2)).

Script invocation

The script must be invoked like this : python

Invoking with -v will ouput the URLs being processed.