Permalink
Fetching contributors…
Cannot retrieve contributors at this time
executable file 43 lines (36 sloc) 1.06 KB
#!/bin/sh
#
# removing debian packaging artifacts
set -ex
echo "I: Removing the debian legacy"
PREFIX=binary/boot/filesystem.dir
# store manifest of all installed packages
(cd $PREFIX
install -m755 -d usr/share/snappy
chroot . dpkg -l > usr/share/snappy/dpkg.list
)
# dpkg-deb and dpkg purposefully left behind
(cd $PREFIX
chroot . dpkg --purge --force-depends apt libapt-inst2.0 libapt-pkg5.0 lsb-release
rm -r \
var/lib/dpkg \
var/log/apt
rm \
usr/bin/dpkg \
usr/bin/dpkg-query \
usr/bin/dpkg-split \
usr/bin/dpkg-divert \
usr/bin/dpkg-trigger \
usr/bin/dpkg-statoverride \
usr/bin/dpkg-maintscript-helper
# remove generated locales for packages we do not use
rm -f usr/share/locale/*/LC_MESSAGES/dpkg*
rm -f usr/share/locale/*/LC_MESSAGES/libapt*
# remove generated logs
rm -f var/log/bootstrap.log \
var/log/alternatives.log \
var/log/dpkg.log
# also remove obsolete cron jobs
rm -f /etc/cron.daily/dpkg \
/etc/cron.daily/passwd
)