Skip to content

Commit

Permalink
Merge pull request #191 from gollub/fix/pkg-deb-noscript-removal
Browse files Browse the repository at this point in the history
Add the dpkg way of noscripts removal
  • Loading branch information
adrianschroeter committed Apr 13, 2016
2 parents a673a0a + 5e80df2 commit e115463
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions build-pkg-deb
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,22 @@ pkg_install_deb() {
pkg_erase_deb() {
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_PRIORITY=critical
( cd $BUILD_ROOT && chroot $BUILD_ROOT dpkg --purge --force all $PKG 2>&1 || touch $BUILD_ROOT/exit ) | \
perl -ne '$|=1;/^(\(Reading database|Removing |Purging configuration files for )/||/^$/||print'
cd $BUILD_ROOT && chroot $BUILD_ROOT dpkg --purge --force all $PKG 2>&1 | {
local retry
while read line; do
case "$line" in
subprocess\ installed\ *script\ returned\ error\ exit\ status*)
chroot $BUILD_ROOT rm -f /var/lib/dpkg/info/$PKG.{pre,post}rm
retry=1
;;
*) echo "$line" ;;
esac
done
if test -n "$retry"; then
echo "re-try deleting $PKG without post/pre remove scripts"
chroot $BUILD_ROOT dpkg --purge --force all $PKG 2>&1 || touch $BUILD_ROOT/exit
fi
} | perl -ne '$|=1;/^(\(Reading database|Removing |Purging configuration files for )/||/^$/||print'
}

pkg_cumulate_deb() {
Expand Down

0 comments on commit e115463

Please sign in to comment.