diff -Nru live-build-3.0~a57/debian/changelog live-build-3.0~a57/debian/changelog --- live-build-3.0~a57/debian/changelog 2017-03-01 05:21:28.000000000 +0000 +++ live-build-3.0~a57/debian/changelog 2017-03-31 11:30:01.000000000 +0000 @@ -1,3 +1,10 @@ +live-build (3.0~a57-1ubuntu25.3) xenial; urgency=medium + + * ubuntu-debootstrap-demotions.patch: Hard-code the removals instead of + trying to play fancy games with detection of demotions (LP: #1678042) + + -- Adam Conrad Fri, 31 Mar 2017 05:30:01 -0600 + live-build (3.0~a57-1ubuntu25.2) xenial; urgency=medium * debian/patches/ubuntu-debootstrap-demotions.patch: remove packages diff -Nru live-build-3.0~a57/debian/patches/ubuntu-debootstrap-demotions.patch live-build-3.0~a57/debian/patches/ubuntu-debootstrap-demotions.patch --- live-build-3.0~a57/debian/patches/ubuntu-debootstrap-demotions.patch 2017-03-01 05:21:14.000000000 +0000 +++ live-build-3.0~a57/debian/patches/ubuntu-debootstrap-demotions.patch 2017-03-31 11:30:01.000000000 +0000 @@ -1,72 +1,17 @@ -Author: Steve Langasek -Description: remove packages after bootstrap that have been demoted - If we are doing a minimal bootstrap, we only want packages that are - Priority: required. Sometimes we may want to downgrade a package from - required post-release; in this case it will still be installed by - debootstrap, but we would want to remove it post-bootstrap. This patch - implements handling of this for any packages which have been downgraded - and removed without removing other installed packages. -Bug-Ubuntu: https://bugs.launchpad.net/bugs/1668847 +Description: Remove locales and tzdata after debootstrap +Author: Adam Conrad +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1678042 +Last-Update: 2017-03-31 -Index: live-build-3.0~a57/scripts/build/lb_chroot_archives -=================================================================== ---- live-build-3.0~a57.orig/scripts/build/lb_chroot_archives -+++ live-build-3.0~a57/scripts/build/lb_chroot_archives -@@ -23,6 +23,45 @@ +--- live-build-3.0~a57.orig/scripts/build/lb_bootstrap_debootstrap ++++ live-build-3.0~a57/scripts/build/lb_bootstrap_debootstrap +@@ -169,6 +169,9 @@ then + # Removing bootstrap cache + rm -f chroot/var/cache/apt/archives/*.deb - Arguments "${@}" - -+# remove all installed packages that are Prio: required in the release -+# pocket but something else in the latest version -+remove_demoted_packages() { -+ requireds=$( -+ Chroot chroot dpkg -l | awk '/^ii/ { print $2 " " $3 }' \ -+ | while read pkg ver -+ do -+ prio=$(Chroot chroot apt-cache show "$pkg=$ver" \ -+ | awk '/^Priority: / { print $2 }') -+ if [ "$prio" = required ]; then -+ echo "$pkg" -+ fi -+ done -+ ) -+ for pkg in $requireds; do -+ prio=$(Chroot chroot apt-cache show $pkg \ -+ | awk '/^Priority:/ { print $2 }' | sort -u) -+ if [ "$prio" != required ]; then -+ removals="$removals${removals:+ }$pkg" -+ fi -+ done -+ -+ while true; do -+ for pkg in $removals; do -+ count=$(Chroot chroot apt-get -s remove $pkg \ -+ | grep -c ^Remv) -+ if [ "$count" -eq 1 ]; then -+ Chroot chroot apt-get -y remove --purge $pkg -+ else -+ new_removals="$new_removals${new_removals:+ }$pkg" -+ fi -+ done -+ if [ "$new_removals" = "$removals" ]; then -+ break -+ fi -+ removals="$new_removals" -+ done -+} -+ - # Reading configuration files - Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source - Set_defaults -@@ -463,6 +502,11 @@ - >> chroot/root/packages.chroot - fi - -+ if [ "$LB_BOOTSTRAP_FLAVOUR" = minimal ]; then -+ Apt chroot update -+ remove_demoted_packages -+ fi ++ # Remove demoted packages ++ Chroot chroot dpkg --purge locales tzdata + - # Update indices from cache - if [ "${LB_CACHE_INDICES}" = "true" ] && [ -d cache/indices.bootstrap ] - then + # Creating stage file + Create_stagefile .build/bootstrap + else