#!/bin/sh
# $FreeBSD: ports/archivers/dpkg/files/pkg-deinstall.in,v 1.1 2007/02/06 21:05:29 miwi Exp $

DPKGDIR="/var/db/dpkg"

case $2 in
DEINSTALL)
	# Delete available, diversions, statoverride, and status in ${DPKGDIR} 
	# if they are empty files.
	for file in available diversions statoverride status; do
		path=${DPKGDIR}/$file
		if [ -e $path -a ! -s $path ]; then
			rm -f $path
		fi
	done
	;;
esac
