File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 2424function install_apx() {
2525 local name=$1
2626 local version=$2
27- local root=https://svn.apache.org/repos/asf/apr/${name}
2827 local prefix=${HOME} /root/${name} -${version}
2928 local build=${HOME} /build/${name} -${version}
3029 local giturl=https://github.com/apache/${name} .git
3130 local config=$3
3231 local buildconf=$4
3332
3433 case $version in
35- trunk) url=${root} /trunk ;;
36- * .x) url=${root} /branches/${version} ;;
37- * ) url=${root} /tags/${version} ;;
34+ trunk|* .x) ref=refs/heads/${version} ;;
35+ * ) ref=refs/tags/${version} ;;
3836 esac
3937
40- local revision=` svn info --show-item last-changed-revision ${url} `
38+ # Fetch the object ID (hash) of latest commit
39+ local commit=` git ls-remote ${giturl} ${ref} | cut -f1`
40+ if test -n " $commit " ; then
41+ : Could not determine latest commit hash for ${ref} in ${giturl} - check branch is valid?
42+ exit 1
43+ fi
4144
4245 # Blow away the cached install root if the cached install is stale
4346 # or doesn't match the expected configuration.
44- grep -q " ${version} ${revision } ${config} CC=$CC " ${HOME} /root/.key-${name} || rm -rf ${prefix}
47+ grep -q " ${version} ${commit } ${config} CC=$CC " ${HOME} /root/.key-${name} || rm -rf ${prefix}
4548
4649 if test -d ${prefix} ; then
4750 return 0
@@ -55,7 +58,7 @@ function install_apx() {
5558 make install
5659 popd
5760
58- echo ${version} ${revision } " ${config} " " CC=${CC} " > ${HOME} /root/.key-${name}
61+ echo ${version} ${commit } " ${config} " " CC=${CC} " > ${HOME} /root/.key-${name}
5962}
6063
6164# Allow to load $HOME/build/apache/httpd/.gdbinit
You can’t perform that action at this time.
0 commit comments