summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorRicardo M. Correia <rcorreia@wizy.org>2014-12-03 05:41:51 +0100
committerRicardo M. Correia <rcorreia@wizy.org>2014-12-03 05:41:51 +0100
commit31522e13c74ee15b2cc0b20475009cff672f1ad1 (patch)
tree67e3d5253a200cfe64edeb6f0d39d2adc0f1e5d1 /pkgs/development/compilers
parentd2488119cced92351740e46e27b218edc1b97843 (diff)
downloadnixlib-31522e13c74ee15b2cc0b20475009cff672f1ad1.tar
nixlib-31522e13c74ee15b2cc0b20475009cff672f1ad1.tar.gz
nixlib-31522e13c74ee15b2cc0b20475009cff672f1ad1.tar.bz2
nixlib-31522e13c74ee15b2cc0b20475009cff672f1ad1.tar.lz
nixlib-31522e13c74ee15b2cc0b20475009cff672f1ad1.tar.xz
nixlib-31522e13c74ee15b2cc0b20475009cff672f1ad1.tar.zst
nixlib-31522e13c74ee15b2cc0b20475009cff672f1ad1.zip
icedtea: Simplify update script
Diffstat (limited to 'pkgs/development/compilers')
-rwxr-xr-xpkgs/development/compilers/icedtea/update.py33
1 files changed, 16 insertions, 17 deletions
diff --git a/pkgs/development/compilers/icedtea/update.py b/pkgs/development/compilers/icedtea/update.py
index 69cf0906bce7..c41cf3d38d2f 100755
--- a/pkgs/development/compilers/icedtea/update.py
+++ b/pkgs/development/compilers/icedtea/update.py
@@ -3,7 +3,7 @@
 import subprocess, urllib.request, re, os, tarfile
 from html.parser import HTMLParser
 
-HG_URL = 'http://icedtea.classpath.org/hg/release/icedtea{}-forest-{}'
+URL = 'http://icedtea.classpath.org/download/drops/icedtea{}/{}'
 DOWNLOAD_URL = 'http://icedtea.wildebeest.org/download/source/'
 DOWNLOAD_HTML = DOWNLOAD_URL + '?C=M;O=D'
 
@@ -89,7 +89,7 @@ def get_old_bundle_attrs(jdk, bundle):
 def get_old_attrs(jdk):
 	attrs = {}
 
-	for attr in ('branch', 'version', 'url', 'sha256'):
+	for attr in ('version', 'url', 'sha256'):
 		attrs[attr] = get_jdk_attr(jdk, attr)
 
 	attrs['bundles'] = {}
@@ -128,8 +128,8 @@ def get_new_bundle_attr(makefile, bundle, attr):
 
 	return m.group(1)
 
-def get_new_bundle_attrs(jdk, version, branch, path):
-	hg_url = HG_URL.format(jdk, branch)
+def get_new_bundle_attrs(jdk, version, path):
+	url = URL.format(jdk, version)
 
 	attrs = {}
 
@@ -139,14 +139,16 @@ def get_new_bundle_attrs(jdk, version, branch, path):
 	makefile = get_member_file(tar, 'Makefile.am')
 	hotspot_map = get_member_file(tar, 'hotspot.map.in')
 
+	hotspot_map = hotspot_map.replace('@ICEDTEA_RELEASE@', version)
+
 	for bundle in BUNDLES:
 		battrs = {}
 
-		battrs['url'] = 'http://icedtea.wildebeest.org/download/drops/icedtea{}/{}/{}.tar.bz2'.format(jdk, version, bundle)
+		battrs['url'] = '{}/{}.tar.bz2'.format(url, bundle)
 		if bundle == 'hotspot':
 			m = re.search(r'^default (.*?) (.*?) (.*?) (.*?)$', hotspot_map, re.MULTILINE)
 			if m == None:
-			    raise Exception('Could not find info for hotspot bundle in hotspot.map.in')
+				raise Exception('Could not find info for hotspot bundle in hotspot.map.in')
 
 			battrs['sha256'] = m.group(4)
 		else:
@@ -182,7 +184,6 @@ def get_new_attrs(jdk):
 	print('Update available, generating new attributes for JDK {}...'.format(jdk))
 
 	attrs['version'] = version
-	attrs['branch'] = '.'.join(version.split('.')[:2])
 	attrs['url'] = url
 
 	print('Downloading tarball from url "{}"...'.format(url))
@@ -192,7 +193,7 @@ def get_new_attrs(jdk):
 
 	print('Inspecting tarball for bundle information...')
 
-	attrs['bundles'] = get_new_bundle_attrs(jdk, attrs['version'], attrs['branch'], path)
+	attrs['bundles'] = get_new_bundle_attrs(jdk, attrs['version'], path)
 
 	print('Done!')
 
@@ -201,21 +202,19 @@ def get_new_attrs(jdk):
 def generate_jdk(jdk):
 	attrs = get_new_attrs(jdk)
 
-	branch = attrs['branch']
-	src_version = attrs['version'].replace(branch, '${branch}')
-	src_url = attrs['url'].replace(attrs['version'], '${version}')
+	version = attrs['version']
+	src_url = attrs['url'].replace(version, '${version}')
 
-	hg_url = HG_URL.format(jdk, branch)
-	src_hg_url = HG_URL.format(jdk, '${branch}')
+	common_url = URL.format(jdk, version)
+	src_common_url = URL.format(jdk, '${version}')
 
 	src =  '  icedtea{} = rec {{\n'.format(jdk)
-	src += '    branch = "{}";\n'.format(branch)
-	src += '    version = "{}";\n'.format(src_version)
+	src += '    version = "{}";\n'.format(version)
 	src += '\n'
 	src += '    url = "{}";\n'.format(src_url)
 	src += '    sha256 = "{}";\n'.format(attrs['sha256'])
 	src += '\n'
-	src += '    hg_url = "{}";\n'.format(src_hg_url)
+	src += '    common_url = "{}";\n'.format(src_common_url)
 	src += '\n'
 	src += '    bundles = {\n'
 
@@ -223,7 +222,7 @@ def generate_jdk(jdk):
 		battrs = attrs['bundles'][bundle]
 
 		b_url = battrs['url']
-		b_url = b_url.replace(hg_url, '${hg_url}')
+		b_url = b_url.replace(common_url, '${common_url}')
 
 		src += '      {} = rec {{\n'.format(bundle)
 		src += '        url = "{}";\n'.format(b_url)