Just dropping a line to point this out and seek feedback since I know we have several folks on the APR project here as well.
With this option, I assume the APR/APU download URL... * Is stable * Will always point out which version is best to use * Is updated along with the release process It's a bit clunky, but this method has worked for me for a long time in my own builds, so I figured I would share the recipe. The goal, of course, is to remove as much manual care and feeding of files needed to do a release. If any of the above assumptions are awful, I can revert or take a different tact. -- Daniel Ruggeri > -----Original Message----- > From: [email protected] [mailto:[email protected]] > Sent: Saturday, February 24, 2018 5:39 AM > To: [email protected] > Subject: svn commit: r1825219 - /httpd/site/trunk/tools/release.sh > > Author: druggeri > Date: Sat Feb 24 11:38:37 2018 > New Revision: 1825219 > > URL: http://svn.apache.org/viewvc?rev=1825219&view=rev > Log: > Add option to interrogate APX download URL for best version > > Modified: > httpd/site/trunk/tools/release.sh > > Modified: httpd/site/trunk/tools/release.sh > URL: > http://svn.apache.org/viewvc/httpd/site/trunk/tools/release.sh?rev=18252 > 19&r1=1825218&r2=1825219&view=diff > ========================================================== > ==================== > --- httpd/site/trunk/tools/release.sh (original) > +++ httpd/site/trunk/tools/release.sh Sat Feb 24 11:38:37 2018 > @@ -3,7 +3,8 @@ > # release.sh : build a release tarball > # > # USAGE: release.sh [--security] [--tag TAG POSTFIX] [--postfix POSTFIX] > -# [--rev REV] [--europe] PROJECT VERSION [SIGNING-USER] > +# [--rev REV] [--europe] [--latestapxxx] > +# PROJECT VERSION [SIGNING-USER] > # > # The project is either 'httpd-2.2', 'httpd-2.4, httpd-2.5' > # > @@ -13,6 +14,10 @@ > # directory). Next, it will run the appropriate commands to prepare and > # construct the tarball. The subdirectory will be cleaned up upon exit. > # > +# If latestapxxx is specified, the apr/apu download URL is checked with > +# curl to determine the best available version. This assumes access to > +# the Internet is available directly or via proxy (as used by curl) > +# > # The "signing user" is the name of the key that you'll be signing the > # release with. > # > @@ -59,6 +64,21 @@ do > shift > ;; > > + --latestapxxx) > + get_latest_aprxxx=1 > + shift > + > + if ! curl --version >/dev/null 2>&1;then > + echo "ERROR: curl must be available to use latestapxxx option." > + exit 1 > + fi > + > + if test "`echo 'test-1.2.3' | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+'`" != > "1.2.3";then > + echo "ERROR: your system must support 'grep -o' to use latestapxxx > option." > + exit 1 > + fi > + ;; > + > --*) > echo "Unknown option '$1'" >&2 > echo "USAGE: $0 [--security] [--tag TAG POSTFIX] [--postfix POSTFIX] [-- > rev REV] [--europe] PROJECT VERSION [SIGNING-USER]" >&2 > @@ -137,6 +157,29 @@ case "$1" in > exit 1 > esac > > +if test $get_latest_aprxxx; then > + download_url="https://apr.apache.org/download.cgi" > + echo "Determining latest APR and APU versions from $download_url..." > + > + apr_tag='' > + apr_tag=`curl -s $download_url | grep 'APR [0-9].*is the best available > version' | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+'` > + if test -z "$apr_tag"; then > + echo "ERROR: Failed to determine latest APR version from > $download_url" > + exit 1 > + else > + echo " APR: $apr_tag" > + fi > + > + apu_tag='' > + apu_tag=`curl -s $download_url | grep 'APR-util [0-9].*is the best > available > version' | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+'` > + if test -z "$apu_tag"; then > + echo "ERROR: Failed to determine latest APR version from > $download_url" > + exit 1 > + else > + echo " APU: $apu_tag" > + fi > +fi > + > major="`echo ${version} | sed 's/\..*$//'`" > minor="`echo ${version} | sed 's/^[0-9]*\.\([0-9]*\)\..*$/\1/'`" > patch="`echo ${version} | sed 's/^.*\.//'`" >
