#!/bin/sh
set -e

log_debug() {
	echo "Debug: piuparts exception for package $PIUPARTS_OBJECTS"
}

case ${PIUPARTS_OBJECTS%%=*} in
	asclassic)
		case "$PIUPARTS_DISTRIBUTION" in
			lenny)
				# purging works in lenny
				;;
			*)
				log_debug
				# postrm purge unconditionally removes some files that may be gone already
				sed -i 's/rm system.steprc menudefs.hook/rm -f system.steprc menudefs.hook/' /var/lib/dpkg/info/asclassic.postrm
				;;
		esac
		;;
	ibod|\
	isdnactivecards|\
	isdneurofile|\
	isdnlog|\
	isdnutils|\
	isdnutils-xtools|\
	isdnvbox|\
	isdnvboxserver|\
	INVALID)
		case "$PIUPARTS_DISTRIBUTION" in
			lenny|squeeze)
				#431855: isdnutils-base fails to purge with "There are still files in /etc/isdn/ that you may want to remove manually."
				log_debug
				rm -fv /etc/isdn/*
		esac
		;;
esac
