return hexlify(pubkey)
-def make_index(apps, sortedids, apks, repodir, archive, categories):
- """Make a repo index.
+def make_index(apps, sortedids, apks, repodir, archive):
+ """Generate the repo index files.
:param apps: fully populated apps list
:param apks: full populated apks list
iconfilename = os.path.join(icon_dir, os.path.basename(config['repo_icon']))
shutil.copyfile(config['repo_icon'], iconfilename)
- # Write a category list in the repo to allow quick access...
+
+def make_categories_txt(repodir, categories):
+ '''Write a category list in the repo to allow quick access'''
catdata = ''
for cat in categories:
catdata += cat + '\n'
appdict = dict()
appdict[appid] = app
if os.path.isdir(repodir):
- make_index(appdict, [appid], apks, repodir, False, categories)
+ make_index(appdict, [appid], apks, repodir, False)
else:
logging.info('Skipping index generation for ' + appid)
return
archive_old_apks(apps, apks, archapks, repodirs[0], repodirs[1], config['archive_older'])
# Make the index for the main repo...
- make_index(apps, sortedids, apks, repodirs[0], False, categories)
+ make_index(apps, sortedids, apks, repodirs[0], False)
+ make_categories_txt(repodirs[0], categories)
# If there's an archive repo, make the index for it. We already scanned it
# earlier on.
if len(repodirs) > 1:
- make_index(apps, sortedids, archapks, repodirs[1], True, categories)
+ make_index(apps, sortedids, archapks, repodirs[1], True)
if config['update_stats']: