installer: Skip rebuilding the debian installer if it is found in the cache

This commit is contained in:
Roland Clobus 2023-01-08 17:29:57 +01:00 committed by Luca Boccassi
parent 7e7544c446
commit 196ee7b096
1 changed files with 24 additions and 20 deletions

View File

@ -60,15 +60,6 @@ esac
# Checking depends
Check_package host /usr/bin/wget wget
Check_package chroot /usr/bin/apt-ftparchive apt-utils
if [ "${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}" = "git" -a "${DI_IMAGE_TYPE}" = "cdrom" ]
then
# Packages that are needed for rebuilding the debian installer
Check_package chroot /lib/module linux-image-generic
Check_package chroot /usr/bin/git git
Check_package chroot /usr/bin/mk-build-deps devscripts
Check_package chroot /usr/bin/equivs-build equivs
Check_package chroot /usr/bin/gcc gcc
fi
# Restoring cache
Restore_package_cache binary
@ -264,6 +255,16 @@ case "${LB_DERIVATIVE}" in
then
LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION="${LB_PARENT_DISTRIBUTION_CHROOT}"
URL="${LB_PARENT_MIRROR_CHROOT}/snapshot-build_${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}_${LB_ARCHITECTURE}"
if [ ! -f "${_LB_CACHE_DIR}/$(echo "${URL}/${DI_REMOTE_BASE}/${INITRD_DI}" | sed 's|/|_|g')" ]
then
# Packages that are needed for rebuilding the debian installer
Check_package chroot /lib/module linux-image-generic
Check_package chroot /usr/bin/git git
Check_package chroot /usr/bin/mk-build-deps devscripts
Check_package chroot /usr/bin/equivs-build equivs
Check_package chroot /usr/bin/gcc gcc
Install_packages
# These variables do not need to be passed inside the chroot, they can be resolved earlier:
# SOURCE_DATE_EPOCH, _QUIET, LB_PARENT_MIRROR_CHROOT, LB_PARENT_DISTRIBUTION_CHROOT
cat << EOF > chroot/buildit.sh
@ -313,6 +314,9 @@ EOF
Prepare_installer_cache cdrom/"${INITRD_GI}"
rm -rf chroot/debian-installer
rm -f chroot/buildit.sh
else
Echo_debug "Not rebuilding the installer, using copy from cache..."
fi
elif [ "${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}" = "daily" ]
then
LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION="sid"