chiark / gitweb /
scanner: use -p check like in build.py, give error if package does not exist
authorTias Guns <tias@ulyssis.org>
Sun, 11 Mar 2012 21:59:25 +0000 (21:59 +0000)
committerTias Guns <tias.guns@cs.kuleuven.be>
Sun, 11 Mar 2012 23:17:46 +0000 (23:17 +0000)
fdroidserver/scanner.py

index bd9d27009286ff4701a3cdc10ce1f3fd479f8d20..c5a041328b68658342928d8f961f9fee88f8833d 100644 (file)
@@ -50,6 +50,13 @@ def main():
     # Get all apps...
     apps = common.read_metadata(options.verbose)
 
+    # 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)
+
     html_parser = HTMLParser.HTMLParser()
 
     problems = []
@@ -59,9 +66,7 @@ def main():
     for app in apps:
 
         skip = False
-        if options.package and app['id'] != options.package:
-            skip = True
-        elif app['Disabled']:
+        if app['Disabled']:
             print "Skipping %s: disabled" % app['id']
             skip = True
         elif not app['builds']: