chiark / gitweb /
Addition to update.py to make version updating easier
authorCiaran Gultnieks <ciaran@ciarang.com>
Tue, 19 Apr 2011 21:23:13 +0000 (22:23 +0100)
committerCiaran Gultnieks <ciaran@ciarang.com>
Tue, 19 Apr 2011 21:23:13 +0000 (22:23 +0100)
Adds a --update switch which runs the given command for each metadata
file where there appears to be a newer version than we have. For
example, I do "update.py -u vim".

update.py

index 61598d0146a0050c3e61addeb7ffeb8686c802dd..bd7e0acf49bcd8376e460c057df18a2b48b143c5 100755 (executable)
--- a/update.py
+++ b/update.py
@@ -47,6 +47,9 @@ parser.add_option("-q", "--quiet", action = "store_true", default=False,
                   help="No output, except for warnings and errors")
 parser.add_option("-b", "--buildreport", action="store_true", default=False,
                   help="Report on build data status")
+parser.add_option("-u", "--update", default=None,
+                  help="Run the specified command for each metadata file "+
+                       "that needs updating")
 (options, args) = parser.parse_args()
 
 
@@ -400,6 +403,9 @@ for app in apps:
                 for apk in apks:
                     if apk['id'] == app['id']:
                         print "           " + str(apk['versioncode']) + " - " + apk['version']
+            if options.update != None:
+                subprocess.call([options.update, os.path.join('metadata',
+                    app['id'] + '.txt')])
 
     else:
         apps_disabled += 1