#! /bin/sh

DPKGLIST=/var/lib/dlocate/dpkg-list

# exit if dlocate is uninstalled but not purged
test -x /usr/sbin/update-dlocatedb || exit 0
# update dlocate database
/usr/sbin/update-dlocatedb >/dev/null

# update 'dlocate -l' emulation
LINES=40 COLUMNS=200 dpkg -l "*" | sed -e '1,5d' -e 's/  */ /g' >$DPKGLIST
