pre_distupgrade_debug_packagemanager: enable Debug::pkgPackageManager

Signed-off-by: Andreas Beckmann <anbe@debian.org>
lib/db: simplify _find_packages_ready_for_testing()

Signed-off-by: Andreas Beckmann <anbe@debian.org>
lib/db: remove reserved packages from candidates

avoid rrdeps computation if not needed
avoid O(n^2) looping over previously reserved packages

Signed-off-by: Andreas Beckmann <anbe@debian.org>
make tmpdir setting mandatory for master/slave operation

use /var/cache/piuparts/tmp for the piuparts-slave package

Signed-off-by: Andreas Beckmann <anbe@debian.org>
p.conf: add [global] PYTHONPATH setting

for non-default installations that use piuparts from git
in some other location than /usr

Signed-off-by: Andreas Beckmann <anbe@debian.org>
master-bin/slave-bin: get PYTHONPATH from piuparts.conf

Signed-off-by: Andreas Beckmann <anbe@debian.org>
p.conf: get rid of [global] prefix setting

obsoleted by PYTHONPATH setting and @sharedir@ substitution

Signed-off-by: Andreas Beckmann <anbe@debian.org>
p.conf: reorder/reformat some config settings

Signed-off-by: Andreas Beckmann <anbe@debian.org>
p.conf: wrap sections, piuparts-command, and piuparts-flags

for better readability and easier patching

Signed-off-by: Andreas Beckmann <anbe@debian.org>
p.conf: make bts-from optional

and let piuparts-analyze skip the updating part if DEBEMAIL is not set

Signed-off-by: Andreas Beckmann <anbe@debian.org>
p-s: add support for running piuparts under /usr/bin/timeout

timeout (from coreutils) seems to be more able to reliably kill
hanging piuparts processes than the piuparts-slave internal
implementation

one reason might be that it will run as root like the piuparts
process it is managing

handle the return values from timeout accordingly

Signed-off-by: Andreas Beckmann <anbe@debian.org>
p.conf: use /usr/bin/timeout to ensure piuparts termination

timeout -s INT -k 5m 35m

-s INT    send SIGINT after runtime was exceeded
-k 5m     send SIGKILL 5 minutes later
35m       set limit to 35 minutes

(piuparts-slave has a hardcoded limit of 45 minutes)

Signed-off-by: Andreas Beckmann <anbe@debian.org>
Makefile: overhaul, install targets depend on build-stamp

Signed-off-by: Andreas Beckmann <anbe@debian.org>
lib/read_config.sh: add some comments

describe the sed expression a bit

Signed-off-by: Andreas Beckmann <anbe@debian.org>
p.conf: set known-problem-directory

Signed-off-by: Andreas Beckmann <anbe@debian.org>
p-s: clear idle state after sighup to continue asap

if there are unchecked packages after a sighup, try to rerun
this section as early as possible and finish the work

Signed-off-by: Andreas Beckmann <anbe@debian.org>
p-s: check load frequently and sleep if it exceeds threshold

tunable via [global] slave-load-max = 1.5
0 (default) disables
9.5 seems to be reasonable for 8 slaves running on 4 cores / 8 threads

Signed-off-by: Andreas Beckmann <anbe@debian.org>
slave_run: do not run the screen as root

Signed-off-by: Andreas Beckmann <anbe@debian.org>
use screen -ls to check for running screens

Signed-off-by: Andreas Beckmann <anbe@debian.org>
slave_join: use 'script /dev/null' to get a writable tty

avoid

user$ sudo su - piupartss
piupartss$ screen -x
Cannot open your terminal '/dev/pts/42' - please check.

Signed-off-by: Andreas Beckmann <anbe@debian.org>