Preserve apt preferences created by any package we install (i.e. ubuntu-advantage-tools) against live-build's attempt to delete them. (LP: #1855354)

bionic-1855354
Michael Hudson-Doyle 5 years ago
parent e0c02f2c28
commit d381420065

8
debian/changelog vendored

@ -1,3 +1,11 @@
livecd-rootfs (2.525.36) UNRELEASED; urgency=medium
* Preserve apt preferences created by any package we install (i.e.
ubuntu-advantage-tools) against live-build's attempt to delete them.
(LP: #1855354)
-- Michael Hudson-Doyle <michael.hudson@ubuntu.com> Thu, 19 Dec 2019 15:43:56 +1300
livecd-rootfs (2.525.35) bionic; urgency=medium livecd-rootfs (2.525.35) bionic; urgency=medium
* Did not expect the bionic branch being so outdated. Backport support * Did not expect the bionic branch being so outdated. Backport support

@ -261,6 +261,12 @@ EOF
lb chroot "$@" lb chroot "$@"
if [ -d chroot/etc/apt/preferences.d.save ]; then
# https://twitter.com/infinite_scream
mv chroot/etc/apt/preferences.d.save/* chroot/etc/apt/preferences.d/
rmdir chroot/etc/apt/preferences.d.save
fi
if [ "${SUBPROJECT:-}" = minimized ]; then if [ "${SUBPROJECT:-}" = minimized ]; then
# force removal of initramfs-tools, which we assert is not # force removal of initramfs-tools, which we assert is not
# required for any minimized images but is still pulled in by # required for any minimized images but is still pulled in by

@ -1039,6 +1039,19 @@ rm -f /etc/fstab
EOF EOF
fi fi
if [ $PROJECT != ubuntu-cpc ]; then
cat > config/hooks/100-preserve-apt-prefs.chroot <<\EOF
#! /bin/sh -ex
# live-build "helpfully" removes /etc/apt/preferences.d/* so we put a
# copy somewhere it won't touch it.
if [ -n "$(ls -A /etc/apt/preferences.d)" ]; then
cp -a /etc/apt/preferences.d /etc/apt/preferences.d.save
fi
EOF
fi
if [ $PROJECT = ubuntukylin ]; then if [ $PROJECT = ubuntukylin ]; then
cat > config/hooks/100-ubuntukylin.chroot <<EOF cat > config/hooks/100-ubuntukylin.chroot <<EOF
#! /bin/sh #! /bin/sh

@ -0,0 +1,8 @@
#! /bin/sh -ex
# live-build "helpfully" removes /etc/apt/preferences.d/* so we put a
# copy somewhere it won't touch it.
if [ -n "$(ls -A /etc/apt/preferences.d)" ]; then
cp -a /etc/apt/preferences.d /etc/apt/preferences.d.save
fi
Loading…
Cancel
Save