svn commit: r189618 - head/contrib/top
Robert Watson
rwatson at FreeBSD.org
Tue Mar 10 04:46:43 PDT 2009
Author: rwatson
Date: Tue Mar 10 11:46:41 2009
New Revision: 189618
URL: http://svn.freebsd.org/changeset/base/189618
Log:
Merge r183430 from vendor/top/dist to head/contrib/top, although with
record-only mergeinfo because an automated merge is confused by the
flattening that took place:
Move install to install-sh to prevent name-clashes.
MFC after: 3 days
Added:
head/contrib/top/install-sh (props changed)
- copied unchanged from r189617, head/contrib/top/install
Deleted:
head/contrib/top/install
Modified:
head/contrib/top/ (props changed)
Copied: head/contrib/top/install-sh (from r189617, head/contrib/top/install)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/contrib/top/install-sh Tue Mar 10 11:46:41 2009 (r189618, copy of r189617, head/contrib/top/install)
@@ -0,0 +1,69 @@
+#!/bin/sh
+#
+# this shell script is amazingly similar to the old and lamented
+# BSD "install" command. It recognized the following options:
+#
+# -o target file owner
+# -m target file mode
+# -g target file group owner
+#
+#
+# scan the options
+#
+while [ $# -gt 0 ]; do
+ case $1 in
+ -o)
+ owner=$2
+ shift ; shift
+ ;;
+
+ -m)
+ mode=$2
+ shift; shift
+ ;;
+
+ -g)
+ group=$2
+ shift ; shift
+ ;;
+
+ -*)
+ echo "install: unknown option $1"
+ exit
+ ;;
+
+ *)
+ break
+ ;;
+ esac
+done
+#
+# we need two more: filename and destination
+#
+if [ $# -ne 2 ]; then
+ echo "Usage: install [ -o owner ] [ -m mode ] [ -g group ] file destination"
+ exit
+fi
+#
+# first, copy
+#
+cp $1 $2
+#
+# normalize the name
+#
+dest=$2
+if [ -d $2 ]; then
+ dest=$2/`basename $1`
+fi
+#
+# do optional things
+#
+if [ "$owner" ]; then
+ chown $owner $dest
+fi
+if [ "$group" ]; then
+ chgrp $group $dest
+fi
+if [ "$mode" ]; then
+ chmod $mode $dest
+fi
More information about the svn-src-all
mailing list