diff options
author | Daniel Baumann <daniel@debian.org> | 2009-11-18 19:43:24 +0100 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2009-11-22 14:45:32 +0100 |
commit | 2630eff3570a8476724f795fd8d7aa2d41349a0e (patch) | |
tree | 029c958fe249ef5a5275f95848724ff4c79c4b8f | |
parent | 4c517f8c1e046b889497bfd2a0b7b429c9a13616 (diff) | |
download | vyos-live-build-2630eff3570a8476724f795fd8d7aa2d41349a0e.tar.gz vyos-live-build-2630eff3570a8476724f795fd8d7aa2d41349a0e.zip |
Using /etc/apt/sources.list.d mechanism for local sources.list snipplets.
-rwxr-xr-x | helpers/lh_chroot_sources | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/helpers/lh_chroot_sources b/helpers/lh_chroot_sources index 31c612478..fc8d193b2 100755 --- a/helpers/lh_chroot_sources +++ b/helpers/lh_chroot_sources @@ -78,12 +78,19 @@ case "${1}" in # Check local sources.list if Find_files config/chroot_sources/*.chroot then - echo "" >> chroot/etc/apt/sources.list - echo "# Custom repositories" >> chroot/etc/apt/sources.list + # Deconfigure (possibly) old sources.list snipplets + if Find_files config/chroot_sources/*.binary + then + for FILE in config/chroot_sources/*.binary + do + rm -f "chroot/etc/apt/sources.list.d/$(basename ${FILE} .binary)" + done + fi + # Configure new sources.list snipplets for FILE in config/chroot_sources/*.chroot do - cat ${FILE} | grep -v "^##" >> chroot/etc/apt/sources.list + cp "${FILE}" "chroot/etc/apt/sources.list.d/$(basename ${FILE} .chroot)" done fi @@ -401,12 +408,19 @@ case "${1}" in # Check local sources.list if Find_files config/chroot_sources/*.binary then - echo "" >> chroot/etc/apt/sources.list - echo "# Custom repositories" >> chroot/etc/apt/sources.list + # Deconfigure (possibly) old sources.list snipplets + if Find_files config/chroot_sources/*.chroot + then + for FILE in config/chroot_sources/*.chroot + do + rm -f "chroot/etc/apt/sources.list.d/$(basename ${FILE} .chroot)" + done + fi + # Configure new sources.list snipplets for FILE in config/chroot_sources/*.binary do - cat ${FILE} | grep -v "^##" >> chroot/etc/apt/sources.list + cp "${FILE}" "chroot/etc/apt/sources.list.d/$(basename ${FILE} .binary)" done fi |