summaryrefslogtreecommitdiff
path: root/helpers/lh_chroot_sources
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/lh_chroot_sources')
-rwxr-xr-xhelpers/lh_chroot_sources26
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