summaryrefslogtreecommitdiff
path: root/install-sh
diff options
context:
space:
mode:
Diffstat (limited to 'install-sh')
-rwxr-xr-xinstall-sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/install-sh b/install-sh
index 68b8100..b12c0f7 100755
--- a/install-sh
+++ b/install-sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: install-sh.in,v 1.5 2010/10/08 19:57:05 tez Exp $
+# $NetBSD: install-sh.in,v 1.6 2012/01/11 13:07:31 hans Exp $
# This script now also installs multiple files, but might choke on installing
# multiple files with spaces in the file names.
#
@@ -45,6 +45,7 @@ rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
instcmd="$cpprog"
+instflags=""
pathcompchmodcmd="$chmodprog 755"
chmodcmd="$chmodprog 755"
chowncmd=""
@@ -84,6 +85,11 @@ while [ x"$1" != x ]; do
shift
continue;;
+ -m*)
+ chmodcmd="$chmodprog ${1#-m}"
+ shift
+ continue;;
+
-o) chowncmd="$chownprog $2"
shift
shift
@@ -104,6 +110,10 @@ while [ x"$1" != x ]; do
shift
continue;;
+ -p) instflags="-p"
+ shift
+ continue;;
+
*) if [ x"$msrc" = x ]
then
msrc="$dst"
@@ -154,7 +164,7 @@ else
if [ -f "$srcarg" ]
then
- doinst="$instcmd"
+ doinst="$instcmd $instflags"
elif [ -d "$srcarg" ]
then
echo "install: $srcarg: not a regular file"