Allow multi-arch installation
Junio C Hamano committed
Apr 25, 2009 at 22:05 UTC
936a95a091236c64063510d2b58837e544e4506c
3 files changed
+76
-37
Dothem
+17
-3
@@ -2,6 +2,20 @@
2
3
NWD=contrib/workdir/git-new-workdir
4
5
+inst_prefix=$(
6
+ IFS=:
7
+ for p in $PATH
8
+ do
9
+ probed=${p%/git-active/bin}
10
+ if test "$probed" != "$p"
11
+ then
12
+ echo "$probed"
13
+ exit
14
+ fi
15
+ done
16
+ echo $HOME
17
+)
18
+
19
force= with_dash= M= install= nodoc= bootstrap= branches= jobs=
20
while case "$1" in
21
--pedantic) M="$M $1" ;;
@@ -21,7 +35,7 @@ do
35
shift
36
done
37
test -f /bin/dash || with_dash=
24
-test -n "$BUILDBASE" || BUILDBASE=../buildfarm
38
+test -n "$BUILDBASE" || BUILDBASE=$inst_prefix/buildfarm
39
test -n "$branches" || branches='next master maint pu jch'
40
test -n "$jobs" || jobs=-j2
41
@@ -50,8 +64,8 @@ do
64
private=$(git rev-parse -q --verify private-$branch 2>/dev/null)
65
case $? in 0|1) ;; *) exit $? ;; esac
66
53
- if test -f "$HOME/git-$branch/bin/git" &&
54
- installed=$($HOME/git-$branch/bin/git version) &&
67
+ if test -f "$inst_prefix/git-$branch/bin/git" &&
68
+ installed=$($inst_prefix/git-$branch/bin/git version) &&
69
if version=$(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
70
then
71
:
Make
+41
-33
@@ -1,45 +1,33 @@
1
#!/bin/sh
2
3
-# DDD=' -DUSE_SYMLINK_HEAD=0'
4
-# PATH=/usr/bin:/bin
5
-
3
G=/opt/packrat/playpen/public/in-place/git/index/gitweb_config.perl
7
-for i in active maint master next
8
-do
9
- GIT="$HOME/git-$i/bin/git"
10
- test -f "$GIT" && break
11
-done
12
-test -f "$GIT" || {
4
+
5
+case "$(git version 2>/dev/null)" in
6
+"git version"*)
7
+ GIT=git ;;
8
+*)
9
echo >&2 "No git to bootstrap"
14
-}
15
-PATH=/usr/bin:/bin
16
-export PATH
10
+ exit 1 ;;
11
+esac
12
+
13
+inst_prefix=$(
14
+ IFS=:
15
+ for p in $PATH
16
+ do
17
+ probed=${p%/git-active/bin}
18
+ if test "$probed" != "$p"
19
+ then
20
+ echo "$probed"
21
+ exit
22
+ fi
23
+ done
24
+ echo $HOME
25
+)
26
27
LANG=C
28
old_style_def_fix=b79d18c92d9f4841a6a1a29b7b2373a8ff9871e1
29
21
-head=`$GIT symbolic-ref HEAD 2>/dev/null` &&
22
-branch=`expr "$head" : 'refs/heads/\(.*\)'` || branch=detached
23
-
24
-case "$branch" in
25
-next | maint | master | pu | jch)
26
- prefix="$HOME/git-$branch"
27
- ;;
28
-snap)
29
- v=`$GIT describe HEAD`
30
- expr "$v" : '.*-g[0-9a-f]*$' >/dev/null && {
31
- echo >&2 "You are on 'snap' but $v is not an official version."
32
- exit 1
33
- }
34
- prefix="$HOME/git-snap-$v"
35
- ;;
36
-*)
37
- prefix="$HOME/git-test" ;;
38
-esac
39
-d="prefix=$prefix"
40
-
30
: ${O=-O2}
42
-
31
Wall=-Wall tests=
32
while case $# in 0) break ;; esac
33
do
@@ -87,6 +75,26 @@ done
75
LC_ALL=$LANG
76
export LANG LC_ALL
77
78
+head=`$GIT symbolic-ref HEAD 2>/dev/null` &&
79
+branch=`expr "$head" : 'refs/heads/\(.*\)'` || branch=detached
80
+
81
+case "$branch" in
82
+next | maint | master | pu | jch)
83
+ prefix="$inst_prefix/git-$branch"
84
+ ;;
85
+snap)
86
+ v=`$GIT describe HEAD`
87
+ expr "$v" : '.*-g[0-9a-f]*$' >/dev/null && {
88
+ echo >&2 "You are on 'snap' but $v is not an official version."
89
+ exit 1
90
+ }
91
+ prefix="$inst_prefix/git-snap-$v"
92
+ ;;
93
+*)
94
+ prefix="$inst_prefix/git-test" ;;
95
+esac
96
+d="prefix=$prefix"
97
+
98
sh -c 'git describe --abbrev=4 HEAD' >/dev/null 2>&1 || {
99
$GIT describe --abbrev=4 HEAD | sed -e 's/-/./g' >version
100
}
V
+18
-1
@@ -1,8 +1,25 @@
1
#!/bin/sh
2
3
+inst_prefix=$(
4
+ IFS=:
5
+ for p in $PATH
6
+ do
7
+ probed=${p%/git-active/bin}
8
+ if test "$probed" != "$p"
9
+ then
10
+ echo "$probed"
11
+ exit
12
+ fi
13
+ done
14
+ echo $HOME
15
+)
16
+
17
for v in maint master next pu jch
18
do
5
- installed=$($HOME/git-$v/bin/git version)
19
+ installed=$(
20
+ test -f "$inst_prefix/git-$v/bin/git" &&
21
+ "$inst_prefix/git-$v/bin/git" version
22
+ )
23
dirty=
24
if version=$(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
25
then