summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphaƫl Hertzog <hertzog@debian.org>2014-12-05 09:53:13 +0100
committerDaniel Baumann <mail@daniel-baumann.ch>2014-12-10 06:24:02 +0100
commita294a46fb9fe28e43686b18da7b22ec1c46b0d4f (patch)
treef295bfd0474f5870539cfc06799b389fe30d3efb
parent571c89447b539bf9e2e1267b54953108e6177ee2 (diff)
downloadvyos-live-build-a294a46fb9fe28e43686b18da7b22ec1c46b0d4f.tar.gz
vyos-live-build-a294a46fb9fe28e43686b18da7b22ec1c46b0d4f.zip
Properly support empty package lists.
The user might not have created any package list or it might have created a packages list that end up being empty due to various #if tests. We should not fail in those cases.
-rwxr-xr-xscripts/build/binary_package-lists6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/build/binary_package-lists b/scripts/build/binary_package-lists
index 0584c59e6..496d63159 100755
--- a/scripts/build/binary_package-lists
+++ b/scripts/build/binary_package-lists
@@ -101,7 +101,7 @@ then
Expand_packagelist "${LIST}" "config/package-lists" > chroot/root/"$(basename ${LIST})"
# Downloading additional packages
- Chroot chroot "xargs --arg-file=/root/$(basename ${LIST}) apt-get ${APT_OPTIONS} -o Dir::Cache=/binary.deb --download-only install"
+ Chroot chroot "xargs --no-run-if-empty --arg-file=/root/$(basename ${LIST}) apt-get ${APT_OPTIONS} -o Dir::Cache=/binary.deb --download-only install"
# Remove package list
rm chroot/root/"$(basename ${LIST})"
@@ -110,6 +110,10 @@ then
for FILE in chroot/binary.deb/archives/*.deb
do
+ if [ ! -e ${FILE} ]; then
+ break # Do nothing if the package lists were empty...
+ fi
+
SOURCE="$(dpkg -f ${FILE} Source | awk '{ print $1 }')"
SECTION="$(dpkg -f ${FILE} Section | awk '{ print $1 }')"