[PATCH] add simple install replacement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch adds a very simple install replacement script to git.
This allows more easy installation on systems that don't have a
compatible install.

Signed-off-by: Robert Schiele <rschiele@xxxxxxxxx>
---
 gitinstall |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)
 create mode 100755 gitinstall

diff --git a/gitinstall b/gitinstall
new file mode 100755
index 0000000..8b346d6
--- /dev/null
+++ b/gitinstall
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+MKDIRMODE=0
+MODE=755
+while getopts 'dm:' FLAG; do
+    case "$FLAG" in
+        d) MKDIRMODE=1;;
+        m) MODE="$OPTARG";;
+	*) exit 1;;
+    esac
+done
+if test "$OPTIND" != 1; then
+    shift `expr $OPTIND - 1`
+fi
+if test $MKDIRMODE = 1; then
+    mkdir -p "$@"
+    chmod "$MODE" "$@"
+else
+    if test $# = 2 && ! test -d "$2"; then
+	rm -rf "$2"
+	cp "$1" "$2"
+	chmod "$MODE" "$2"
+    else
+	FILES=
+	while test $# != 1; do
+	    FILES="$FILES $1"
+	    shift
+	done
+	for i in $FILES; do
+	    rm -rf "$1/"`basename "$i"`
+	    cp "$i" "$1"
+	    chmod "$MODE" "$1/"`basename "$i"`
+	done
+    fi
+fi
-- 
1.5.2.4

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux