diff options
author | B. Watson <yalhcru@gmail.com> | 2019-12-28 08:55:52 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2019-12-28 08:55:52 +0700 |
commit | 18ce54101fcedd1b595c1fcc53860a31e8f5c463 (patch) | |
tree | 3eb1db296fcdc5214e209c9756c4b196cdcd0f83 /system/mlocate/doinst.sh | |
parent | c3aed3486866289068e8b4c88c862b3a6deb8f24 (diff) | |
download | slackbuilds-18ce54101fcedd1b595c1fcc53860a31e8f5c463.tar.gz |
system/mlocate: Added (locate/updatedb implementation).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/mlocate/doinst.sh')
-rw-r--r-- | system/mlocate/doinst.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/system/mlocate/doinst.sh b/system/mlocate/doinst.sh new file mode 100644 index 0000000000..8afb2a4fff --- /dev/null +++ b/system/mlocate/doinst.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +# doinst.sh copied from Pat's, got rid of the stuff that creates the +# slocate group. + +config() { + NEW="$1" + OLD="`dirname $NEW`/`basename $NEW .new`" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} +config etc/updatedb.conf.new + +if [ ! -r var/lib/mlocate/mlocate.db ]; then + touch var/lib/mlocate/mlocate.db + chown root:slocate var/lib/mlocate/mlocate.db + chmod 640 var/lib/mlocate/mlocate.db +fi + |