From: Robert Schiele <rschiele@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com
Subject: [PATCH] add simple install replacement
Date: Thu, 11 Oct 2007 23:52:37 +0200 [thread overview]
Message-ID: <20071011215237.GI20753@schiele.dyndns.org> (raw)
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
next reply other threads:[~2007-10-11 21:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-11 21:52 Robert Schiele [this message]
2007-10-12 14:06 ` [PATCH] add simple install replacement Jan Hudec
2007-10-12 15:07 ` Robert Schiele
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071011215237.GI20753@schiele.dyndns.org \
--to=rschiele@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).