summaryrefslogtreecommitdiff
path: root/scripts/build/installer_debian-installer
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-02-13 04:55:14 +0000
committerLyndon Brown <jnqnfe@gmail.com>2020-03-05 21:34:38 +0000
commit0869a890ae461c01a3c29a81f972605abbd23b9e (patch)
tree4a8069bf08caa05d8f800e3a092b6addbe0cf316 /scripts/build/installer_debian-installer
parentb54bdd7fb18d32178094e8c4e1493b6121044c11 (diff)
downloadvyos-live-build-0869a890ae461c01a3c29a81f972605abbd23b9e.tar.gz
vyos-live-build-0869a890ae461c01a3c29a81f972605abbd23b9e.zip
installer: download udebs directly from correct mirror
instead of trying all from derived mirror then falling back to parent upon failure, which as pointed out by a message printed out can result in a load of spurious 404 errors; actually get each udeb from the mirror it is supposed to be retrieved from. Partial fix for #952914, this is the last commit for it so closes it Gbp-Dch: Short Closes: #952914
Diffstat (limited to 'scripts/build/installer_debian-installer')
-rwxr-xr-xscripts/build/installer_debian-installer37
1 files changed, 22 insertions, 15 deletions
diff --git a/scripts/build/installer_debian-installer b/scripts/build/installer_debian-installer
index 91a2b0603..5aced7458 100755
--- a/scripts/build/installer_debian-installer
+++ b/scripts/build/installer_debian-installer
@@ -529,16 +529,17 @@ then
fi
UDEBS="$(awk '/Filename: / { print $2 }' Packages)"
+ UDEBS_DERIVED=""
if [ "${LB_DERIVATIVE}" = "true" ]
then
- _UDEBS_DERIVED="$(awk '/Filename: / { print $2 }' Packages.derivative)"
+ UDEBS_DERIVED="$(awk '/Filename: / { print $2 }' Packages.derivative)"
# Filter parent packages to exclude those replaced by derivative
# We need to compare package names from lists of paths and filenames that include versions
_UDEBS_FILTERED=""
_UDEBS_DERIVED_NAMES=""
- for _UDEB in ${_UDEBS_DERIVED}
+ for _UDEB in ${UDEBS_DERIVED}
do
_UDEBS_DERIVED_NAMES="${_UDEBS_DERIVED_NAMES} $(basename ${_UDEB} | awk -F_ '{ print $1 }')"
done
@@ -549,23 +550,14 @@ then
_UDEBS_FILTERED="${_UDEBS_FILTERED} ${_UDEB}"
fi
done
- _UDEBS_DERIVED_NAMES=""
-
- # Combine into one list
- UDEBS="${_UDEBS_FILTERED} ${_UDEBS_DERIVED}"
-
- _UDEBS_DERIVED=""
+ UDEBS="${_UDEBS_FILTERED}"
_UDEBS_FILTERED=""
+ _UDEBS_DERIVED_NAMES=""
fi
# Downloading udeb packages
Echo_message "Downloading udebs..."
- if [ "${LB_DERIVATIVE}" = "true" ]
- then
- Echo_message "Building in derivative mode in debian+ layout.. a lot of 404 errors are ok here."
- fi
-
for UDEB in ${UDEBS}
do
_UDEB_FILENAME="$(basename ${UDEB})"
@@ -574,10 +566,25 @@ then
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}"
+ wget ${WGET_OPTIONS} "${LB_PARENT_MIRROR_CHROOT}/${UDEB}"
fi
done
+ if [ "${LB_DERIVATIVE}" = "true" ]
+ then
+ for UDEB in ${UDEBS_DERIVED}
+ do
+ _UDEB_FILENAME="$(basename ${UDEB})"
+ # 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}"
+ fi
+ done
+ fi
+
# Caching udebs
rm -rf ../cache/packages.installer_debian-installer.udeb
mkdir -p ../cache/packages.installer_debian-installer.udeb
@@ -646,7 +653,7 @@ then
done < exclude
# Sort udebs into alphabetised pool structure
- for UDEB in ${UDEBS}
+ for UDEB in "${UDEBS} ${UDEBS_DERIVED}"
do
_UDEB_FILENAME="$(basename ${UDEB})"
Install_file "${_UDEB_FILENAME}" "pool-udeb"