Tentative prerelease support. Unfortunately requires the rewrite of most of the scripts, as it might provide multiple versions.

This commit is contained in:
Emiliano Vavassori 2022-04-24 22:38:40 +02:00
parent 380fd7029e
commit 638706ce2f
1 changed files with 22 additions and 4 deletions

View File

@ -30,6 +30,16 @@ class BuildVersion(object):
else:
# String self.versions.
a = self.__getbranchrel(self.query)
if isinstance(a, list):
# If it's a list, a number of releases are provided.
self.version = []
self.basedirurl = []
for i in range(len(a)):
self.version[i] = self.__getlatestrel(a[i]['version'])
self.basedirurl[i] = a[i]['basedirurl']
else:
self.version = a['version']
self.basedirurl = a['basedirurl']
@ -62,10 +72,18 @@ class BuildVersion(object):
return { 'version': version + '-' + dailyversion, 'basedirurl': basedirurl }
if branch == 'prerelease':
version = etree.HTML(urllib.request.urlopen(BuildVersion.PRERELEASE).read()).xpath('//td/a')[1].text.split('_')[1]
# Also here, we'll rely on DownloadPage. Whenever a prerelease version is cited in the page.
version = etree.HTML(urllib.request.urlopen(BuildVersion.DOWNLOADPAGE).read()).xpath('//p[@class="lead_libre"][last()]/following-sibling::ul[last()]/li/a/text()')
retval = []
basedirurl = { u'x86': '-', u'x86_64': BuildVersion.PRERELEASE }
return { 'version': version, 'basedirurl': basedirurl }
if len(version) == 0:
return retval
for v in version:
retval.append({ 'version': v, 'basedirurl': basedirurl })
return retval
# Stable releases.
# Old approach - Doesn't really work because RelEng can screw order.