5 case "$(git version 2>/dev/null)" in
9 echo >&2 "No git to bootstrap"
18 probed
=${p%/git-active/bin}
19 if test "$probed" != "$p"
32 for cv
in PYTHON_PATH
=python TCL_PATH
=tclsh TCLTKPATH
=wish
37 if test -f "/usr/bin/$cmd"
41 for p
in /usr
/bin
/usr
/local
/bin
45 echo "$var=$p/$cmd; export $var"
48 found
=$
(find "$p/$cmd"* -type f
2>/dev
/null |
head -n 1)
51 echo "$var=$found; export $var"
58 Wall
="-Wall -Wvla -Wdeclaration-after-statement -Wno-format-zero-length${Wall+ $Wall}"
59 tests
= jobs= skip
= oldtest
= with_dash
=
67 OLD_ICONV
=YesPlease
; export OLD_ICONV
71 OLD_ICONV
=YesPlease
; export OLD_ICONV
75 NEEDS_CRYPTO_WITH_SSL
=YesPlease
; export NEEDS_CRYPTO_WITH_SSL
76 NO_PEDANTIC
=CannotDo Wall
=
81 expr "$($GIT symbolic-ref HEAD 2>/dev/null)" : 'refs/heads/\(.*\)' ||
85 determine_version
() {
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."
94 determine_long_version
() {
95 $GIT describe HEAD
2>/dev
/null ||
echo unknown-g00000000 |
99 BUILTIN_CLEAN_FIX
=8687f777
100 if ! git merge-base
--is-ancestor $BUILTIN_CLEAN_FIX HEAD
102 NO_PEDANTIC
=YesPlease
105 case "$NO_PEDANTIC" in
108 PEDANT
="-Werror -Wold-style-definition -std=c99 $PEDANT"
109 PEDANT
="-Wpointer-arith -Woverflow -Wunused $PEDANT"
110 PEDANT
="-Wold-style-declaration -Wstrict-prototypes $PEDANT"
115 while case $# in 0) break ;; esac
119 echo >&2 "(no need to say --pedantic)"
127 -noprove |
--noprove)
137 testpen
=testpen.
${1#--memtrash=}
169 if test -n "$testpen"
171 for TRASH
in /dev
/shm
/tmp
""
173 if test -n "$TRASH" &&
174 mkdir
-p "$TRASH/$testpen" 2>/dev
/null
&&
175 test -w "$TRASH/$testpen"
177 TRASH
="--root=$(cd "$TRASH/$testpen" && /bin/pwd)"
181 GIT_TEST_OPTS
="$TRASH${GIT_TEST_OPTS+" $GIT_TEST_OPTS"}"
185 O
="${PEDANT}${PEDANT:+ }$O"
187 test -f /bin
/dash || with_dash
=
189 if test -z "$tests" && test -n "$skip"
191 GIT_SKIP_TESTS
="${GIT_SKIP_TESTS:-$skip}"
192 export GIT_SKIP_TESTS
194 if test -z "$oldtest" &&
195 sh
-c 'prove --version >/dev/null 2>&1' &&
196 sh
-c 'prove --exec : >/dev/null 2>&1'
198 DEFAULT_TEST_TARGET
=prove GIT_PROVE_OPTS
="$jobs"
199 export DEFAULT_TEST_TARGET GIT_PROVE_OPTS
205 branch
=$
(determine_branch
)
208 next | maint | master | pu | jch
)
209 prefix
="$inst_prefix/git-$branch"
212 v
=$
(determine_version
)
213 prefix
="$inst_prefix/git-snap-$v"
216 prefix
="$inst_prefix/git-test" ;;
219 determine_long_version
>version
221 set "prefix=$prefix" "$@"
222 if test -n "$with_dash" && test -f /bin
/dash
224 set "SHELL_PATH=/bin/dash" "$@"
227 set MAN_BASE_URL
='"http://www.kernel.org/pub/software/scm/git/docs/"' \
228 ASCIIDOC_NO_ROFF
=YesPlease \
229 ASCIIDOC8
=YesPlease \
235 if test -z "${make:+set}" && {
236 test -x /usr
/local
/bin
/gmake ||
237 test -x /usr
/pkg
/bin
/gmake ||
238 test -x /usr
/bin
/gmake
243 if test -f /bin
/ginstall
245 set INSTALL
=ginstall
"$@"
250 if test -n "${NO_CFLAGS+set}"
252 unset OK_TO_USE_CFLAGS
255 unset SSH_AGENT_PID SSH_CLIENT SSH_TTY SSH_AUTH_SOCK SSH_CONNECTION \
256 GPG_AGENT_INFO GNOME_KEYRING_CONTROL GNOME_KEYRING_PID \
257 XDG_SESSION_COOKIE XDG_SESSION_PATH XDG_SEAT_PATH XDG_DATA_DIRS \
258 PGPPATH AUTO_PROXY WINDOWID SESSION_MANAGER XDG_CONFIG_DIRS STY \
259 GDMSESSION KRB5CCNAME GNOME_DESKTOP_SESSION_ID \
260 DBUS_SESSION_BUS_ADDRESS LESSOPEN WINDOW DISPLAY GTK_IM_MODULE \
261 XDG_CURRENT_DESKTOP LESSCLOSE XAUTHORITY
265 ETC_GITCONFIG
=$prefix/etc
/gitconfig \
266 ${OK_TO_USE_CFLAGS+"CFLAGS=$CFLAGS"} \
267 ${tests:+"T=$tests"} \