forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDothem
More file actions
executable file
·193 lines (173 loc) · 3.84 KB
/
Dothem
File metadata and controls
executable file
·193 lines (173 loc) · 3.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
#!/bin/sh
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= notest= bootstrap= branches= jobs=
scratch=
while case "$1" in
--pedantic | --locale=* | --loose) M="$M $1" ;;
--force) force=$1 ;;
--dash) with_dash=y ;;
--noinstall) install=noinstall ;;
--nodoc) nodoc=y ;;
--notest) notest=y ;;
--test=*) test="$1" ;;
--scratch) scratch=y ;;
--bootstrap) bootstrap=y ;;
--base=*) BUILDBASE=${1#*=} ;;
--branches=*) branches=${1#*=} ;;
-j*) jobs=$1 ;;
-*) echo >&2 "Unknown option: $1"; exit 1 ;;
*) break ;;
esac
do
shift
done
for TRASH in /dev/shm /tmp ""
do
if test -n "$TRASH" && test -d "$TRASH" && test -w "$TRASH"
then
TRASH="--root=$TRASH/testpen"
break
fi
done
sh -c 'asciidoc --version >/dev/null 2>&1' || nodoc=y
if sh -c 'prove --version >/dev/null 2>&1'
then
DEFAULT_TEST_TARGET=prove GIT_PROVE_OPTS="$jobs"
export DEFAULT_TEST_TARGET GIT_PROVE_OPTS
fi
GIT_TEST_OPTS="$TRASH${GIT_TEST_OPTS+" $GIT_TEST_OPTS"}"
export GIT_TEST_OPTS
test -f /bin/dash || with_dash=
if test -z "$BUILDBASE"
then
if test -d "$inst_prefix/buildfarm"
then
BUILDBASE="$inst_prefix/buildfarm"
elif test -d "../buildfarm"
then
BUILDBASE=../buildfarm
else
echo >&2 "Buildbase unknown"
exit 1
fi
fi
test -n "$branches" || branches='next master maint jch pu'
test -n "$jobs" || jobs=-j2
for branch in $branches
do
echo "** $branch **"
revision=$(git show-ref -s --verify "refs/heads/$branch") || {
echo "** No $branch"
continue
}
if test ! -d "$BUILDBASE/$branch"
then
if test -z "$bootstrap"
then
echo "** No $BUILDBASE/$branch"
continue
fi
"$NWD" . "$BUILDBASE/$branch" $branch &&
ln -s "$(pwd)/Meta" "$BUILDBASE/$branch/Meta" || {
echo "** Failed to bootstrap $BUILDBASE/$branch"
continue
}
fi
private=$(git rev-parse -q --verify private-$branch 2>/dev/null)
case $? in 0|1) ;; *) exit $? ;; esac
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
:
elif version=v$(expr "$installed" : \
'git version \(.*\)\.rc[0-9]*$')
then
version="$version"-$(expr "$installed" : \
'git version .*\.\(rc[0-9]*\)$')
else
version=v$(expr "$installed" : 'git version \(.*\)')
fi &&
version=$(git rev-parse --verify "$version^0" 2>/dev/null) &&
test "z$version" = "z$revision"
then
echo "* up-to-date version \"$installed\" is already installed from $branch"
test -n "$force" || continue
fi
(
case "$branch, $branches " in
jch,*' next '*)
if git diff --quiet --exit-code jch next
then
dotest=
else
dotest=test
fi
;;
*)
dotest=test ;;
esac
test -z "$notest" || dotest=
cd "$BUILDBASE/$branch"
git reset --hard &&
case "$(git symbolic-ref HEAD)" in
"refs/heads/$branch")
: ;;
*)
git checkout "$branch" &&
git reset --hard || exit
esac &&
case "$scratch" in
'')
;;
y)
Meta/Make clean
;;
esac &&
case "$private" in
'')
;;
?*)
git merge --squash --no-commit "$private" || {
echo >&2 "** Cannot apply private edition changes"
git reset --hard
}
;;
esac &&
save=$(git rev-parse HEAD) &&
Meta/Make $M ${test+"$test"} $jobs -- ${with_dash:+SHELL_PATH=/bin/dash} $dotest &&
{
test -n "$nodoc" ||
if test "$save" = "$(git rev-parse HEAD)"
then
Meta/Make $M $jobs -- doc &&
Meta/Make $M -- install-man install-html
else
echo >&2 "Head moved--not installing docs"
fi
} &&
{
test z$install = znoinstall ||
if test "$save" = "$(git rev-parse HEAD)"
then
Meta/Make $M -- install
else
echo >&2 "Head moved--not installing"
fi
} || exit $?
git reset --hard
) </dev/null || exit $?
done