summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2012-07-18 21:03:20 +0200
committerDaniel Baumann <daniel@debian.org>2012-07-18 21:03:20 +0200
commit600275fcf9a950fcbb16dc3b2af352b681e76547 (patch)
tree4a25a255d1bdc2b05f051ebb98bedd8c20a73463
parent0a553d2a32313ee98c1b3bfd78ea02d079d9895b (diff)
downloadvyos-live-build-600275fcf9a950fcbb16dc3b2af352b681e76547.tar.gz
vyos-live-build-600275fcf9a950fcbb16dc3b2af352b681e76547.zip
Adding support for pinning preferences files in config/archives/*.pref{.chroot,.binary}.
-rwxr-xr-xscripts/build/lb_chroot_archives52
1 files changed, 52 insertions, 0 deletions
diff --git a/scripts/build/lb_chroot_archives b/scripts/build/lb_chroot_archives
index 168b3afe7..0058f8e59 100755
--- a/scripts/build/lb_chroot_archives
+++ b/scripts/build/lb_chroot_archives
@@ -181,6 +181,9 @@ EOF
fi
fi
+ # probably too bold, needs refinment (FIXME)
+ rm -f chroot/etc/apt/preferences.d/*
+
# Configure third-party archives
if [ -n "${LB_ARCHIVES}" ]
then
@@ -224,6 +227,15 @@ EOF
"chroot/etc/apt/sources.list.d/${REPOSITORY}.list"
fi
+ # Adding pinning preferences (chroot)
+ if [ -e "${LB_BASE}/archives/${REPOSITORY}.pref" ]
+ then
+ cp "${LB_BASE}/archives/${REPOSITORY}.pref" chroot/etc/apt/sources.list.d
+ elif [ -e "${LB_BASE}/archives/${REPOSITORY}.pref.chroot" ]
+ then
+ cp "${LB_BASE}/archives/${REPOSITORY}.pref.chroot" "chroot/etc/apt/sources.list.d/${REPOSITORY}.pref"
+ fi
+
if [ "${LB_APT_SECURE}" != false ]
then
# Adding archive signing keys (chroot)
@@ -262,6 +274,20 @@ EOF
done
fi
+ # Check local pinning preferences
+ if Find_files config/archives/*.pref || \
+ Find_files config/archives/*.pref.chroot
+ then
+ for FILE in config/archives/*.pref \
+ config/archives/*.pref.chroot
+ do
+ if [ -e "${FILE}" ]
+ then
+ cp config/archives/$(basename ${_FILE} .chroot) chroot/etc/apt/preferences.d
+ fi
+ done
+ fi
+
# Configure local package repository
if Find_files config/packages.chroot/*.deb || Find_files config/packages/*.deb
then
@@ -724,6 +750,9 @@ EOF
fi
fi
+ # probably too bold, needs refinment (FIXME)
+ rm -f chroot/etc/apt/preferences.d/*
+
# Configure third-party archives
if [ -n "${LB_ARCHIVES}" ]
then
@@ -754,6 +783,15 @@ EOF
"chroot/etc/apt/sources.list.d/${REPOSITORY}.list"
fi
+ # Adding pinning preferences (binary)
+ if [ -e "${LB_BASE}/archives/${REPOSITORY}.pref" ]
+ then
+ cp "${LB_BASE}/archives/${REPOSITORY}.pref" chroot/etc/apt/sources.list.d
+ elif [ -e "${LB_BASE}/archives/${REPOSITORY}.pref.binary" ]
+ then
+ cp "${LB_BASE}/archives/${REPOSITORY}.pref.binary" "chroot/etc/apt/sources.list.d/${REPOSITORY}.pref"
+ fi
+
if [ "${LB_APT_SECURE}" != false ]
then
# Adding archive signing keys (binary)
@@ -792,6 +830,20 @@ EOF
done
fi
+ # Check local pinning preferences
+ if Find_files config/archives/*.pref || \
+ Find_files config/archives/*.pref.binary
+ then
+ for FILE in config/archives/*.pref \
+ config/archives/*.pref.binary
+ do
+ if [ -e "${FILE}" ]
+ then
+ cp config/archives/$(basename ${_FILE} .binary) chroot/etc/apt/preferences.d
+ fi
+ done
+ fi
+
# Check local archive keys
if Find_files config/archives/*.key || \
Find_files config/archives/*.key.binary