]> git.plutz.net Git - blast/commitdiff
more reliable removal of packages
authorPaul Hänsch <paul@plutz.net>
Tue, 17 Sep 2019 03:02:59 +0000 (05:02 +0200)
committerPaul Hänsch <paul@plutz.net>
Tue, 17 Sep 2019 03:02:59 +0000 (05:02 +0200)
Makefile

index 29a2582a04413b8ff5fb59a7e96c85b7d5a58062..274d1c7c79d35764edbc2b3dc630a0ed05979122 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -221,7 +221,7 @@ _norecommends: ${SYSROOT}/etc/apt/apt.conf.d/10norecommends
 
 ${SYSROOT}/etc/apt/apt.conf.d/10norecommends: ${SYSROOT}
        mkdir -p -m 755 "$(dir $@)"
-       printf 'APT::Install-Recommends "false";\n' >"$@"
+       printf 'APT::%s "false";\n' "Install-Recommends" "Keep-Recommends" "Install-Suggests" "Keep-Suggests" >"$@"
        chmod 644 "$@"
 
 ${SYSROOT}/etc/apt/trusted.gpg.d/: ${SYSROOT} _bootstrap
@@ -236,6 +236,9 @@ _install: ${SYSROOT} _aptkeys _norecommends
        chroot "$${SYSROOT}" ln -sf /bin/true /usr/local/sbin/invoke-rc.d
        chroot "$${SYSROOT}" ln -sf /bin/true /usr/sbin/udevadm
        chroot "$${SYSROOT}" apt-get --yes install ${PACKAGES}
+       mkdir -p -m 755 "$${SYSROOT}/var/lib/deborphan/"
+       chroot "$${SYSROOT}" sh -c 'printf "%s\\n" ${PACKAGES} >/var/lib/deborphan/keep'
+       -chroot "$${SYSROOT}" sh -c 'apt-get --yes purge $$(deborphan -an |sed "s;^.* ;;g")'
        chroot "$${SYSROOT}" apt-get --yes --auto-remove purge
        -chroot "$${SYSROOT}" apt-get --yes --auto-remove upgrade
        chroot "$${SYSROOT}" apt-get clean