mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 07:52:35 +03:00
Put releases in the right order on the web site repository browser
This commit is contained in:
parent
31125c3cdb
commit
035febb2bf
1 changed files with 34 additions and 25 deletions
59
update.py
59
update.py
|
@ -100,7 +100,7 @@ for apkfile in glob.glob(os.path.join('repo','*.apk')):
|
||||||
pat = re.compile(".*name='([a-zA-Z0-9.]*)'.*")
|
pat = re.compile(".*name='([a-zA-Z0-9.]*)'.*")
|
||||||
thisinfo['id'] = re.match(pat, line).group(1)
|
thisinfo['id'] = re.match(pat, line).group(1)
|
||||||
pat = re.compile(".*versionCode='([0-9]*)'.*")
|
pat = re.compile(".*versionCode='([0-9]*)'.*")
|
||||||
thisinfo['versioncode'] = re.match(pat, line).group(1)
|
thisinfo['versioncode'] = int(re.match(pat, line).group(1))
|
||||||
pat = re.compile(".*versionName='([^']*)'.*")
|
pat = re.compile(".*versionName='([^']*)'.*")
|
||||||
thisinfo['version'] = re.match(pat, line).group(1)
|
thisinfo['version'] = re.match(pat, line).group(1)
|
||||||
if line.startswith("application:"):
|
if line.startswith("application:"):
|
||||||
|
@ -156,7 +156,7 @@ for apkfile in glob.glob(os.path.join('repo','*.apk')):
|
||||||
# Extract the icon file...
|
# Extract the icon file...
|
||||||
apk = zipfile.ZipFile(apkfile, 'r')
|
apk = zipfile.ZipFile(apkfile, 'r')
|
||||||
thisinfo['icon'] = (thisinfo['id'] + '.' +
|
thisinfo['icon'] = (thisinfo['id'] + '.' +
|
||||||
thisinfo['versioncode'] + '.png')
|
str(thisinfo['versioncode']) + '.png')
|
||||||
iconfilename = os.path.join(icon_dir, thisinfo['icon'])
|
iconfilename = os.path.join(icon_dir, thisinfo['icon'])
|
||||||
try:
|
try:
|
||||||
iconfile = open(iconfilename, 'wb')
|
iconfile = open(iconfilename, 'wb')
|
||||||
|
@ -262,33 +262,42 @@ for app in apps:
|
||||||
|
|
||||||
gotmarketver = False
|
gotmarketver = False
|
||||||
|
|
||||||
|
# Get a list of the apks for this app...
|
||||||
|
apklist = []
|
||||||
for apk in apks:
|
for apk in apks:
|
||||||
if apk['id'] == app['id']:
|
if apk['id'] == app['id']:
|
||||||
if apk['versioncode'] == app['marketvercode']:
|
if str(apk['versioncode']) == app['marketvercode']:
|
||||||
gotmarketver = True
|
gotmarketver = True
|
||||||
apkel = doc.createElement("package")
|
apklist.append(apk)
|
||||||
apel.appendChild(apkel)
|
|
||||||
addElement('version', apk['version'], doc, apkel)
|
# Sort the apk list into version order, just so the web site
|
||||||
addElement('versioncode', apk['versioncode'], doc, apkel)
|
# doesn't have to do any work by default...
|
||||||
addElement('apkname', apk['apkname'], doc, apkel)
|
apklist = sorted(apklist, key=lambda apk: apk['versioncode'], reverse=True)
|
||||||
addElement('hash', apk['md5'], doc, apkel)
|
|
||||||
addElement('sig', apk['sig'], doc, apkel)
|
for apk in apklist:
|
||||||
addElement('size', str(apk['size']), doc, apkel)
|
apkel = doc.createElement("package")
|
||||||
addElement('sdkver', str(apk['sdkversion']), doc, apkel)
|
apel.appendChild(apkel)
|
||||||
perms = ""
|
addElement('version', apk['version'], doc, apkel)
|
||||||
for p in apk['permissions']:
|
addElement('versioncode', str(apk['versioncode']), doc, apkel)
|
||||||
if len(perms) > 0:
|
addElement('apkname', apk['apkname'], doc, apkel)
|
||||||
perms += ","
|
addElement('hash', apk['md5'], doc, apkel)
|
||||||
perms += p
|
addElement('sig', apk['sig'], doc, apkel)
|
||||||
|
addElement('size', str(apk['size']), doc, apkel)
|
||||||
|
addElement('sdkver', str(apk['sdkversion']), doc, apkel)
|
||||||
|
perms = ""
|
||||||
|
for p in apk['permissions']:
|
||||||
if len(perms) > 0:
|
if len(perms) > 0:
|
||||||
addElement('permissions', perms, doc, apkel)
|
perms += ","
|
||||||
features = ""
|
perms += p
|
||||||
for f in apk['features']:
|
if len(perms) > 0:
|
||||||
if len(features) > 0:
|
addElement('permissions', perms, doc, apkel)
|
||||||
features += ","
|
features = ""
|
||||||
features += f
|
for f in apk['features']:
|
||||||
if len(features) > 0:
|
if len(features) > 0:
|
||||||
addElement('features', features, doc, apkel)
|
features += ","
|
||||||
|
features += f
|
||||||
|
if len(features) > 0:
|
||||||
|
addElement('features', features, doc, apkel)
|
||||||
|
|
||||||
if options.buildreport:
|
if options.buildreport:
|
||||||
if len(app['builds']) == 0:
|
if len(app['builds']) == 0:
|
||||||
|
@ -318,7 +327,7 @@ for app in apps:
|
||||||
print " Got:"
|
print " Got:"
|
||||||
for apk in apks:
|
for apk in apks:
|
||||||
if apk['id'] == app['id']:
|
if apk['id'] == app['id']:
|
||||||
print " " + apk['versioncode'] + " - " + apk['version']
|
print " " + str(apk['versioncode']) + " - " + apk['version']
|
||||||
|
|
||||||
else:
|
else:
|
||||||
apps_disabled += 1
|
apps_disabled += 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue