From 600275fcf9a950fcbb16dc3b2af352b681e76547 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 18 Jul 2012 21:03:20 +0200 Subject: Adding support for pinning preferences files in config/archives/*.pref{.chroot,.binary}. --- scripts/build/lb_chroot_archives | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'scripts') 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 -- cgit v1.2.3