aboutsummaryrefslogtreecommitdiff
path: root/system/plocate/doinst.sh
blob: 1ef6f52f261745efc8f2e7e3546bbaf19d1ca677 (plain)
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
config() {
  NEW="$1"
  OLD="$(dirname $NEW)/$(basename $NEW .new)"
  if [ ! -r $OLD ]; then
    mv $NEW $OLD
  elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
    rm $NEW
  fi
}

config etc/updatedb.conf.new

# If there's no locate link, take over:
if [ ! -r usr/bin/locate ]; then
  ( cd usr/bin ; ln -sf plocate locate )
fi

# same for these man pages
if [ ! -r usr/man/man5/updatedb.conf.5.gz ]; then
  ( cd usr/man/man5 ; ln -sf plocate-updatedb.conf.5.gz updatedb.conf.5.gz )
fi

if [ ! -r usr/man/man1/locate.1.gz ]; then
  ( cd usr/man/man1 ; ln -sf plocate.1.gz locate.1.gz )
fi