Leave apps out of the repo index if there are no packages

This commit is contained in:
Ciaran Gultnieks 2011-01-23 21:54:49 +00:00
parent 402b617e77
commit 8c9f28c7c4

View file

@ -237,10 +237,23 @@ 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:
# Get a list of the apks for this app...
apklist = []
for apk in apks:
if apk['id'] == app['id']:
if str(apk['versioncode']) == app['marketvercode']:
gotmarketver = True
apklist.append(apk)
if len(apklist) == 0:
apps_nopkg += 1
else:
apps_inrepo += 1 apps_inrepo += 1
apel = doc.createElement("application") apel = doc.createElement("application")
apel.setAttribute("id", app['id']) apel.setAttribute("id", app['id'])
@ -264,14 +277,6 @@ for app in apps:
gotmarketver = False gotmarketver = False
# Get a list of the apks for this app...
apklist = []
for apk in apks:
if apk['id'] == app['id']:
if str(apk['versioncode']) == app['marketvercode']:
gotmarketver = True
apklist.append(apk)
# Sort the apk list into version order, just so the web site # Sort the apk list into version order, just so the web site
# doesn't have to do any work by default... # doesn't have to do any work by default...
apklist = sorted(apklist, key=lambda apk: apk['versioncode'], reverse=True) apklist = sorted(apklist, key=lambda apk: apk['versioncode'], reverse=True)
@ -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"