diff options
author | Daniel Baumann <daniel@debian.org> | 2009-11-18 19:43:24 +0100 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 19:17:02 +0100 |
commit | 89ae0639913a580fdea900b171fb014aed14d6e0 (patch) | |
tree | 029c958fe249ef5a5275f95848724ff4c79c4b8f /helpers | |
parent | 10c94c76c2da05e546bcce373a1600d2a0ab2361 (diff) | |
download | live-build-89ae0639913a580fdea900b171fb014aed14d6e0.zip live-build-89ae0639913a580fdea900b171fb014aed14d6e0.tar.gz |
Using /etc/apt/sources.list.d mechanism for local sources.list snipplets.
Diffstat (limited to 'helpers')
-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 31c6124..fc8d193 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 |