os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/unix/install-sh
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/unix/install-sh Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,124 @@
1.4 +#!/bin/sh
1.5 +
1.6 +#
1.7 +# install - install a program, script, or datafile
1.8 +# This comes from X11R5; it is not part of GNU.
1.9 +#
1.10 +# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
1.11 +#
1.12 +# This script is compatible with the BSD install script, but was written
1.13 +# from scratch.
1.14 +#
1.15 +
1.16 +
1.17 +# set DOITPROG to echo to test this script
1.18 +
1.19 +# Don't use :- since 4.3BSD and earlier shells don't like it.
1.20 +doit="${DOITPROG-}"
1.21 +
1.22 +
1.23 +# put in absolute paths if you don't have them in your path; or use env. vars.
1.24 +
1.25 +mvprog="${MVPROG-mv}"
1.26 +cpprog="${CPPROG-cp}"
1.27 +chmodprog="${CHMODPROG-chmod}"
1.28 +chownprog="${CHOWNPROG-chown}"
1.29 +chgrpprog="${CHGRPPROG-chgrp}"
1.30 +stripprog="${STRIPPROG-strip}"
1.31 +rmprog="${RMPROG-rm}"
1.32 +
1.33 +instcmd="$mvprog"
1.34 +chmodcmd=""
1.35 +chowncmd=""
1.36 +chgrpcmd=""
1.37 +stripcmd=""
1.38 +rmcmd="$rmprog -f"
1.39 +mvcmd="$mvprog"
1.40 +src=""
1.41 +dst=""
1.42 +
1.43 +while [ x"$1" != x ]; do
1.44 + case $1 in
1.45 + -c) instcmd="$cpprog"
1.46 + shift
1.47 + continue;;
1.48 +
1.49 + -m) chmodcmd="$chmodprog $2"
1.50 + shift
1.51 + shift
1.52 + continue;;
1.53 +
1.54 + -o) chowncmd="$chownprog $2"
1.55 + shift
1.56 + shift
1.57 + continue;;
1.58 +
1.59 + -g) chgrpcmd="$chgrpprog $2"
1.60 + shift
1.61 + shift
1.62 + continue;;
1.63 +
1.64 + -s) stripcmd="$stripprog"
1.65 + shift
1.66 + continue;;
1.67 +
1.68 + -S) stripcmd="$stripprog $2"
1.69 + shift
1.70 + shift
1.71 + continue;;
1.72 +
1.73 + *) if [ x"$src" = x ]
1.74 + then
1.75 + src=$1
1.76 + else
1.77 + dst=$1
1.78 + fi
1.79 + shift
1.80 + continue;;
1.81 + esac
1.82 +done
1.83 +
1.84 +if [ x"$src" = x ]
1.85 +then
1.86 + echo "install: no input file specified"
1.87 + exit 1
1.88 +fi
1.89 +
1.90 +if [ x"$dst" = x ]
1.91 +then
1.92 + echo "install: no destination specified"
1.93 + exit 1
1.94 +fi
1.95 +
1.96 +
1.97 +# If destination is a directory, append the input filename; if your system
1.98 +# does not like double slashes in filenames, you may need to add some logic
1.99 +
1.100 +if [ -d $dst ]
1.101 +then
1.102 + dst="$dst"/`basename $src`
1.103 +fi
1.104 +
1.105 +# Make a temp file name in the proper directory.
1.106 +
1.107 +dstdir=`dirname $dst`
1.108 +dsttmp=$dstdir/#inst.$$#
1.109 +
1.110 +# Move or copy the file name to the temp name
1.111 +
1.112 +$doit $instcmd $src $dsttmp
1.113 +
1.114 +# and set any options; do chmod last to preserve setuid bits
1.115 +
1.116 +if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi
1.117 +if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi
1.118 +if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi
1.119 +if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi
1.120 +
1.121 +# Now rename the file to the real destination.
1.122 +
1.123 +$doit $rmcmd $dst
1.124 +$doit $mvcmd $dsttmp $dst
1.125 +
1.126 +
1.127 +exit 0