KWON BYUNGCHANG created BIGTOP-4544:
---------------------------------------
Summary: bigtop_toolchain: latest ant/maven versions not resolved
due to HTML-escaped "&"
Key: BIGTOP-4544
URL: https://issues.apache.org/jira/browse/BIGTOP-4544
Project: Bigtop
Issue Type: Bug
Reporter: KWON BYUNGCHANG
bigtop_toolchain is intended to install the latest matching ant (1.9.x) and
maven (3.9.x) versions:
{code}
# maven.pp
$mvnversion = latest_maven_binary("3.9.[0-9]*")
# ant.pp
$ant = latest_ant_binary("1.9.[0-9]*")
{code}
But both resolver functions fetch the archive.apache.org directory listing with
an HTML-escaped ampersand in the URL:
{code}
%x(curl -L --stderr /dev/null
'https://archive.apache.org/dist/maven/maven-3/?F=0&V=1' | ...)
{code}
Because of "&", the V=1 (version sort) parameter is not applied. The
listing is sorted lexicographically, so "tail -1" picks the wrong entry. For
maven this resolves 3.9.9 instead of the latest 3.9.16:
{code}
$ curl -L --stderr /dev/null
'https://archive.apache.org/dist/maven/maven-3/?F=0&V=1' | grep -o
'<li>.*href="3.9.[0-9]*/"' | tail -1 | grep -o '3.9.[0-9]*'
3.9.9
$ curl -L --stderr /dev/null
'https://archive.apache.org/dist/maven/maven-3/?F=0&V=1' | grep -o
'<li>.*href="3.9.[0-9]*/"' | tail -1 | grep -o '3.9.[0-9]*'
3.9.16
{code}
latest_ant_binary has the same bug and fails to pick up the latest 1.9.x.
Fix: replace "&" with "&" in the listing URLs in latest_maven_binary.rb and
latest_ant_binary.rb.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)