Skip to content
This repository was archived by the owner on Apr 9, 2019. It is now read-only.

Commit d745907

Browse files
committed
Fix download link probing (#33, #34)
Update number is no longer part of the URL of the current release page. This patch makes the script downloads the current release page first, and then tries to find a matching version. If not found, then looks for it in the archive page.
1 parent 9250d86 commit d745907

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

oab-java.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -436,12 +436,12 @@ pid=$!;progress $pid
436436

437437
# See if the Java version is on the download frontpage, otherwise look for it in
438438
# the previous releases page.
439-
DOWNLOAD_INDEX=`grep -P -o "/technetwork/java/javase/downloads/jdk-${JAVA_VER}u${JAVA_UPD}-downloads-\d+\.html" /tmp/oab-index.html | uniq`
440-
if [ -n "${DOWNLOAD_INDEX}" ]; then
441-
ncecho " [x] Getting current release download page "
442-
wget http://www.oracle.com/${DOWNLOAD_INDEX} -O /tmp/oab-download.html >> "$log" 2>&1 &
443-
pid=$!;progress $pid
444-
else
439+
DOWNLOAD_INDEX=`grep -P -o "/technetwork/java/javase/downloads/jdk${JAVA_VER}-downloads-\d+\.html" /tmp/oab-index.html | uniq`
440+
ncecho " [x] Getting current release download page "
441+
wget http://www.oracle.com/${DOWNLOAD_INDEX} -O /tmp/oab-download.html >> "$log" 2>&1 &
442+
pid=$!;progress $pid
443+
DOWNLOAD_FOUND=`grep "jdk-${JAVA_VER}u${JAVA_UPD}-linux-i586\." /tmp/oab-download.html`
444+
if [ -z "${DOWNLOAD_FOUND}" ]; then
445445
ncecho " [x] Getting previous releases download page "
446446
if [ "${JAVA_UPSTREAM}" == "sun-java6" ]; then
447447
wget http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html -O /tmp/oab-download.html >> "$log" 2>&1 &

0 commit comments

Comments
 (0)