Otherwise they might hog resources like /dev/null which can then not be
unmounted resulting in their mountpoints (the regular files) not being
removable and then the removal of device nodes in run_cleanup (if
mmdebstrap is run with --skip=output/dev) will fail.
Another potential solution would be to run each hook and apt invocation
in its own process namespace but this would require to remount /proc and
this in turn would require a new mount namespace as well but we'd like
to keep the mount namespace across multiple hooks...
In the mmdebstrap autpkgtest, debian/tests/sourcesfilter will write out
/etc/apt/sources.list before the test's setup-hook is run. Thus, the
test's setup-hook will overwrite the contents of the sources.list that
debian/tests/sourcesfilter set up, which will end up pulling in the
wrong packages.
Thus, only write out our own /etc/apt/sources.list if it does not yet
exist. If it does exist, nothing needs to be done.
This is so that users calling apt-get install from a hook only need to
have APT_CONFIG=$MMDEBSTRAP_APT_CONFIG set and do not also have to pass
-oDPkg::Chroot-Directory="$1".
This breaks users running apt-get with
DPkg::Options::=--force-script-chrootless or with Dpkg::Pre-Install-Pkgs
from within a hook with APT_CONFIG=$MMDEBSTRAP_APT_CONFIG.
In those situations, DPkg::Chroot-Directory has to be set to the empty
string explicitly with -o to overwrite the APT_CONFIG setting.
Thanks: Helmut Grohne
- only download Release files once and not by apt as well as with curl
and thus avoid a mirror push happening between both downloads
- no heuristic needed to place the file in their correct mirror
location
- no manual checksum checking
- only throttle download speed when actually downloading and not when
retrieving files from the cache
- no translation of filenames between how the epoch colon is stored in
files in /var/cache/apt/archives versus how it is stored in files on
the mirrors
- no special handling of stable update and security mirrors
- implemented in Python instead of shell and thus an order of magnitude
faster