#!/bin/sh
set -e

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

case "$PIUPARTS_DISTRIBUTION" in
	lenny) : ;;
	*) exit 0 ;;
esac

case ${PIUPARTS_OBJECTS%%=*} in
	apt-xapian-index)
		# wait for update-apt-xapian-index in the background to finish
		log_debug
		sleep 30
		;;
	postgis)
		#560409: postgis can't be purged if postgresql is no longer installed
	        # (fails due to a missing directory)
		log_debug
		mkdir -p -v /usr/lib/postgresql/8.3/lib
		;;
esac
