@@ -60,17 +60,22 @@ function install_apx() {
6060 local giturl=https://github.com/apache/${name} .git
6161 local config=$3
6262 local buildconf=$4
63-
64- case $version in
65- trunk|* .x) ref=refs/heads/${version} ;;
66- * ) ref=refs/tags/${version} ;;
67- esac
68-
69- # Fetch the object ID (hash) of latest commit
70- local commit=` git ls-remote ${giturl} ${ref} | cut -f1`
71- if test -z " $commit " ; then
72- : Could not determine latest commit hash for ${ref} in ${giturl} - check branch is valid?
73- exit 1
63+ local commit=tarball
64+
65+ mkdir -p ${HOME} /build
66+
67+ if ! test -v TEST_APR_TARBALL; then
68+ case $version in
69+ trunk|* .x) ref=refs/heads/${version} ;;
70+ * ) ref=refs/tags/${version} ;;
71+ esac
72+
73+ # Fetch the object ID (hash) of latest commit
74+ commit=` git ls-remote ${giturl} ${ref} | cut -f1`
75+ if test -z " $commit " ; then
76+ : Could not determine latest commit hash for ${ref} in ${giturl} - check branch is valid?
77+ exit 1
78+ fi
7479 fi
7580
7681 # Blow away the cached install root if the cached install is stale
@@ -81,16 +86,24 @@ function install_apx() {
8186 return 0
8287 fi
8388
84- git init -q ${build}
85- pushd $build
89+ if test -v TEST_APR_TARBALL; then
90+ curl https://archive.apache.org/dist/apr/${name} -${version} .tar.gz > apx.tar.gz
91+ tar -C ${HOME} /build -xzf apx.tar.gz
92+ rm apx.tar.gz
93+ pushd ${build}
94+ else
95+ git init -q ${build}
96+ pushd $build
8697 # Clone and checkout the commit identified above.
8798 git remote add origin ${giturl}
8899 git fetch -q --depth=1 origin ${commit}
89100 git checkout ${commit}
90101 ./buildconf ${buildconf}
91- ./configure --prefix=${prefix} ${config}
92- make -j2
93- make install
102+ fi
103+
104+ ./configure --prefix=${prefix} ${config}
105+ make -j2
106+ make install
94107 popd
95108
96109 echo ${version} ${commit} " ${config} " " CC=${CC} " > ${HOME} /root/.key-${name}
0 commit comments