1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-20 13:50:12 +01:00

Adapt scanner, fix some other issues

This commit is contained in:
Daniel Martí 2013-12-19 23:06:57 +01:00
parent b4b2e74082
commit 0a770cf4bc
3 changed files with 50 additions and 55 deletions

View File

@ -82,6 +82,9 @@ __complete_build() {
lopts="--help --verbose --latest --server --resetserver --on-server lopts="--help --verbose --latest --server --resetserver --on-server
--force --all" --force --all"
case "${cur}" in case "${cur}" in
-*)
__complete_options
return 0;;
*:) *:)
__vercode __vercode
return 0;; return 0;;
@ -89,7 +92,6 @@ __complete_build() {
__package __package
return 0;; return 0;;
esac esac
__complete_options
} }
__complete_install() { __complete_install() {
@ -175,14 +177,19 @@ __complete_rewritemeta() {
} }
__complete_scanner() { __complete_scanner() {
opts="-h -v -p" opts="-h -v"
lopts="--help --verbose --package --nosvn" lopts="--help --verbose --nosvn"
case "${prev}" in case "${cur}" in
-p|--package) -*)
__complete_options
return 0;;
*:)
__vercode
return 0;;
*)
__package __package
return 0;; return 0;;
esac esac
__complete_options
} }
__complete_verify() { __complete_verify() {

View File

@ -30,7 +30,7 @@ def main():
global config, options global config, options
# Parse command line... # Parse command line...
parser = OptionParser() parser = OptionParser(usage="Usage: %prog [options] [APPID [APPID ...]]")
parser.add_option("-v", "--verbose", action="store_true", default=False, parser.add_option("-v", "--verbose", action="store_true", default=False,
help="Spew out even more information than normal") help="Spew out even more information than normal")
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
@ -41,10 +41,6 @@ def main():
allapps = metadata.read_metadata(xref=False) allapps = metadata.read_metadata(xref=False)
apps = common.read_app_args(args, allapps, False) apps = common.read_app_args(args, allapps, False)
if len(apps) == 0:
print "No packages to rewrite"
sys.exit(1)
for app in apps: for app in apps:
print "Writing " + app['id'] print "Writing " + app['id']
metadata.write_metadata(os.path.join('metadata', app['id'])+'.txt', app) metadata.write_metadata(os.path.join('metadata', app['id'])+'.txt', app)

View File

@ -33,7 +33,7 @@ def main():
global config, options global config, options
# Parse command line... # Parse command line...
parser = OptionParser() parser = OptionParser(usage="Usage: %prog [options] [APPID[:VERCODE] [APPID[:VERCODE] ...]]")
parser.add_option("-v", "--verbose", action="store_true", default=False, parser.add_option("-v", "--verbose", action="store_true", default=False,
help="Spew out even more information than normal") help="Spew out even more information than normal")
parser.add_option("-p", "--package", default=None, parser.add_option("-p", "--package", default=None,
@ -45,14 +45,8 @@ def main():
config = common.read_config(options) config = common.read_config(options)
# Get all apps... # Get all apps...
apps = metadata.read_metadata() allapps = metadata.read_metadata()
apps = common.read_app_args(args, allapps, True)
# Filter apps according to command-line options
if options.package:
apps = [app for app in apps if app['id'] == options.package]
if len(apps) == 0:
print "No such package"
sys.exit(1)
problems = [] problems = []
@ -68,14 +62,12 @@ def main():
skip = False skip = False
if app['Disabled']: if app['Disabled']:
print "Skipping %s: disabled" % app['id'] print "Skipping %s: disabled" % app['id']
skip = True continue
elif not app['builds']: if not app['builds']:
print "Skipping %s: no builds specified" % app['id'] print "Skipping %s: no builds specified" % app['id']
skip = True continue
elif options.nosvn and app['Repo Type'] == 'svn': elif options.nosvn and app['Repo Type'] == 'svn':
skip = True continue
if not skip:
print "Processing " + app['id'] print "Processing " + app['id']