mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 23:10:29 +03:00
Only install latest apk of each app, other fixes
This commit is contained in:
parent
93d8d23cee
commit
21db79eea2
3 changed files with 61 additions and 50 deletions
|
|
@ -877,6 +877,15 @@ def main():
|
||||||
allapps = metadata.read_metadata(xref=not options.onserver)
|
allapps = metadata.read_metadata(xref=not options.onserver)
|
||||||
|
|
||||||
apps = common.read_app_args(args, options, allapps)
|
apps = common.read_app_args(args, options, allapps)
|
||||||
|
apps = [app for app in apps if (options.force or not app['Disabled']) and
|
||||||
|
len(app['Repo Type']) > 0 and len(app['builds']) > 0]
|
||||||
|
|
||||||
|
if len(apps) == 0:
|
||||||
|
raise Exception("No apps to process.")
|
||||||
|
|
||||||
|
if options.latest:
|
||||||
|
for app in apps:
|
||||||
|
app['builds'] = app['builds'][-1:]
|
||||||
|
|
||||||
if options.wiki:
|
if options.wiki:
|
||||||
import mwclient
|
import mwclient
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,9 @@ def read_config(opts, config_file='config.py'):
|
||||||
return config
|
return config
|
||||||
|
|
||||||
def read_app_args(args, options, allapps):
|
def read_app_args(args, options, allapps):
|
||||||
if args:
|
if not args:
|
||||||
|
return []
|
||||||
|
|
||||||
vercodes = {}
|
vercodes = {}
|
||||||
for p in args:
|
for p in args:
|
||||||
if ':' in p:
|
if ':' in p:
|
||||||
|
|
@ -132,15 +134,8 @@ def read_app_args(args, options, allapps):
|
||||||
print "No such package: %s" % p
|
print "No such package: %s" % p
|
||||||
raise Exception("Found invalid app ids in arguments")
|
raise Exception("Found invalid app ids in arguments")
|
||||||
|
|
||||||
if hasattr(options, "force"):
|
if not vercodes:
|
||||||
force = options.force
|
return apps
|
||||||
else:
|
|
||||||
force = False
|
|
||||||
|
|
||||||
apps = [app for app in apps if (force or not app['Disabled']) and
|
|
||||||
app['builds'] and len(app['Repo Type']) > 0 and len(app['builds']) > 0]
|
|
||||||
if len(apps) == 0:
|
|
||||||
raise Exception("No apps to process.")
|
|
||||||
|
|
||||||
error = False
|
error = False
|
||||||
for app in apps:
|
for app in apps:
|
||||||
|
|
@ -153,8 +148,6 @@ def read_app_args(args, options, allapps):
|
||||||
for v in vercodes[app['id']]:
|
for v in vercodes[app['id']]:
|
||||||
if v not in allvcs:
|
if v not in allvcs:
|
||||||
print "No such vercode %s for app %s" % (v, app['id'])
|
print "No such vercode %s for app %s" % (v, app['id'])
|
||||||
elif options.latest:
|
|
||||||
app['builds'] = app['builds'][-1:]
|
|
||||||
|
|
||||||
if error:
|
if error:
|
||||||
raise Exception("Found invalid vercodes for some apps")
|
raise Exception("Found invalid vercodes for some apps")
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,17 @@ def main():
|
||||||
apps = common.read_app_args(args, options, allapps)
|
apps = common.read_app_args(args, options, allapps)
|
||||||
|
|
||||||
for app in apps:
|
for app in apps:
|
||||||
for thisbuild in app['builds']:
|
last = None
|
||||||
apk = os.path.join(output_dir, common.getapkname(app, thisbuild))
|
for build in app['builds']:
|
||||||
|
apk = os.path.join(output_dir, common.getapkname(app, build))
|
||||||
|
if os.path.exists(apk):
|
||||||
|
last = build
|
||||||
|
if last is None:
|
||||||
|
raise Exception("No available signed apks for %s" % app['id'])
|
||||||
|
|
||||||
|
for app in apps:
|
||||||
|
build = app['builds'][0]
|
||||||
|
apk = os.path.join(output_dir, common.getapkname(app, build))
|
||||||
if not os.path.exists(apk):
|
if not os.path.exists(apk):
|
||||||
raise Exception("No such signed apk: %s" % apk)
|
raise Exception("No such signed apk: %s" % apk)
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue