mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 23:10:29 +03:00
Publish a category list with the repo, for quicker access
This commit is contained in:
parent
71897f3aff
commit
161df270ed
1 changed files with 15 additions and 1 deletions
14
update.py
14
update.py
|
|
@ -75,6 +75,12 @@ if (repo_url is None or repo_name is None or
|
||||||
# Get all apps...
|
# Get all apps...
|
||||||
apps = common.read_metadata(verbose=options.verbose)
|
apps = common.read_metadata(verbose=options.verbose)
|
||||||
|
|
||||||
|
# Generate a list of categories...
|
||||||
|
categories = []
|
||||||
|
for app in apps:
|
||||||
|
if app['Category'] not in categories:
|
||||||
|
categories.append(app['Category'])
|
||||||
|
|
||||||
# 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')):
|
||||||
|
|
@ -469,6 +475,14 @@ if repo_keyalias != None:
|
||||||
iconfilename = os.path.join(icon_dir, os.path.basename(repo_icon))
|
iconfilename = os.path.join(icon_dir, os.path.basename(repo_icon))
|
||||||
shutil.copyfile(repo_icon, iconfilename)
|
shutil.copyfile(repo_icon, iconfilename)
|
||||||
|
|
||||||
|
# Write a category list in the repo to allow quick access...
|
||||||
|
catdata = ''
|
||||||
|
for cat in categories:
|
||||||
|
catdata += cat + '\n'
|
||||||
|
f = open('repo/categories.txt', 'w')
|
||||||
|
f.write(catdata)
|
||||||
|
f.close()
|
||||||
|
|
||||||
# Update known apks info...
|
# Update known apks info...
|
||||||
knownapks = common.KnownApks()
|
knownapks = common.KnownApks()
|
||||||
for apk in apks:
|
for apk in apks:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue