ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/install-sh
(Generate patch)

Comparing BasiliskII/src/Unix/install-sh (file contents):
Revision 1.1.1.1 by cebix, 1999-10-03T14:16:25Z vs.
Revision 1.2 by cebix, 2003-06-27T13:59:16Z

# Line 1 | Line 1
1 < #! /bin/sh
1 > #!/bin/sh
2   #
3   # install - install a program, script, or datafile
4 < # This comes from X11R5.
4 > # This comes from X11R5 (mit/util/scripts/install.sh).
5 > #
6 > # Copyright 1991 by the Massachusetts Institute of Technology
7 > #
8 > # Permission to use, copy, modify, distribute, and sell this software and its
9 > # documentation for any purpose is hereby granted without fee, provided that
10 > # the above copyright notice appear in all copies and that both that
11 > # copyright notice and this permission notice appear in supporting
12 > # documentation, and that the name of M.I.T. not be used in advertising or
13 > # publicity pertaining to distribution of the software without specific,
14 > # written prior permission.  M.I.T. makes no representations about the
15 > # suitability of this software for any purpose.  It is provided "as is"
16 > # without express or implied warranty.
17   #
18   # Calling this script install-sh is preferred over install.sh, to prevent
19   # `make' implicit rules from creating a file called install from it
20   # when there is no Makefile.
21   #
22   # This script is compatible with the BSD install script, but was written
23 < # from scratch.
24 < #
23 > # from scratch.  It can only install one file at a time, a restriction
24 > # shared with many OS's install programs.
25  
26  
27   # set DOITPROG to echo to test this script
# Line 29 | Line 41 | stripprog="${STRIPPROG-strip}"
41   rmprog="${RMPROG-rm}"
42   mkdirprog="${MKDIRPROG-mkdir}"
43  
44 < tranformbasename=""
44 > transformbasename=""
45   transform_arg=""
46   instcmd="$mvprog"
47   chmodcmd="$chmodprog 0755"
# Line 97 | Line 109 | then
109          echo "install:  no input file specified"
110          exit 1
111   else
112 <        true
112 >        :
113   fi
114  
115   if [ x"$dir_arg" != x ]; then
# Line 106 | Line 118 | if [ x"$dir_arg" != x ]; then
118          
119          if [ -d $dst ]; then
120                  instcmd=:
121 +                chmodcmd=""
122          else
123 <                instcmd=mkdir
123 >                instcmd=$mkdirprog
124          fi
125   else
126  
# Line 115 | Line 128 | else
128   # might cause directories to be created, which would be especially bad
129   # if $src (and thus $dsttmp) contains '*'.
130  
131 <        if [ -f $src -o -d $src ]
131 >        if [ -f "$src" ] || [ -d "$src" ]
132          then
133 <                true
133 >                :
134          else
135                  echo "install:  $src does not exist"
136                  exit 1
# Line 128 | Line 141 | else
141                  echo "install:  no destination specified"
142                  exit 1
143          else
144 <                true
144 >                :
145          fi
146  
147   # If destination is a directory, append the input filename; if your system
# Line 138 | Line 151 | else
151          then
152                  dst="$dst"/`basename $src`
153          else
154 <                true
154 >                :
155          fi
156   fi
157  
# Line 150 | Line 163 | dstdir=`echo $dst | sed -e 's,[^/]*$,,;s
163  
164   # Skip lots of stat calls in the usual case.
165   if [ ! -d "$dstdir" ]; then
166 < defaultIFS='    
167 < '
166 > defaultIFS='
167 >        '
168   IFS="${IFS-${defaultIFS}}"
169  
170   oIFS="${IFS}"
# Line 170 | Line 183 | while [ $# -ne 0 ] ; do
183          then
184                  $mkdirprog "${pathcomp}"
185          else
186 <                true
186 >                :
187          fi
188  
189          pathcomp="${pathcomp}/"
# Line 181 | Line 194 | if [ x"$dir_arg" != x ]
194   then
195          $doit $instcmd $dst &&
196  
197 <        if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
198 <        if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
199 <        if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
200 <        if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
197 >        if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
198 >        if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
199 >        if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
200 >        if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
201   else
202  
203   # If we're going to rename the final executable, determine the name now.
# Line 203 | Line 216 | else
216          then
217                  dstfile=`basename $dst`
218          else
219 <                true
219 >                :
220          fi
221  
222   # Make a temp file name in the proper directory.
# Line 222 | Line 235 | else
235   # ignore errors from any of these, just make sure not to ignore
236   # errors from the above "$doit $instcmd $src $dsttmp" command.
237  
238 <        if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
239 <        if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
240 <        if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
241 <        if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
238 >        if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi &&
239 >        if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi &&
240 >        if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
241 >        if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
242  
243   # Now rename the file to the real destination.
244  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines