2020-08-15 22:50:46 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -exu
|
|
|
|
|
|
|
|
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
|
|
|
|
libdir="/usr/lib/$(dpkg-architecture -a $chrootarch -q DEB_HOST_MULTIARCH)"
|
|
|
|
|
|
|
|
# if eatmydata was actually installed properly, then we are not removing
|
|
|
|
# anything here
|
|
|
|
if ! chroot "$rootdir" dpkg-query --list eatmydata; then
|
|
|
|
rm "$rootdir/usr/bin/eatmydata"
|
|
|
|
fi
|
|
|
|
if ! chroot "$rootdir" dpkg-query --list libeatmydata1; then
|
|
|
|
rm "$rootdir$libdir"/libeatmydata.so*
|
|
|
|
fi
|
|
|
|
|
2020-08-15 22:50:46 +00:00
|
|
|
mv "$rootdir/usr/bin/dpkg.orig" "$rootdir/usr/bin/dpkg"
|
|
|
|
|
|
|
|
sync
|