[poldek home]

6. Repository management

poldek can be useful for distribution developers and maintainers by make detailed reports about package set consistency, automating move packages from one repository to another and helping to generate CD/DVD ISO images.

6.1. Verification of package set quality

poldek can do reports about package set consistency: dependency loops, unmet dependencies, conflicts between packages, orphaned directories and missing (not the same as unmet) dependencies. Reports are accessible through --verify(-V) switch with report type as argument.

Avaialble reports:

Dependency loops and unmet dependencies

This report allows to verify if package set contain any unsatisfied dependencies and requirements (PreReqs) loops (loop makes impossible to install packages in the right order). This report is called deps and it is the default one, so it is accessible through --verify without an argument. Output example:

$ poldek -n home --verify
Verifying dependency loops...
error: PreReq loop: pam <- coreutils <- pam <- SysVinit
error: PreReq loop: xinitrc <- XFree86 <- xinitrc
2 prerequirement loops detected 

Verifying dependencies...
error: docbook-utils-0.6.13-7: req perl(Getopt::Long) >= 2.01 version mismatch
eog-2.8.2-1: req libexif.so.10 not found
error: ruby-gnome2-0.11.0-2: req ruby-rbogl not found
3 unsatisfied dependencies found
    

Package conflicts

Report prints all package pairs beeing in conflict or beeing obsoleted one another. It lets to verify if all conflicts are needed, what are redundant, and so on. Report is called conflicts. Output example (Obsoletes are printed with asterisk '*'):

$ poldek -n foo --verify=conflicts
Verifying conflicts...
bind-9.2.5-2 -> *maradns-1.1.30-1, *dnsmasq-2.19-1, *pdnsd-1.1.8b1-0.par8.2
maradns-1.1.30-1 -> *bind-9.2.5-2 
login-2.12-15 -> *heimdal-login-0.6.3-2
pdnsd-1.1.8b1-0.par8.2 -> *maradns-1.1.30-1, *maradns-zoneserver-1.1.30-1 
shadow-4.0.4.1-3 -> pwdutils-2.6.90-3
    

File conflicts

Report prints all package pairs beeing in conflict on file level and pairs which share the same file. It lets to verify if all file conflicts are wanted. Report is called file-conflicts:

$ poldek -n foo --verify=file-conflicts
Path: /usr/lib/perl5/vendor_perl/5.8.0/i686-pld-linux-thread-multi/Image
  shr   perl-base-5.8.6-3(D m40755 s4096)  -  ImageMagick-perl-6.1.8.9-1(D m40755 s4096)

Path: /var/log/archiv/mail
  cnfl  syslog-ng-1.6.6-2(D m40755 s4096) <-> zmailer-2.99.56-4(D m40750 s48)

Path: /usr/bin/digest
  cnfl  perl-XMLDigest-0.1-1(F m100755 s1418) <-> nss-tools-3.1-1(F m100755 s32964)
    

'<' and '>' mean missing explicit conflict between packages.

Orphaned directories

Report prints all directories without an owner, i.e. directories not explicit included in packages (a %files section of RPM spec file). In proper package distribution set such directories should not happened. Orphans are created with root's umask and they later cannot be verified by rpm.

Report is called file-orphans:

$ poldek -n foo --verify=file-orphans
error: /etc/X11/dm: orphaned directory from gdm-2.4.4.5-1, gnome-session-2.4.0-1
error: /var/games/phantasia: orphaned directory from bsd-games-2.16-2
    

Missing dependencies

Report helps to avoid rather subtle packaging bugs when one package has files in directories owned by other package which is not requied by the first one.

Report is called file-missing-deps:

$ poldek -n foo --verify=file-missing-deps
GConf-1.0.9-11: /etc/gconf: not in required packages (missing Requires: gnome-utils?)
cups-1.1.19-13: /etc/logrotate.d: not in required packages (missing Requires: logrotate?)
    

Some or all of above reports may be requested at once, --verify can be fed by comma separated report list, for example:

$ poldek -n foo --verify=deps,file-orphans,file-missing-deps

Package subset can verified too. If it is not desirable to verify whole repository, just give to poldek package list you want to verify:

$ poldek -n foo --verify=deps --pset=packages-minicd.txt
$ poldek -n foo --verify=deps glibc poldek

6.2. Preparation of distribution disks

poldek can partition package set for the purpose of placing it on removable media like DVD or CD. Package set is divided in the way that minimize needs of disk changes, i.e if distribution packages fits on 3 CDs, then only 2 changes of CD disk are necessary during installation system from a scratch. The invoking syntax is:

