packaging-add-macos-bits-20020826
[openafs.git] / src / packaging / MacOS / OpenAFS.post_install
1 #!/bin/sh
2 if [ -d /afs -a ! -h /afs ]; then
3    rmdir /afs
4 fi
5 mkdir -p /Network/afs
6 if [ ! -h /afs ]; then
7   ln -s /Network/afs /afs
8 fi
9
10 cd /var/db/openafs/etc
11
12 if [ ! -f cacheinfo ]; then
13    cp cacheinfo.sample cacheinfo
14 fi
15
16 # testing case -- upgrading from pre 1.2.7, but .last file exists.
17 # merge the .save and .last....
18 if [ ! -f CellServDB -a -f CellServDB.save -a -f CellServDB.master.last ]; then
19    cp CellServDB.save CellServDB
20 fi
21
22 # upgrading between 2 post-1.2.7 releases (or the testing case)
23 if [ -f CellServDB.master.last ]; then
24   if cmp -s CellServDB.master.last CellServDB.master ; then
25     echo No CellServDB updates
26     done=1
27   fi
28 fi
29
30 # the local changes were included in the update
31 if [ -z "$done" -a  -f CellServDB ]; then
32   if cmp -s CellServDB CellServDB.master ; then
33     echo CellServDB is up to date.
34     cp CellServDB.master CellServDB.master.last
35     done=1
36   fi
37 fi
38
39 if [ -z "$done" ]; then
40   # there are local changes to be merged
41   if [ -f CellServDB -a -f CellServDB.master.last ]; then
42     echo Merging CellServDB entries....
43     perl $1/Contents/Resources/csrvdbmerge.pl
44     echo done
45   else
46     # this is a new install, or an upgrade from pre-1.2.7
47     echo "Installing new CellServDB"
48     cp CellServDB.master CellServDB.master.last
49     cp CellServDB.master CellServDB
50   fi
51 fi