summaryrefslogtreecommitdiff
path: root/test/travis_before_linux.sh
diff options
context:
space:
mode:
authorJoe Orton <jorton@apache.org>2019-11-21 09:30:34 +0000
committerJoe Orton <jorton@apache.org>2019-11-21 09:30:34 +0000
commite18b2f5a721528d70f08763fb1b919c23ad7c946 (patch)
tree5ae5b5c4a1f70041ca4acf4a888a29f82b23231c /test/travis_before_linux.sh
parent1e925273902842fab7060c91cfd4ba7ba44db3ca (diff)
downloadhttpd-e18b2f5a721528d70f08763fb1b919c23ad7c946.tar.gz
Support travis builds against APR/APR-util non-trunk branches.
Add job for APR 1.7.x + APR-util 1.7.x. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1870077 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/travis_before_linux.sh')
-rwxr-xr-xtest/travis_before_linux.sh83
1 files changed, 41 insertions, 42 deletions
diff --git a/test/travis_before_linux.sh b/test/travis_before_linux.sh
index 999837f3ae..94287947c1 100755
--- a/test/travis_before_linux.sh
+++ b/test/travis_before_linux.sh
@@ -2,49 +2,48 @@
if ! test -v SKIP_TESTING; then
svn export -q https://svn.apache.org/repos/asf/httpd/test/framework/trunk test/perl-framework
fi
-if test -v APR_VERSION; then
- # For APR trunk the cached version at ~/root/apr-trunk will be
- # stale if the current trunk revision is different from that of
- # the cached build. Here, cache and check the rev number of the
- # build accordingly.
- trunk_url=https://svn.apache.org/repos/asf/apr/apr/trunk
- if test $APR_VERSION = trunk; then
- trunk_rev=`svn info --show-item last-changed-revision ${trunk_url}`
- # Blow away the cached trunk install if the revision does not
- # match.
- test -f $HOME/root/apr-trunk/.revision-is-${trunk_rev} || rm -rf $HOME/root/apr-trunk
- fi
- if ! test -d $HOME/root/apr-${APR_VERSION}; then
- case $APR_VERSION in
- trunk) svn export -q -r ${trunk_rev} ${trunk_url} $HOME/build/apr-trunk ;;
- *) svn export -q https://svn.apache.org/repos/asf/apr/apr/tags/${APR_VERSION} \
- $HOME/build/apr-${APR_VERSION} ;;
- esac
- pushd $HOME/build/apr-${APR_VERSION}
- ./buildconf
- ./configure ${APR_CONFIG} --prefix=$HOME/root/apr-${APR_VERSION}
- make -j2
- make install
- if test -v trunk_rev; then
- # Record the revision built in the cache.
- touch $HOME/root/apr-${APR_VERSION}/.revision-is-${trunk_rev}
- fi
- popd
- APU_CONFIG="$APU_CONFIG --with-apr=$HOME/root/apr-${APR_VERSION}"
+
+function install_apx() {
+ local name=$1
+ local version=$2
+ local root=https://svn.apache.org/repos/asf/apr/${name}
+ local prefix=${HOME}/root/${name}-${version}
+ local build=${HOME}/build/${name}-${version}
+ local config=$3
+ local buildconf=$4
+
+ case $version in
+ trunk) url=${root}/trunk ;;
+ *.x) url=${root}/branches/${version} ;;
+ *) url=${root}/tags/${version} ;;
+ esac
+
+ local revision=`svn info --show-item last-changed-revision ${url}`
+
+ # Blow away the cached install root if the revision does not
+ # match.
+ test -f ${prefix}/.revision-is-${revision} || rm -rf ${prefix}
+
+ if test -d ${prefix}; then
+ return 0
fi
+
+ svn export -q -r ${revision} ${url} ${build}
+ pushd $build
+ ./buildconf ${buildconf}
+ ./configure --prefix=${prefix} ${config}
+ make -j2
+ make install
+ popd
+
+ touch ${prefix}/.revision-is-${revision}
+}
+
+if test -v APR_VERSION; then
+ install_apx apr ${APR_VERSION} "${APR_CONFIG}"
+ APU_CONFIG="$APU_CONFIG --with-apr=$HOME/root/apr-${APR_VERSION}"
fi
+
if test -v APU_VERSION; then
- if ! test -d $HOME/root/apu-${APU_VERSION}; then
- case $APU_VERSION in
- trunk) url=https://svn.apache.org/repos/asf/apr/apr-util/trunk ;;
- *) url=https://svn.apache.org/repos/asf/apr/apr-util/tags/${APU_VERSION} ;;
- esac
- svn export -q ${url} $HOME/build/apu-${APU_VERSION}
- pushd $HOME/build/apu-${APU_VERSION}
- ./buildconf --with-apr=$HOME/build/apr-${APR_VERSION}
- ./configure ${APU_CONFIG} --prefix=$HOME/root/apu-${APU_VERSION}
- make -j2
- make install
- popd
- fi
+ install_apx apr-util ${APU_VERSION} "${APU_CONFIG}" --with-apr=$HOME/build/apr-${APR_VERSION}
fi