mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-05 18:50:09 +02:00
Added repository metadata
This commit is contained in:
parent
4e927277bd
commit
0596149458
@ -4,3 +4,11 @@
|
|||||||
|
|
||||||
aapt_path = "/path/to/android-sdk-linux_86/platforms/android-4/tools/aapt"
|
aapt_path = "/path/to/android-sdk-linux_86/platforms/android-4/tools/aapt"
|
||||||
|
|
||||||
|
repo_url = "http://f-droid.org/repo"
|
||||||
|
repo_name = "FDroid"
|
||||||
|
repo_icon = "fdroid-icon.png"
|
||||||
|
repo_description = """
|
||||||
|
The official FDroid repository. Applications in this repository are official
|
||||||
|
binaries built by the original application developers.
|
||||||
|
"""
|
||||||
|
|
||||||
|
22
update.py
22
update.py
@ -28,6 +28,10 @@ from xml.dom.minidom import Document
|
|||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
|
||||||
#Read configuration...
|
#Read configuration...
|
||||||
|
repo_name = None
|
||||||
|
repo_description = None
|
||||||
|
repo_icon = None
|
||||||
|
repo_url = None
|
||||||
execfile('config.py')
|
execfile('config.py')
|
||||||
|
|
||||||
execfile('metadata.py')
|
execfile('metadata.py')
|
||||||
@ -48,6 +52,13 @@ if os.path.exists(icon_dir):
|
|||||||
shutil.rmtree(icon_dir)
|
shutil.rmtree(icon_dir)
|
||||||
os.mkdir(icon_dir)
|
os.mkdir(icon_dir)
|
||||||
|
|
||||||
|
#Make sure we have the repository description...
|
||||||
|
if (repo_url is None or repo_name is None or
|
||||||
|
repo_icon is None or repo_description is None):
|
||||||
|
print "Repository description fields are required in config.py"
|
||||||
|
print "See config.sample.py for details"
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
# Gather information about all the apk files in the repo directory...
|
# Gather information about all the apk files in the repo directory...
|
||||||
apks = []
|
apks = []
|
||||||
for apkfile in glob.glob(os.path.join('repo','*.apk')):
|
for apkfile in glob.glob(os.path.join('repo','*.apk')):
|
||||||
@ -187,6 +198,13 @@ def addElement(name, value, doc, parent):
|
|||||||
root = doc.createElement("fdroid")
|
root = doc.createElement("fdroid")
|
||||||
doc.appendChild(root)
|
doc.appendChild(root)
|
||||||
|
|
||||||
|
repoel = doc.createElement("repo")
|
||||||
|
repoel.setAttribute("name", repo_name)
|
||||||
|
repoel.setAttribute("icon", repo_icon)
|
||||||
|
repoel.setAttribute("url", repo_url)
|
||||||
|
addElement('description', repo_description, doc, repoel)
|
||||||
|
root.appendChild(repoel)
|
||||||
|
|
||||||
apps_inrepo = 0
|
apps_inrepo = 0
|
||||||
apps_disabled = 0
|
apps_disabled = 0
|
||||||
|
|
||||||
@ -261,6 +279,10 @@ output = doc.toxml()
|
|||||||
of.write(output)
|
of.write(output)
|
||||||
of.close()
|
of.close()
|
||||||
|
|
||||||
|
#Copy the repo icon into the repo directory...
|
||||||
|
iconfilename = os.path.join(icon_dir, repo_icon)
|
||||||
|
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"
|
||||||
|
Loading…
Reference in New Issue
Block a user