/usr/sbin/update-dlocatedb is in dlocate 1.07+nmu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | #! /bin/sh
DPKGLIST='/var/lib/dlocate/dpkg-list'
pkgs=1
files=1
usage() {
[ -n "$*" ] && printf "%s\n" "$*" > /dev/stderr && exit 1
cat <<__EOF__
Usage:
$0 [options]
Options:
-p Update the packages list only
-f Update the files list only
-b Update both (default)
-h This help message
__EOF__
exit 1
}
while getopts "pfbh" opt; do
case "$opt" in
p) pkgs=1 ; files='' ;;
f) pkgs='' ; files=1 ;;
b) pkgs=1 ; files=1 ;;
h) usage ;;
*) usage "%s\n" "Unknown option: '$opt'" ;;
esac
done
shift $((OPTIND-1))
# See ionice(1)
if [ -x /usr/bin/ionice ]; then
# don't run ionice if kernel version < 2.6.13
KVER=$(uname -r)
case "$KVER" in
2.[012345]*) ;;
2.6.[0-9]) ;;
2.6.[0-9].*) ;;
2.6.1[012]*) ;;
# Redirect ionice output to /dev/null because VSERVER & OPENVZ
# & probably other container environments don't like it. See
# Bug#456292
*) ionice -c3 -p$$ > /dev/null 2>&1 ;;
esac
fi
if [ -n "$files" ] ; then
# update dlocate database
test -x /usr/share/dlocate/updatedb && /usr/share/dlocate/updatedb >/dev/null
fi
if [ -n "$pkgs" ] ; then
# update 'dlocate -l' emulation
# use sed to convert first, second, and fourth space on each line of
# dpkg -l to tab characters so we can use that as a field-sep in awk for
# 'dlocate -l'.
#
# convert third space to a : for architecture
dpkg -l "*" |
sed -e '1,5d; s/ */ /g; s/ /\t/; s/ /\t/; s/ /:/; s/ /\t/' |
sort -k2 |
uniq -f2 > "$DPKGLIST"
fi
|