Add auth.conf.d support to archives

Allow APT_AUTH.CONF(5) config files to be used with archives.

Note that config/archives/*.conf are assumed to be apt.conf files,
so the apt_auth files are required to end with .auth and will be renamed
to .conf when copied into the chroot.

Closes: #991065
This commit is contained in:
Nick Brown 2021-09-15 09:53:04 +01:00 committed by Luca Boccassi
parent 70994cd304
commit f04dc6dc49
1 changed files with 40 additions and 0 deletions

View File

@ -92,6 +92,26 @@ case "${_ACTION}" in
fi
done
# Adding local apt auth (chroot)
# Note: .conf is assumed to be apt.conf, so use new suffix .auth
for FILE in config/archives/*.auth
do
if [ -e "${FILE}" ]
then
cp ${FILE} chroot/etc/apt/auth.conf.d/$(basename ${FILE} .auth).conf
fi
done
# Adding local apt auth (chroot)
# Note: .conf is assumed to be apt.conf, so use new suffix .auth
for FILE in config/archives/*.auth.chroot
do
if [ -e "${FILE}" ]
then
cp ${FILE} chroot/etc/apt/auth.conf.d/$(basename ${FILE} .auth.chroot).conf
fi
done
# Check local archive keys (chroot)
if Find_files config/archives/*.key || \
Find_files config/archives/*.key.chroot
@ -364,6 +384,16 @@ case "${_ACTION}" in
fi
done
# Remve chroot-only apt auth
# Note: .conf is assumed to be apt.conf, so use new suffix .auth
for FILE in config/archives/*.auth.chroot
do
if [ -e "${FILE}" ]
then
rm "chroot/etc/apt/auth.conf.d/$(basename ${FILE} .auth.chroot).conf"
fi
done
# Adding local apt sources (binary)
for FILE in config/archives/*.list config/archives/*.list.binary
do
@ -401,6 +431,16 @@ case "${_ACTION}" in
fi
done
# Adding local apt auth (chroot)
# Note: .conf is assumed to be apt.conf, so use new suffix .auth
for FILE in config/archives/*.auth.binary
do
if [ -e "${FILE}" ]
then
cp ${FILE} chroot/etc/apt/auth.conf.d/$(basename ${FILE} .auth.binary).conf
fi
done
# Adding local apt keys (binary)
for FILE in config/archives/*.key config/archives/*.key.binary
do