chiark / gitweb /
rewritemeta: add -p option to specify package
authorTias Guns <tias@ulyssis.org>
Sun, 11 Mar 2012 21:35:17 +0000 (21:35 +0000)
committerTias Guns <tias.guns@cs.kuleuven.be>
Sun, 11 Mar 2012 23:17:45 +0000 (23:17 +0000)
useful if you're only working on a few packages and 'rewritemetadata' would make your working tree dirty

fdroidserver/rewritemeta.py

index 347493bdaf17ce487e8540451e8bbf2dda6e53a1..3ec57714ccc5772d23d3c1f9cebec211ea727a1b 100644 (file)
@@ -36,11 +36,20 @@ def main():
     parser = OptionParser()
     parser.add_option("-v", "--verbose", action="store_true", default=False,
                       help="Spew out even more information than normal")
+    parser.add_option("-p", "--package", default=None,
+                      help="Build only the specified package")
     (options, args) = parser.parse_args()
 
     # 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)
+
     for app in apps:
         print "Writing " + app['id']
         common.write_metadata(os.path.join('metadata', app['id']) + '.txt', app)