aboutsummaryrefslogtreecommitdiffstats
path: root/install-sh
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2001-12-15 17:25:45 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2001-12-15 17:25:45 +0000
commit7d210d5c99c05ef1278958ba40f15f1c58c5fed6 (patch)
tree1f8e6604febba17fdf7ba877883447a191840816 /install-sh
parent[w3m-dev 02663] fix prevA() cause loop (diff)
downloadw3m-7d210d5c99c05ef1278958ba40f15f1c58c5fed6.tar.gz
w3m-7d210d5c99c05ef1278958ba40f15f1c58c5fed6.zip
[w3m-dev 02664] install-sh -s option
From: Rin Okuyama <okuyama@cna.ne.jp>
Diffstat (limited to '')
-rwxr-xr-xinstall-sh27
1 files changed, 19 insertions, 8 deletions
diff --git a/install-sh b/install-sh
index 402ea72..a2a1052 100755
--- a/install-sh
+++ b/install-sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# $Id: install-sh,v 1.1 2001/12/06 15:36:55 ukai Exp $
+# $Id: install-sh,v 1.2 2001/12/15 17:25:45 ukai Exp $
while :
do
@@ -8,6 +8,14 @@ do
mode=$2
shift; shift
;;
+ -s)
+ if [ -n "$STRIP" ]; then
+ strip=$STRIP
+ else
+ strip=strip
+ fi
+ shift;
+ ;;
-*)
shift
;;
@@ -17,18 +25,21 @@ do
done
if [ $# -lt 2 ]; then
- echo "usage: $0 [-m mode] file1 file2"
+ echo "usage: $0 [-m mode] [-s] file1 file2"
exit 1
fi
file=$1
-dest=$2
+if [ -d $2 ]; then
+ dest=$2/$file
+else
+ dest=$2
+fi
cp $file $dest
+if [ -n "$strip" ]; then
+ $strip $dest
+fi
if [ -n "$mode" ]; then
- if [ -d $dest ]; then
- chmod $mode $dest/$file
- else
- chmod $mode $dest
- fi
+ chmod $mode $dest
fi