From 2e3f195c3888c8fc6bfab64f5efaad5e54302328 Mon Sep 17 00:00:00 2001 From: Lyndon Brown Date: Thu, 13 Feb 2020 03:26:53 +0000 Subject: installer: robustify udeb inclusion move the code that checks whether a version of a given package has already been obtained (to account for parent and derived both listing the same package) to guard the copy from cache action also, not just the download action. in rare but possible scenarios it would have been possible to end up with both the parent and derived copies of a package included. Partial fix for #952914 Gbp-Dch: Short --- scripts/build/installer_debian-installer | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/build/installer_debian-installer b/scripts/build/installer_debian-installer index 60798c3f6..e3e79ec81 100755 --- a/scripts/build/installer_debian-installer +++ b/scripts/build/installer_debian-installer @@ -546,14 +546,15 @@ then for UDEB in ${UDEBS} do - # Copy from cache if available, otherwise download - if [ -f ../cache/packages.installer_debian-installer.udeb/"$(basename ${UDEB})" ] + _UDEB_FILENAME="$(basename ${UDEB})" + # Skip if already got (any version), i.e. should parent and derive both list it + if ! ls "$(${_UDEB_FILENAME} | awk -F_ '{ print $1 }')"_* > /dev/null 2>&1 then - cp ../cache/packages.installer_debian-installer.udeb/"$(basename ${UDEB})" ./ - else - # Skip if already got (any version), i.e. should parent and derive both list it - if ! ls "$(basename ${UDEB} | awk -F_ '{ print $1 }')"_* > /dev/null 2>&1 + # Copy from cache if available, otherwise download + if [ -f ../cache/packages.installer_debian-installer.udeb/"${_UDEB_FILENAME}" ] then + cp ../cache/packages.installer_debian-installer.udeb/"${_UDEB_FILENAME}" ./ + else wget ${WGET_OPTIONS} "${LB_MIRROR_CHROOT}"/${UDEB} || wget ${WGET_OPTIONS} "${LB_PARENT_MIRROR_CHROOT}"/${UDEB} fi fi -- cgit v1.2.3