summaryrefslogtreecommitdiff
path: root/helpers
diff options
context:
space:
mode:
authorChris Lamb <chris@chris-lamb.co.uk>2008-08-08 21:16:42 +0100
committerDaniel Baumann <daniel@debian.org>2011-03-09 19:03:37 +0100
commit382d244050abbfb9f9e52ec9383d333b158ded5d (patch)
treecf5efd82538a8753ce755919ad4eb3b289e80443 /helpers
parent45bc246fbb58dca5f64dbb83bebb3dd636a55bfd (diff)
downloadlive-build-382d244050abbfb9f9e52ec9383d333b158ded5d.zip
live-build-382d244050abbfb9f9e52ec9383d333b158ded5d.tar.gz
Always add our apt_preference(5) pinning stanza when using local-packages.
This mostly reverts my most recent chroot_local-packages/preferences commit as I found problems when re-running parts of the build: as the pinning stanza was removed, calls to "apt-get upgrade" from within live-helper would remove replacement packages placed in chroot_local-packages. This isn't 100% foolproof - running apt-get upgrade on the binary image may still attempt to remove replacement packages (heavy users of this should probably be using their own repo for this sort of thing anyway).
Diffstat (limited to 'helpers')
-rwxr-xr-xhelpers/lh_chroot_apt10
-rwxr-xr-xhelpers/lh_chroot_install-packages17
2 files changed, 12 insertions, 15 deletions
diff --git a/helpers/lh_chroot_apt b/helpers/lh_chroot_apt
index 6bfb7c3..1f8741e 100755
--- a/helpers/lh_chroot_apt
+++ b/helpers/lh_chroot_apt
@@ -159,3 +159,13 @@ case "${1}" in
Usage
;;
esac
+
+if ls config/chroot_local-packages/*.deb > /dev/null 2>&1
+then
+ cat >>chroot/etc/apt/preferences <<EOF
+
+Package: *
+Pin: release o=chroot_local-packages
+Pin-Priority: 1001
+EOF
+fi
diff --git a/helpers/lh_chroot_install-packages b/helpers/lh_chroot_install-packages
index 169510b..c97adde 100755
--- a/helpers/lh_chroot_install-packages
+++ b/helpers/lh_chroot_install-packages
@@ -47,32 +47,19 @@ 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} -o Dir::Etc::preferences=preferences.live install"
+ Chroot "xargs --arg-file=/root/chroot_packages apt-get ${APT_OPTIONS} install"
;;
aptitude)
- Chroot "xargs --arg-file=/root/chroot_packages aptitude ${APTITUDE_OPTIONS} -o Dir::Etc::preferences=preferences.live install"
+ Chroot "xargs --arg-file=/root/chroot_packages aptitude ${APTITUDE_OPTIONS} install"
;;
esac
# Tidying up
rm -f chroot/root/chroot_packages
- rm -f chroot/etc/apt/preferences.live
# Saving cache
Save_cache cache/packages_chroot