summaryrefslogtreecommitdiff
path: root/scripts/build/installer_debian-installer
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-02-13 03:26:53 +0000
committerLyndon Brown <jnqnfe@gmail.com>2020-03-05 21:34:38 +0000
commit2e3f195c3888c8fc6bfab64f5efaad5e54302328 (patch)
treeb042a81df36df869742ecb7eda2d0c160805a7d8 /scripts/build/installer_debian-installer
parent6997f99c9f0c1e82476f62472b2926ec3cb0379a (diff)
downloadvyos-live-build-2e3f195c3888c8fc6bfab64f5efaad5e54302328.tar.gz
vyos-live-build-2e3f195c3888c8fc6bfab64f5efaad5e54302328.zip
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
Diffstat (limited to 'scripts/build/installer_debian-installer')
-rwxr-xr-xscripts/build/installer_debian-installer13
1 files 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