[blfs-dev] Mercurial or wget for openjdk?
Pierre Labastie
pierre.labastie at neuf.fr
Sat Sep 5 09:25:03 PDT 2015
Hi all,
Sorry for discussing this again, but before the timing given below, I was
wondering what the best approach for downloading OpenJDK files was. Using
mercurial, it amounts to:
----------
hg clone http://hg.openjdk.java.net/jdk8u/jdk8u<rev>
cd jdk8u<rev>
sh get_source.sh
sh common/bin/hgforest.sh update -r jdk8u<rev>-b<build> # not really needed
----------
Note that mercurial is needed (obviously), but mercurial depends only on
Python, which is a very basic package, and builds very fast (a few tenths of
SBU). hgforest is optimized to retrieve several repositories at the same time,
so the download time is not too long. Actually, timing gives:
-------------
time (
hg clone http://hg.openjdk.java.net/jdk8u/jdk8u60
cd jdk8u60
sh get_source.sh
sh common/bin/hgforest.sh update -r jdk8u60-b27 )
...
real 6m31.868s
user 0m0.896s
sys 0m0.060s
The other approach is to use wget to download tarballs, as proposed by
Fernando. For measuring download+unpack time, I use a version slightly
different from
http://lists.linuxfromscratch.org/pipermail/blfs-dev/2015-May/030258.html:
time (
PACKAGE=jdk8u60-b27.tar.bz2
URL=http://hg.openjdk.java.net/jdk8u/jdk8u60
URL_END=archive/$PACKAGE
wget $URL/$URL_END
tar xf $PACKAGE
for additional in corba hotspot jaxp jaxws langtools jdk nashorn; do
wget $URL/$additional/$URL_END -O $additional.tar.bz2
mkdir -p jdk8u60-jdk8u60-b27/$additional
tar --stripcomponents=1 \
-C jdk8u60-jdk8u60-b27/$additional \
-x -f $additional.tar.bz2
done
)
...
real 2m56.273s
user 0m8.716s
sys 0m2.472s
So definitely, the wget approach is shorter. OTOH the mercurial approach is
much simpler and less prone to errors. If using wget, I think I'll use some
approach similar to what we do for X, as suggested by Fernando, but it would
be still complicated, unless maybe we make a file with 4 fields per line:
tarball-name, md5 extracted-dirname, final-dirname.
Thoughts?
Pierre
More information about the blfs-dev
mailing list