Table of Contents
piuparts [-apvV] [-d distro] [-i filename] [-I regexp] [-l logfile] [-m url] [--bindmount dir] [package] [changes_file]
piuparts tests that Debian packages handle installation, upgrading, and removal correctly. It does this by creating a minimal Debian installation in a chroot, and installing, upgrading, and removing packages in that environment, and comparing the state of the directory tree before and after. piuparts reports any files that have been added, removed, or modified during this process.
piuparts is meant as a quality assurance tool for people who create Debian packages to test them before they upload them to the Debian package archive.
By default, piuparts can do three different tests:
An upgrade test between Debian releases. This test is enabled by using the -d option multiple times and disables the other two tests. It sets up the chroot with the first distribution named, then upgrades it to each successive one, and then remembers the directory tree state at the end. After this, it starts over with the chroot of the first distribution, installs the desired packages (via apt-get), and does the successive upgrading (via apt-get dist-upgrade). Then, if package files (and not just package names) were given on the command line, it installs them. Finally, it reports problems against the state of the directory tree at the last distribution compared with the state without the packages having been installed. This test can be quite slow to execute.
Note that this does not work with experimental, because apt-get does not automatically upgrade to packages in experimental. To test a particular package or group of packages in experimental, use the second test.
Command line arguments are the paths to package files (e.g., piuparts_1.0-1_all.deb), paths to changes files (e.g., piuparts_1.0-1_i386.changes), or names of packages, if the --apt option is given.
When processing changes files, by default, all packages in a changes file will be processed together with all individual packages given on the command line. Then each package given on the command line is processed in a single group. If the --single-changes-list is used, the packages in all changes files are processed together along with any individual packages that were given on the command line.
piuparts outputs to the standard output some log messages to show what is going on. If a log file is used, the messages go there as well.
piuparts needs to be run as root.
Options must come before the other command line arguments.
Use tarball as the contents of the initial chroot, instead of building a new one with debootstrap.
The tarball can be created with the -s option, or you can use one that pbuilder has created (see -p). If you create one manually, make sure the root of the chroot is the root of the tarball.
Which Debian mirror to use. The default is the first mirror named in /etc/apt/sources.list or http://ftp.debian.org/ if none is found. This option may be used multiple times to use multiple mirrors. Only the first mirror is used with debootstrap.
The components that are used for a mirror can also be set with this option: a space separated list within the same argument (so you need to quote the entire argument in the shell). If no components are given explicitly, the usual Debian components are used (main, contrib, and non-free). For the mirrors read from /etc/apt/sources.list, the components are read from the same place.
Note that file: addresses works if the directories are made accessible from within the chroot with --bindmount.
Print a warning rather than failing if files are left behind, modified, or removed by a package that was not given on the command-line.
This way, you can basically isolate the purge test to your own packages. If a package that is brought in as a dependency doesn’t purge cleanly, the test will not fail because of it (but a warning message will be printed).
Behavior with multple packages given on the command-line could be problematic, particularly if the dependency tree of one package in the list includes another in the list. Therefore, it is recommended to use this option with one package at a time.
Assume that you have just built a new version of your Debian package, to be uploaded to Debian unstable. It is in ../foo_1.0-2_i386.deb and you would like to know whether it installs and uninstalls properly. Here’s what you would do:
piuparts ../foo_1.0-2_i386.deb
If the package exists in the Debian archive already, the above command also tests that it upgrades properly.
To do the same test, but using a particular mirror, and only the main component, you would do this:
piuparts -m 'http://gytha/debian main' ../foo_1.0-2_i386.deb
If you want to do the same as above but for your changes files, pass in your changes files when running piuparts, and piuparts will process each package in the changes files as though you had passed all those packages on the command line to piuparts yourself. For example:
piuparts ../foo_1.0-2_i386.changes piuparts -m 'http://gytha/debian main' ../foo_1.0-2_i386.changes
If you want to test that a package installs properly in the stable (currently lenny) Debian release, then can be upgraded to the testing (currently squeeze) and unstable (sid) versions, and then uninstalled without problems, you would give the following command:
piuparts -a -d lenny -d squeeze -d sid foo
TMPDIR Location for temporary files and directories. If not set, use /tmp. See also the -t (--tmpdir) option.
Outputs of commands run by piuparts are limited to the last megabyte. To change this limit, the source code needs to be edited.
Lars Wirzenius (liw@iki.fi) and others