2020-08-15 22:50:46 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2022-05-24 02:14:08 +00:00
|
|
|
set -eu
|
|
|
|
|
2022-10-16 13:20:59 +00:00
|
|
|
if [ "${MMDEBSTRAP_VERBOSITY:-1}" -ge 3 ]; then
|
2022-05-24 02:14:08 +00:00
|
|
|
set -x
|
|
|
|
fi
|
2020-08-15 22:50:46 +00:00
|
|
|
|
|
|
|
rootdir="$1"
|
|
|
|
|
2020-08-17 17:01:27 +00:00
|
|
|
if [ -e "$rootdir/var/lib/dpkg/arch" ]; then
|
|
|
|
chrootarch=$(head -1 "$rootdir/var/lib/dpkg/arch")
|
|
|
|
else
|
|
|
|
chrootarch=$(dpkg --print-architecture)
|
|
|
|
fi
|
2022-11-16 12:59:38 +00:00
|
|
|
libdir="/usr/lib/$(dpkg-architecture -a "$chrootarch" -q DEB_HOST_MULTIARCH)"
|
2020-08-17 17:01:27 +00:00
|
|
|
|
|
|
|
# if eatmydata was actually installed properly, then we are not removing
|
|
|
|
# anything here
|
2023-05-02 09:20:51 +00:00
|
|
|
if ! chroot "$rootdir" dpkg-query --show eatmydata; then
|
2020-08-17 17:01:27 +00:00
|
|
|
rm "$rootdir/usr/bin/eatmydata"
|
|
|
|
fi
|
2023-05-02 09:20:51 +00:00
|
|
|
if ! chroot "$rootdir" dpkg-query --show libeatmydata1; then
|
2020-08-17 17:01:27 +00:00
|
|
|
rm "$rootdir$libdir"/libeatmydata.so*
|
|
|
|
fi
|
|
|
|
|
2020-08-20 18:28:14 +00:00
|
|
|
rm "$rootdir/usr/bin/dpkg"
|
|
|
|
chroot "$rootdir" dpkg-divert --local --rename --remove /usr/bin/dpkg
|
2020-08-15 22:50:46 +00:00
|
|
|
|
|
|
|
sync
|