flexiondotorg / oab-java6

Create a local 'apt' repository for Sun Java 6 and/or Oracle Java 7 packages.
Other
625 stars 121 forks source link

Update code to match oracle website change #56

Closed kaharlichenko closed 12 years ago

kaharlichenko commented 12 years ago

This should fix #55.

maizy commented 12 years ago

Successfully tested on fresh ubuntu 12.04 installation with java 6.

ladios commented 12 years ago

I think it's better to replace u${JAVA_UPD} with .* which also works, no matter the URL contains uXX or not.

Tenzer commented 12 years ago

I can verify that this fixes the download issues. Tested on Ubuntu 12.04, 64-bit with Java 6.

ocharles commented 12 years ago

Also confirming that this worked for me

Uxorious commented 12 years ago

Works for me too (6u35 on new install of Ubuntu 12.04.1 LTS).

narkisr commented 12 years ago

It fails on my machine

If you want to see what this is script is doing while it is running then execute the following from another shell:

tail -f /home/ronen/oab-java.sh.log

[x] Installing Java build requirements success [x] Making build directories success [x] Removing clones of https://github.com/rraptorr/sun-java6 success [x] Cloning https://github.com/rraptorr/sun-java6 success [x] Checking out v6.35-1 success [x] Getting Java SE download page success [x] Getting current release download page success [x] Getting previous releases download page success [x] Downloading jdk-6u35-linux-i586.bin : failed [i] Showing the last 5 lines from the logfile (/home/ronen/oab-java.sh.log)... 7525's retcode: 0 success [x] Downloading jdk-6u35-linux-i586.bin : http://: Invalid host name. 7547's retcode: 1

lvnilesh commented 12 years ago

failed for me as well on my ubuntu precise x64 on the lines of @narkisr

Uxorious commented 12 years ago

[x] Getting current release download page success [x] Getting previous releases download page success

This means it could not find the 6u35 release on the main page ... but it IS there. The index file it downloaded should still be on your machine. What does this command print? grep -P -o "/technetwork/java/javase/downloads/jdk6u35-downloads-\d+.html" /tmp/oab-index.htm l | uniq

EricEdens commented 12 years ago

Same issue as @lvnilesh and @narkisr with Ubuntu 12.04.1 64bit.

$ grep -P -o "/technetwork/java/javase/downloads/jdk6u35-downloads-\d+.html" /tmp/oab-index.html | uniq /technetwork/java/javase/downloads/jdk6u35-downloads-1836443.html

Here's the tail of oab-java.sh.log:

Resolving www.oracle.com (www.oracle.com)... 23.46.145.55 Connecting to www.oracle.com (www.oracle.com)|23.46.145.55|:80... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: `/tmp/oab-download.html'

 0K .......... .......... .......... .......... ..........  281K
50K .......... .......... .......... .......... ..........  774K

100K .......... .......... .......... .......... .......... 512K 150K .......... .......... .......... .......... .......... 934K 200K .......... .......... .......... .......... .......... 877K 250K .......... .......... .......... ...... 4.19M=0.5s

2012-09-12 08:38:40 (623 KB/s) - `/tmp/oab-download.html' saved [292877]

18015's retcode: 0 success [x] Downloading jdk-6u35-linux-i586.bin : http://: Invalid host name. 18049's retcode: 1 failed

Uxorious commented 12 years ago

Right, but the problem is that for some reason it didn't find the file in the first download index. That's why it printed "[x] Getting previous releases download page success". Of course 6u35 is the current release, so looking for it in the previous releases file isn't going to help. Try adding a bunch of variables to the print. You need to find out why DOWNLOAD_FOUND is not set correctly.

Notice that the script doesn't actually leave the correct /tmp/oab-download.html on the HDD after your run - it gets overwritten by the previous release file. To get the current one manually, run: wget http://www.oracle.com//technetwork/java/javase/downloads/jdk6u35-downloads-1836443.html -O oab-download.html

kyeongsoo commented 12 years ago

At least, the above problem was solved by changing the line 443 as follows (i.e., adding 'u${JAVA_UPD}' after '${JAVA_VER}'): DOWNLOAD_INDEX=grep -P -o "/technetwork/java/javase/downloads/jdk${JAVA_VER}u${JAVA_UPD}-downloads-\d+\.html" /tmp/oab-index.html | uniq

The problem now, however, is that I have errors in "Building the packages success" step. Below is the excerpt from the log:

.....

[x] Symlinking jce_policy-6.zip 26062's retcode: 0 success [x] Updating the changelog dch: fatal error at line 408: Urgency can only be one of: low, medium, high, critical, emergency ^H^H26067's retcode: 255 success [x] Building the packages dpkg-buildpackage: export CFLAGS from dpkg-buildflags (origin: vendor): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security dpkg-buildpackage: export CPPFLAGS from dpkg-buildflags (origin: vendor): -D_FORTIFY_SOURCE=2 dpkg-buildpackage: export CXXFLAGS from dpkg-buildflags (origin: vendor): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security dpkg-buildpackage: export FFLAGS from dpkg-buildflags (origin: vendor): -g -O2 dpkg-buildpackage: export LDFLAGS from dpkg-buildflags (origin: vendor): -Wl,-Bsymbolic-functions -Wl,-z,relro dpkg-buildpackage: source package sun-java6 dpkg-buildpackage: source version 6.35-1 dpkg-buildpackage: source changed by Janusz Dziemidowicz rraptorr@nails.eu.org dpkg-source --before-build src dpkg-buildpackage: host architecture amd64 'pkg-source: error: invalid Format field `3.0 (native) dpkg-buildpackage: error: dpkg-source --before-build src gave error exit status 25 ^H^H26075's retcode: 25 success

jflemer-ndp commented 12 years ago

Or perhaps use ${JAVA_VER}[0-9u]* which might be a bit more robust to future changes, but not so eager as to match something inappropriate (as .* would most certainly do). e.g.:

grep -m 1 -E -o "/technetwork/java/javase/downloads/jdk${JAVA_VER}[0-9u]*-downloads-[0-9]+\.html"
j2d3 commented 11 years ago

Looks like this problem just resurfaced.

[x] Installing Java build requirements success [x] Making build directories success [x] Removing clones of https://github.com/rraptorr/sun-java6 success [x] Cloning https://github.com/rraptorr/sun-java6 success [x] Checking out v6.39-1 success [x] Getting Java SE download page success [x] Getting current release download page success [x] Getting previous releases download page success [x] Downloading jdk-6u39-linux-i586.bin : failed [i] Showing the last 5 lines from the logfile (/var/log/oab-java.sh.log)... 25301's retcode: 0 success [x] Downloading jdk-6u39-linux-i586.bin : http://: Invalid host name. 25318's retcode: 1 failed