Skip to content

Commit d2f7ca8

Browse files
committed
CI: Use the git commit hash to determine the revision of the trunk
from the github repos, rather than relying on SVN (so it won't matter if apr/apr-util move to read/write git in the future).
1 parent d7cec16 commit d2f7ca8

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

test/travis_before_linux.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,27 @@ fi
2424
function 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

0 commit comments

Comments
 (0)