40
|
1 #! /bin/sh
|
|
2 # installml.sh --- install or uninstall manpage links for Vim
|
|
3 #
|
|
4 # arguments:
|
|
5 # 1 what: "install" or "uninstall"
|
|
6 # 2 also do GUI pages: "yes" or ""
|
|
7 # 3 target directory e.g., "/usr/local/man/it/man1"
|
|
8 # 4 vim exe name e.g., "vim"
|
|
9 # 5 vimdiff exe name e.g., "vimdiff"
|
|
10 # 6 evim exe name e.g., "evim"
|
|
11 # 7 ex exe name e.g., "ex"
|
|
12 # 8 view exe name e.g., "view"
|
|
13 # 9 rvim exe name e.g., "rvim"
|
|
14 # 10 rview exe name e.g., "rview"
|
|
15 # 11 gvim exe name e.g., "gvim"
|
|
16 # 12 gview exe name e.g., "gview"
|
|
17 # 13 rgvim exe name e.g., "rgvim"
|
|
18 # 14 rgview exe name e.g., "rgview"
|
|
19 # 15 gvimdiff exe name e.g., "gvimdiff"
|
|
20 # 16 eview exe name e.g., "eview"
|
|
21
|
|
22 errstatus=0
|
|
23
|
|
24 what=$1
|
|
25 gui=$2
|
|
26 destdir=$3
|
|
27 vimname=$4
|
|
28 vimdiffname=$5
|
|
29 evimname=$6
|
|
30 exname=$7
|
|
31 viewname=$8
|
|
32 rvimname=$9
|
|
33 rviewname=${10}
|
|
34 gvimname=${11}
|
|
35 gviewname=${12}
|
|
36 rgvimname=${13}
|
|
37 rgviewname=${14}
|
|
38 gvimdiffname=${15}
|
|
39 eviewname=${16}
|
|
40
|
231
|
41 if test $what = "install" -a \( -e $destdir/$vimname.1 -o -e $destdir/$vimdiffname.1 -o -e $destdir/$eviewname.1 \); then
|
40
|
42 if test ! -d $destdir; then
|
|
43 echo creating $destdir
|
|
44 ./mkinstalldirs $destdir
|
|
45 fi
|
|
46
|
|
47 # ex
|
228
|
48 if test ! -e $destdir/$exname.1 -a -e $destdir/$vimname.1; then
|
40
|
49 echo creating link $destdir/$exname.1
|
|
50 cd $destdir; ln -s $vimname.1 $exname.1
|
|
51 fi
|
|
52
|
|
53 # view
|
228
|
54 if test ! -e $destdir/$viewname.1 -a -e $destdir/$vimname.1; then
|
40
|
55 echo creating link $destdir/$viewname.1
|
|
56 cd $destdir; ln -s $vimname.1 $viewname.1
|
|
57 fi
|
|
58
|
|
59 # rvim
|
228
|
60 if test ! -e $destdir/$rvimname.1 -a -e $destdir/$vimname.1; then
|
40
|
61 echo creating link $destdir/$rvimname.1
|
|
62 cd $destdir; ln -s $vimname.1 $rvimname.1
|
|
63 fi
|
|
64
|
|
65 # rview
|
228
|
66 if test ! -e $destdir/$rviewname.1 -a -e $destdir/$vimname.1; then
|
40
|
67 echo creating link $destdir/$rviewname.1
|
|
68 cd $destdir; ln -s $vimname.1 $rviewname.1
|
|
69 fi
|
|
70
|
|
71 # GUI targets are optional
|
|
72 if test "$gui" = "yes"; then
|
|
73 # gvim
|
228
|
74 if test ! -e $destdir/$gvimname.1 -a -e $destdir/$vimname.1; then
|
40
|
75 echo creating link $destdir/$gvimname.1
|
|
76 cd $destdir; ln -s $vimname.1 $gvimname.1
|
|
77 fi
|
|
78
|
|
79 # gview
|
228
|
80 if test ! -e $destdir/$gviewname.1 -a -e $destdir/$vimname.1; then
|
40
|
81 echo creating link $destdir/$gviewname.1
|
|
82 cd $destdir; ln -s $vimname.1 $gviewname.1
|
|
83 fi
|
|
84
|
|
85 # rgvim
|
228
|
86 if test ! -e $destdir/$rgvimname.1 -a -e $destdir/$vimname.1; then
|
40
|
87 echo creating link $destdir/$rgvimname.1
|
|
88 cd $destdir; ln -s $vimname.1 $rgvimname.1
|
|
89 fi
|
|
90
|
|
91 # rgview
|
228
|
92 if test ! -e $destdir/$rgviewname.1 -a -e $destdir/$vimname.1; then
|
40
|
93 echo creating link $destdir/$rgviewname.1
|
|
94 cd $destdir; ln -s $vimname.1 $rgviewname.1
|
|
95 fi
|
|
96
|
|
97 # gvimdiff
|
228
|
98 if test ! -e $destdir/$gvimdiffname.1 -a -e $destdir/$vimdiffname.1; then
|
40
|
99 echo creating link $destdir/$gvimdiffname.1
|
|
100 cd $destdir; ln -s $vimdiffname.1 $gvimdiffname.1
|
|
101 fi
|
|
102
|
|
103 # eview
|
228
|
104 if test ! -e $destdir/$eviewname.1 -a -e $destdir/$evimname.1; then
|
40
|
105 echo creating link $destdir/$eviewname.1
|
|
106 cd $destdir; ln -s $evimname.1 $eviewname.1
|
|
107 fi
|
|
108 fi
|
|
109 fi
|
|
110
|
|
111 if test $what = "uninstall"; then
|
|
112 echo Checking for Vim manual page links in $destdir...
|
|
113
|
|
114 if test -L $destdir/$exname.1; then
|
|
115 echo deleting $destdir/$exname.1
|
|
116 rm -f $destdir/$exname.1
|
|
117 fi
|
|
118 if test -L $destdir/$viewname.1; then
|
|
119 echo deleting $destdir/$viewname.1
|
|
120 rm -f $destdir/$viewname.1
|
|
121 fi
|
|
122 if test -L $destdir/$rvimname.1; then
|
|
123 echo deleting $destdir/$rvimname.1
|
|
124 rm -f $destdir/$rvimname.1
|
|
125 fi
|
|
126 if test -L $destdir/$rviewname.1; then
|
|
127 echo deleting $destdir/$rviewname.1
|
|
128 rm -f $destdir/$rviewname.1
|
|
129 fi
|
|
130
|
|
131 # GUI targets are optional
|
|
132 if test "$gui" = "yes"; then
|
|
133 if test -L $destdir/$gvimname.1; then
|
|
134 echo deleting $destdir/$gvimname.1
|
|
135 rm -f $destdir/$gvimname.1
|
|
136 fi
|
|
137 if test -L $destdir/$gviewname.1; then
|
|
138 echo deleting $destdir/$gviewname.1
|
|
139 rm -f $destdir/$gviewname.1
|
|
140 fi
|
|
141 if test -L $destdir/$rgvimname.1; then
|
|
142 echo deleting $destdir/$rgvimname.1
|
|
143 rm -f $destdir/$rgvimname.1
|
|
144 fi
|
|
145 if test -L $destdir/$rgviewname.1; then
|
|
146 echo deleting $destdir/$rgviewname.1
|
|
147 rm -f $destdir/$rgviewname.1
|
|
148 fi
|
|
149 if test -L $destdir/$gvimdiffname.1; then
|
|
150 echo deleting $destdir/$gvimdiffname.1
|
|
151 rm -f $destdir/$gvimdiffname.1
|
|
152 fi
|
|
153 if test -L $destdir/$eviewname.1; then
|
|
154 echo deleting $destdir/$eviewname.1
|
|
155 rm -f $destdir/$eviewname.1
|
|
156 fi
|
|
157 fi
|
|
158 fi
|
|
159
|
|
160 exit $errstatus
|
|
161
|
|
162 # vim: set sw=3 :
|