diff options
author | Daniel Baumann <daniel@debian.org> | 2011-08-08 12:37:57 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-08-08 12:39:43 +0200 |
commit | eedfa8e5ce995c22a6ba25e4cbb700a718c08df6 (patch) | |
tree | a6502e90abe9ecd949bb4b3cca79ad4bfe998fd7 /scripts | |
parent | 636155709a6470ea8b8c13c4029534bbb3a7b480 (diff) | |
download | vyos-live-build-eedfa8e5ce995c22a6ba25e4cbb700a718c08df6.tar.gz vyos-live-build-eedfa8e5ce995c22a6ba25e4cbb700a718c08df6.zip |
Guarding archives handling with an additional check to prevent ugly message about files not existing.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build/lb_chroot_archives | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/scripts/build/lb_chroot_archives b/scripts/build/lb_chroot_archives index 5c27c1a2c..7bbbba7f4 100755 --- a/scripts/build/lb_chroot_archives +++ b/scripts/build/lb_chroot_archives @@ -262,11 +262,14 @@ EOF for FILE in config/archives/*.list \ config/archives/*.list.chroot do - sed -e "s|@DISTRIBUTION@|${LB_DISTRIBUTION}|g" \ - -e "s|@ARCHIVE_AREAS@|${LB_ARCHIVE_AREAS}|g" \ - -e "s|@PARENT_DISTRIBUTION@|${LB_PARENT_DISTRIBUTION}|g" \ - -e "s|@PARENT_ARCHIVE_AREAS@|${LB_PARENT_ARCHIVE_AREAS}|g" \ - "${FILE}" > "chroot/etc/apt/sources.list.d/$(basename ${FILE} .chroot)" + if [ -e "${FILE}" ] + then + sed -e "s|@DISTRIBUTION@|${LB_DISTRIBUTION}|g" \ + -e "s|@ARCHIVE_AREAS@|${LB_ARCHIVE_AREAS}|g" \ + -e "s|@PARENT_DISTRIBUTION@|${LB_PARENT_DISTRIBUTION}|g" \ + -e "s|@PARENT_ARCHIVE_AREAS@|${LB_PARENT_ARCHIVE_AREAS}|g" \ + "${FILE}" > "chroot/etc/apt/sources.list.d/$(basename ${FILE} .chroot)" + fi done fi @@ -785,11 +788,14 @@ EOF for FILE in config/archives/*.list \ config/archives/*.list.binary do - sed -e "s|@DISTRIBUTION@|${LB_DISTRIBUTION}|g" \ - -e "s|@ARCHIVE_AREAS@|${LB_ARCHIVE_AREAS}|g" \ - -e "s|@PARENT_DISTRIBUTION@|${LB_PARENT_DISTRIBUTION}|g" \ - -e "s|@PARENT_ARCHIVE_AREAS@|${LB_PARENT_ARCHIVE_AREAS}|g" \ - "${FILE}" > "chroot/etc/apt/sources.list.d/$(basename ${FILE} .binary)" + if [ -e "${FILE}" ] + then + sed -e "s|@DISTRIBUTION@|${LB_DISTRIBUTION}|g" \ + -e "s|@ARCHIVE_AREAS@|${LB_ARCHIVE_AREAS}|g" \ + -e "s|@PARENT_DISTRIBUTION@|${LB_PARENT_DISTRIBUTION}|g" \ + -e "s|@PARENT_ARCHIVE_AREAS@|${LB_PARENT_ARCHIVE_AREAS}|g" \ + "${FILE}" > "chroot/etc/apt/sources.list.d/$(basename ${FILE} .binary)" + fi done fi |