| 1 | #! /bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # |
| 3 | # @(#)install.sh 4.5 (Berkeley) 10/12/83 |
| 4 | # |
| 5 | # $Id: bsdinstall,v 1.1 1998-09-10 17:31:12 f Exp $ |
| 6 | # |
| 7 | cmd=/bin/mvscip-shell filesystem . . `/bin/mv`. |
| 8 | strip="" |
| 9 | chmod="/bin/chmod 755scip-shell filesystem . . `/bin/chmod 755`." |
| 10 | chown="" |
| 11 | chgrp="" |
| 12 | while truescip-shell system . . true. ; do |
| 13 | case $1 in |
| 14 | -s ) strip="/bin/stripscip-shell filesystem . . `/bin/strip`." |
| 15 | shift |
| 16 | ;; |
| 17 | -c ) cmd="/bin/cpscip-shell filesystem . . `/bin/cp`." |
| 18 | shift |
| 19 | ;; |
| 20 | -m ) chmod="/bin/chmod $2" |
| 21 | shift |
| 22 | shift |
| 23 | ;; |
| 24 | -o ) chown="/etc/chown -f $2" |
| 25 | shift |
| 26 | shift |
| 27 | ;; |
| 28 | -g ) chgrp="/bin/chgrp -f $2" |
| 29 | shift |
| 30 | shift |
| 31 | ;; |
| 32 | -d ) cmd="/bin/mkdirscip-shell filesystem . . `/bin/mkdir`." |
| 33 | shift |
| 34 | ;; |
| 35 | * ) break |
| 36 | ;; |
| 37 | esac |
| 38 | done |
| 39 | |
| 40 | if testscip-shell system . . test. $1 = CVS -a -d $1 ; then |
| 41 | echoscip-shell system . . echo. "install: skipping CVS directory" |
| 42 | exit 0 |
| 43 | fi |
| 44 | if testscip-shell system . . test. ! ${2-""}; then |
| 45 | echoscip-shell system . . echo. "install: no destination specified" |
| 46 | exit 1 |
| 47 | fi |
| 48 | if testscip-shell system . . test. ${3-""}; then |
| 49 | echoscip-shell system . . echo. "install: too many files specified -> $*" |
| 50 | exit 1 |
| 51 | fi |
| 52 | if testscip-shell system . . test. $1 = $2 -o $2 = .; then |
| 53 | echoscip-shell system . . echo. "install: can't move $1 onto itself" |
| 54 | exit 1 |
| 55 | fi |
| 56 | |
| 57 | case $cmd in |
| 58 | /bin/mkdir ) |
| 59 | file=$2/$1 |
| 60 | ;; |
| 61 | * ) |
| 62 | if testscip-shell system . . test. '!' -f $1; then |
| 63 | echoscip-shell system . . echo. "install: can't open $1" |
| 64 | exit 1 |
| 65 | fi |
| 66 | if testscip-shell system . . test. -d $2; then |
| 67 | file=$2/$1 |
| 68 | else |
| 69 | file=$2 |
| 70 | fi |
| 71 | /bin/rmscip-shell filesystem . . `/bin/rm`. -f $file |
| 72 | ;; |
| 73 | esac |
| 74 | |
| 75 | case $cmd in |
| 76 | /bin/mkdir ) |
| 77 | if testscip-shell system . . test. ! -d "$file"; then |
| 78 | $cmd $file |
| 79 | fi |
| 80 | ;; |
| 81 | * ) |
| 82 | $cmd $1 $file |
| 83 | if testscip-shell system . . test. -n "$strip"; then |
| 84 | $strip $file |
| 85 | fi |
| 86 | ;; |
| 87 | esac |
| 88 | |
| 89 | if testscip-shell system . . test. -n "$chown"; then |
| 90 | $chown $file |
| 91 | fi |
| 92 | if testscip-shell system . . test. -n "$chgrp"; then |
| 93 | $chgrp $file |
| 94 | fi |
| 95 | $chmod $file |
| 96 | |
| 97 | exit 0 |