summaryrefslogtreecommitdiff
path: root/helpers/lh_chroot_install-packages
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/lh_chroot_install-packages')
-rwxr-xr-xhelpers/lh_chroot_install-packages18
1 files changed, 16 insertions, 2 deletions
diff --git a/helpers/lh_chroot_install-packages b/helpers/lh_chroot_install-packages
index 469d0a23a..169510b57 100755
--- a/helpers/lh_chroot_install-packages
+++ b/helpers/lh_chroot_install-packages
@@ -47,18 +47,32 @@ then
# Restoring cache
Restore_cache cache/packages_chroot
+ # Ensure chroot_local-packages override all other packages
+ if [ -e chroot/etc/apt/preferences ]
+ then
+ cp chroot/etc/apt/preferences chroot/etc/apt/preferences.live
+ fi
+
+ cat >> chroot/etc/apt/preferences.live <<EOF
+Package: *
+Pin: release o=chroot_local-packages
+Pin-Priority: 1001
+EOF
+
# Installing packages
case "${LH_APT}" in
apt|apt-get)
- Chroot "xargs --arg-file=/root/chroot_packages apt-get ${APT_OPTIONS} install"
+ Chroot "xargs --arg-file=/root/chroot_packages apt-get ${APT_OPTIONS} -o Dir::Etc::preferences=preferences.live install"
;;
aptitude)
- Chroot "xargs --arg-file=/root/chroot_packages aptitude ${APTITUDE_OPTIONS} install"
+ Chroot "xargs --arg-file=/root/chroot_packages aptitude ${APTITUDE_OPTIONS} -o Dir::Etc::preferences=preferences.live install"
;;
esac
+ # Tidying up
rm -f chroot/root/chroot_packages
+ rm -f chroot/etc/apt/preferences.live
# Saving cache
Save_cache cache/packages_chroot