mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 07:52:35 +03:00
Leave apps out of the repo index if there are no packages
This commit is contained in:
parent
402b617e77
commit
8c9f28c7c4
1 changed files with 53 additions and 47 deletions
100
update.py
100
update.py
|
@ -237,32 +237,11 @@ root.appendChild(repoel)
|
||||||
|
|
||||||
apps_inrepo = 0
|
apps_inrepo = 0
|
||||||
apps_disabled = 0
|
apps_disabled = 0
|
||||||
|
apps_nopkg = 0
|
||||||
|
|
||||||
for app in apps:
|
for app in apps:
|
||||||
|
|
||||||
if app['disabled'] is None:
|
if app['disabled'] is None:
|
||||||
apps_inrepo += 1
|
|
||||||
apel = doc.createElement("application")
|
|
||||||
apel.setAttribute("id", app['id'])
|
|
||||||
root.appendChild(apel)
|
|
||||||
|
|
||||||
addElement('id', app['id'], doc, apel)
|
|
||||||
addElement('name', app['name'], doc, apel)
|
|
||||||
addElement('summary', app['summary'], doc, apel)
|
|
||||||
addElement('icon', app['icon'], doc, apel)
|
|
||||||
addElement('description', app['description'], doc, apel)
|
|
||||||
addElement('license', app['license'], doc, apel)
|
|
||||||
addElement('web', app['web'], doc, apel)
|
|
||||||
addElement('source', app['source'], doc, apel)
|
|
||||||
addElement('tracker', app['tracker'], doc, apel)
|
|
||||||
if app['donate'] != None:
|
|
||||||
addElement('donate', app['donate'], doc, apel)
|
|
||||||
addElement('marketversion', app['marketversion'], doc, apel)
|
|
||||||
addElement('marketvercode', app['marketvercode'], doc, apel)
|
|
||||||
if not (app['antifeatures'] is None):
|
|
||||||
addElement('antifeatures', app['antifeatures'], doc, apel)
|
|
||||||
|
|
||||||
gotmarketver = False
|
|
||||||
|
|
||||||
# Get a list of the apks for this app...
|
# Get a list of the apks for this app...
|
||||||
apklist = []
|
apklist = []
|
||||||
|
@ -272,34 +251,60 @@ for app in apps:
|
||||||
gotmarketver = True
|
gotmarketver = True
|
||||||
apklist.append(apk)
|
apklist.append(apk)
|
||||||
|
|
||||||
# Sort the apk list into version order, just so the web site
|
if len(apklist) == 0:
|
||||||
# doesn't have to do any work by default...
|
apps_nopkg += 1
|
||||||
apklist = sorted(apklist, key=lambda apk: apk['versioncode'], reverse=True)
|
else:
|
||||||
|
apps_inrepo += 1
|
||||||
|
apel = doc.createElement("application")
|
||||||
|
apel.setAttribute("id", app['id'])
|
||||||
|
root.appendChild(apel)
|
||||||
|
|
||||||
for apk in apklist:
|
addElement('id', app['id'], doc, apel)
|
||||||
apkel = doc.createElement("package")
|
addElement('name', app['name'], doc, apel)
|
||||||
apel.appendChild(apkel)
|
addElement('summary', app['summary'], doc, apel)
|
||||||
addElement('version', apk['version'], doc, apkel)
|
addElement('icon', app['icon'], doc, apel)
|
||||||
addElement('versioncode', str(apk['versioncode']), doc, apkel)
|
addElement('description', app['description'], doc, apel)
|
||||||
addElement('apkname', apk['apkname'], doc, apkel)
|
addElement('license', app['license'], doc, apel)
|
||||||
addElement('hash', apk['md5'], doc, apkel)
|
addElement('web', app['web'], doc, apel)
|
||||||
addElement('sig', apk['sig'], doc, apkel)
|
addElement('source', app['source'], doc, apel)
|
||||||
addElement('size', str(apk['size']), doc, apkel)
|
addElement('tracker', app['tracker'], doc, apel)
|
||||||
addElement('sdkver', str(apk['sdkversion']), doc, apkel)
|
if app['donate'] != None:
|
||||||
perms = ""
|
addElement('donate', app['donate'], doc, apel)
|
||||||
for p in apk['permissions']:
|
addElement('marketversion', app['marketversion'], doc, apel)
|
||||||
|
addElement('marketvercode', app['marketvercode'], doc, apel)
|
||||||
|
if not (app['antifeatures'] is None):
|
||||||
|
addElement('antifeatures', app['antifeatures'], doc, apel)
|
||||||
|
|
||||||
|
gotmarketver = False
|
||||||
|
|
||||||
|
# Sort the apk list into version order, just so the web site
|
||||||
|
# doesn't have to do any work by default...
|
||||||
|
apklist = sorted(apklist, key=lambda apk: apk['versioncode'], reverse=True)
|
||||||
|
|
||||||
|
for apk in apklist:
|
||||||
|
apkel = doc.createElement("package")
|
||||||
|
apel.appendChild(apkel)
|
||||||
|
addElement('version', apk['version'], doc, apkel)
|
||||||
|
addElement('versioncode', str(apk['versioncode']), doc, apkel)
|
||||||
|
addElement('apkname', apk['apkname'], doc, apkel)
|
||||||
|
addElement('hash', apk['md5'], doc, apkel)
|
||||||
|
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:
|
||||||
|
perms += ","
|
||||||
|
perms += p
|
||||||
if len(perms) > 0:
|
if len(perms) > 0:
|
||||||
perms += ","
|
addElement('permissions', perms, doc, apkel)
|
||||||
perms += p
|
features = ""
|
||||||
if len(perms) > 0:
|
for f in apk['features']:
|
||||||
addElement('permissions', perms, doc, apkel)
|
if len(features) > 0:
|
||||||
features = ""
|
features += ","
|
||||||
for f in apk['features']:
|
features += f
|
||||||
if len(features) > 0:
|
if len(features) > 0:
|
||||||
features += ","
|
addElement('features', features, doc, apkel)
|
||||||
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:
|
||||||
|
@ -346,5 +351,6 @@ shutil.copyfile(repo_icon, iconfilename)
|
||||||
print "Finished."
|
print "Finished."
|
||||||
print str(apps_inrepo) + " apps in repo"
|
print str(apps_inrepo) + " apps in repo"
|
||||||
print str(apps_disabled) + " disabled"
|
print str(apps_disabled) + " disabled"
|
||||||
|
print str(apps_nopkg) + " with no packages"
|
||||||
print str(warnings) + " warnings"
|
print str(warnings) + " warnings"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue