git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] add simple install replacement
@ 2007-10-11 21:52 Robert Schiele
  2007-10-12 14:06 ` Jan Hudec
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Schiele @ 2007-10-11 21:52 UTC (permalink / raw)
  To: git; +Cc: gitster

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@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-12 15:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-11 21:52 [PATCH] add simple install replacement Robert Schiele
2007-10-12 14:06 ` Jan Hudec
2007-10-12 15:07   ` Robert Schiele

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).