]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Allow multi-arch installation
authorJunio C Hamano <junio@twinsun.com>
Sun, 26 Apr 2009 05:05:45 +0000 (22:05 -0700)
committerJunio C Hamano <junio@twinsun.com>
Sun, 26 Apr 2009 05:05:45 +0000 (22:05 -0700)
Dothem
Make
V

diff --git a/Dothem b/Dothem
index d05aefa62c29c1e94216c2d400de05a9955f8e79..2a0ec0134764e5c5971c8b0f0d34cb7e8843b5af 100755 (executable)
--- a/Dothem
+++ b/Dothem
@@ -2,6 +2,20 @@
 
 NWD=contrib/workdir/git-new-workdir
 
+inst_prefix=$(
+       IFS=:
+       for p in $PATH
+       do
+               probed=${p%/git-active/bin}
+               if test "$probed" != "$p"
+               then
+                       echo "$probed"
+                       exit
+               fi
+       done
+       echo $HOME
+)
+
 force= with_dash= M= install= nodoc= bootstrap= branches= jobs=
 while  case "$1" in
        --pedantic) M="$M $1" ;;
@@ -21,7 +35,7 @@ do
        shift
 done
 test -f /bin/dash || with_dash=
-test -n "$BUILDBASE" || BUILDBASE=../buildfarm
+test -n "$BUILDBASE" || BUILDBASE=$inst_prefix/buildfarm
 test -n "$branches" || branches='next master maint pu jch'
 test -n "$jobs" || jobs=-j2
 
@@ -50,8 +64,8 @@ do
        private=$(git rev-parse -q --verify private-$branch 2>/dev/null)
        case $? in 0|1) ;; *) exit $? ;; esac
 
-       if      test -f "$HOME/git-$branch/bin/git" &&
-               installed=$($HOME/git-$branch/bin/git version) &&
+       if      test -f "$inst_prefix/git-$branch/bin/git" &&
+               installed=$($inst_prefix/git-$branch/bin/git version) &&
                if version=$(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
                then
                        :
diff --git a/Make b/Make
index afef94ae26725626bc5ad2d8978fab4204f09462..98bc272c8c04e0b08185d4d94be3df8ffd0e11c7 100755 (executable)
--- a/Make
+++ b/Make
@@ -1,45 +1,33 @@
 #!/bin/sh
 
-# DDD=' -DUSE_SYMLINK_HEAD=0'
-# PATH=/usr/bin:/bin
-
 G=/opt/packrat/playpen/public/in-place/git/index/gitweb_config.perl
-for i in active maint master next
-do
-       GIT="$HOME/git-$i/bin/git"
-       test -f "$GIT" && break
-done
-test -f "$GIT" || {
+
+case "$(git version 2>/dev/null)" in
+"git version"*)
+       GIT=git ;;
+*)
        echo >&2 "No git to bootstrap"
-}
-PATH=/usr/bin:/bin
-export PATH
+       exit 1 ;;
+esac
+
+inst_prefix=$(
+       IFS=:
+       for p in $PATH
+       do
+               probed=${p%/git-active/bin}
+               if test "$probed" != "$p"
+               then
+                       echo "$probed"
+                       exit
+               fi
+       done
+       echo $HOME
+)
 
 LANG=C
 old_style_def_fix=b79d18c92d9f4841a6a1a29b7b2373a8ff9871e1
 
-head=`$GIT symbolic-ref HEAD 2>/dev/null` &&
-branch=`expr "$head" : 'refs/heads/\(.*\)'` || branch=detached
-
-case "$branch" in
-next | maint | master | pu | jch)
-       prefix="$HOME/git-$branch"
-       ;;
-snap)
-       v=`$GIT describe HEAD`
-       expr "$v" : '.*-g[0-9a-f]*$' >/dev/null && {
-           echo >&2 "You are on 'snap' but $v is not an official version."
-           exit 1
-       }
-       prefix="$HOME/git-snap-$v"
-       ;;
-*)
-       prefix="$HOME/git-test" ;;
-esac
-d="prefix=$prefix"
-
 : ${O=-O2}
-
 Wall=-Wall tests=
 while case $# in 0) break ;; esac
 do 
@@ -87,6 +75,26 @@ done
 LC_ALL=$LANG
 export LANG LC_ALL
 
+head=`$GIT symbolic-ref HEAD 2>/dev/null` &&
+branch=`expr "$head" : 'refs/heads/\(.*\)'` || branch=detached
+
+case "$branch" in
+next | maint | master | pu | jch)
+       prefix="$inst_prefix/git-$branch"
+       ;;
+snap)
+       v=`$GIT describe HEAD`
+       expr "$v" : '.*-g[0-9a-f]*$' >/dev/null && {
+           echo >&2 "You are on 'snap' but $v is not an official version."
+           exit 1
+       }
+       prefix="$inst_prefix/git-snap-$v"
+       ;;
+*)
+       prefix="$inst_prefix/git-test" ;;
+esac
+d="prefix=$prefix"
+
 sh -c 'git describe --abbrev=4 HEAD' >/dev/null 2>&1 || {
        $GIT describe --abbrev=4 HEAD | sed -e 's/-/./g' >version
 }
diff --git a/V b/V
index 866ddc251b0f0d2bd8deab90d7a35b63d63a3616..e4d15c9a2ebe42df45b36c61d85c4eed82ade565 100755 (executable)
--- a/V
+++ b/V
@@ -1,8 +1,25 @@
 #!/bin/sh
 
+inst_prefix=$(
+       IFS=:
+       for p in $PATH
+       do
+               probed=${p%/git-active/bin}
+               if test "$probed" != "$p"
+               then
+                       echo "$probed"
+                       exit
+               fi
+       done
+       echo $HOME
+)
+
 for v in maint master next pu jch
 do
-       installed=$($HOME/git-$v/bin/git version)
+       installed=$(
+               test -f "$inst_prefix/git-$v/bin/git" &&
+               "$inst_prefix/git-$v/bin/git" version
+       )
        dirty=
        if version=$(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
        then