mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-07-07 09:50:07 +02:00
Added ability to disable an app (exclude from repo, but keeping the metadata
This commit is contained in:
parent
9d6b06a0a4
commit
6d092b0dc2
14
update.py
14
update.py
@ -113,6 +113,7 @@ for metafile in glob.glob(os.path.join('metadata','*.txt')):
|
||||
thisinfo['web'] = ''
|
||||
thisinfo['source'] = ''
|
||||
thisinfo['tracker'] = ''
|
||||
thisinfo['disabled'] = None
|
||||
f = open(metafile, 'r')
|
||||
mode = 0
|
||||
for line in f.readlines():
|
||||
@ -138,6 +139,8 @@ for metafile in glob.glob(os.path.join('metadata','*.txt')):
|
||||
thisinfo['web'] = value
|
||||
elif field == 'Issue Tracker':
|
||||
thisinfo['tracker'] = value
|
||||
elif field == 'Disabled':
|
||||
thisinfo['disabled'] = value
|
||||
else:
|
||||
print "Unrecognised field " + field
|
||||
sys.exit(1)
|
||||
@ -211,7 +214,13 @@ def addElement(name, value, doc, parent):
|
||||
root = doc.createElement("fdroid")
|
||||
doc.appendChild(root)
|
||||
|
||||
apps_inrepo = 0
|
||||
apps_disabled = 0
|
||||
|
||||
for app in apps:
|
||||
|
||||
if app['disabled'] is None:
|
||||
apps_inrepo += 1
|
||||
apel = doc.createElement("application")
|
||||
root.appendChild(apel)
|
||||
|
||||
@ -233,6 +242,8 @@ for app in apps:
|
||||
addElement('versioncode', apk['versioncode'], doc, apkel)
|
||||
addElement('apkname', apk['apkname'], doc, apkel)
|
||||
addElement('hash', apk['md5'], doc, apkel)
|
||||
else:
|
||||
apps_disabled += 1
|
||||
|
||||
of = open(os.path.join('repo','index.xml'), 'wb')
|
||||
output = doc.toxml()
|
||||
@ -240,5 +251,6 @@ of.write(output)
|
||||
of.close()
|
||||
|
||||
print "Finished."
|
||||
|
||||
print str(apps_inrepo) + " apps in repo"
|
||||
print str(apps_disabled) + " disabled"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user