$ poldek --split=SIZE[:FIRST_FREE_SPACE] [--priconf=FILE] [--split-out=PREFIX]

Where SIZE is a size of the chunk in megabytes. Optional FIRST_FREE_SPACE makes the first chunk FIRST_FREE_SPACE MB smaller, useful to save space for installer for example.

Packages are placed in successive chunks in order of their installation. To reorder packages moving some to higher or lower chunk, especially on first/ last one, priorities may be assigned to them. Package priorities are taken from file given by --priconf. Format of this file is quite simple, see sample poldek-pri-sample.conf supplied with poldek.

Each chunk is written as NAME-EVR.ARCH.rpm list to PREFIX.XX file, the default PREFIX is “packages.chunk”.

6.3. Managing repository packages

A typical scenario during distribution development looks like there is repository for untested packages from where they periodically, when found to be tested enough, are moved to the another repository marked as stable branch.

poldek can help movig packages between repositories through “to repository” installation, i.e. packages are copied from source to destination repository with full dependency checking. Thus this feature allows to move subtree of packages from one repository to another without a risk of break dependencies. The syntax is:

$ poldek ... --dn SOURCE_NAME [--dn SOURCE_NAME] ...

Where SOURCE_NAME is a name of destination repository to which we want to move packages, for example:

$ poldek -n ac-test --dn ac -uv libselinux
Loading [pdir]ac-test...
1161 packages read
Loading [pdir]ac...
Processing dependencies...
libselinux-1.18-1 obsoleted by libselinux-1.22-1
  greedy upgrade libselinux-devel-1.18-1 to 1.22-1 (unresolved libselinux = 1.18-1)
    libselinux-devel-1.18-1 obsoleted by libselinux-devel-1.22-1
      greedy upgrade libselinux-static-1.18-1 to 1.22-1 (unresolved libselinux-devel = 1.18-1)
        libselinux-static-1.18-1 obsoleted by libselinux-static-1.22-1
  greedy upgrade libselinux-utils-1.18-1 to 1.22-1 (unresolved libselinux = 1.18-1)
    libselinux-utils-1.18-1 obsoleted by libselinux-utils-1.22-1
There are 4 packages to install (3 marked by dependencies), 4 to uninstall:
I libselinux-1.22-1
D libselinux-devel-1.22-1, libselinux-static-1.22-1, libselinux-utils-1.22-1
R libselinux-1.18-1, libselinux-devel-1.18-1, libselinux-static-1.18-1, libselinux-utils-1.18-1
Need to get 153.9KB of archives (153.9KB to download).
rm /home/ftp/pub/ac/libselinux-1.18-1.i686.rpm
rm /home/ftp/pub/ac/libselinux-devel-1.18-1.i686.rpm
rm /home/ftp/pub/ac/libselinux-static-1.18-1.i686.rpm
rm /home/ftp/pub/ac/libselinux-utils-1.18-1.i686.rpm
cp libselinux-utils-1.22-1.i686.rpm /tmp/RPMS/libselinux-utils-1.22-1.i686.rpm
cp libselinux-static-1.22-1.i686.rpm /tmp/RPMS/libselinux-static-1.22-1.i686.rpm
cp libselinux-devel-1.22-1.i686.rpm /tmp/RPMS/libselinux-devel-1.22-1.i686.rpm
cp libselinux-1.22-1.i686.rpm /tmp/RPMS/libselinux-1.22-1.i686.rpm

Removing packages from repositories in that safe manner is also possible:

$ poldek --dn ac -e poldek
mark poldek-0.18.8-3
Processing dependencies...
poldek-0.18.8-3 marks libpi-0.1.1-1 (req poldek)
  libpi-0.1.1-1 marks libpi-devel-0.1.1-1 (req libpi = 0.1.1-1)
  libpi-0.1.1-1 marks pacman-0.1-3 (req libpi)
poldek-0.18.8-3 marks poldex-0.17.4-1 (req poldek)
There are 5 packages to remove (4 marked by dependencies):
R poldek-0.18.8-3
D libpi-0.1.1-1, libpi-devel-0.1.1-1, pacman-0.1-3, poldex-0.17.4-1
Proceed? [y/N]

Sometimes it is not desirable to let poldek to move packages itself. With --test and --parsable-tr-summary switches easy to parse output is produced, what allows to handle move operation by external scripts. Example:

$ poldek --dn ac -et poldek --parsable-tr-summary
[cut]
%R poldek-0.18.8-3
%D libpi-0.1.1-1
%D libpi-devel-0.1.1-1
%D pacman-0.1-3
%D poldex-0.17.4-1