1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-14 11:00:10 +01:00

--auto --commit now behaves like fd-commit, consistency

This commit is contained in:
Daniel Martí 2013-10-31 18:20:45 +01:00
parent 341fc6657a
commit 8a6267b126

View File

@ -400,8 +400,9 @@ def main():
if updating: if updating:
print '...updating to version %s (%s)' % (app['Current Version'], app['Current Version Code']) print '...updating to version %s (%s)' % (app['Current Version'], app['Current Version Code'])
name = str('%s (%s)' % (app['Auto Name'], app['id']) if app['Auto Name'] else app['id']) name = '%s (%s)' % (app['Auto Name'], app['id']) if app['Auto Name'] else app['id']
logmsg = 'Update current version of %s to %s (%s)' % (name, app['Current Version'], app['Current Version Code']) ver = "%s (%s)" % (app['Current Version'], app['Current Version Code'])
logmsg = 'Update CV of %s to %s' % (name, ver)
if options.auto: if options.auto:
mode = app['Auto Update Mode'] mode = app['Auto Update Mode']
@ -434,7 +435,9 @@ def main():
newbuild['commit'] = commit newbuild['commit'] = commit
app['builds'].append(newbuild) app['builds'].append(newbuild)
writeit = True writeit = True
logmsg = "Update " + app['id'] + " to " + newbuild['version'] name = "%s (%s)" % (app['Auto Name'], app['id']) if app['Auto Name'] else app['id']
ver = "%s (%s)" % (newbuild['version'], newbuild['vercode'])
logmsg = "Update %s to %s" % (name, ver)
else: else:
print 'Invalid auto update mode' print 'Invalid auto update mode'
@ -443,10 +446,8 @@ def main():
common.write_metadata(metafile, app) common.write_metadata(metafile, app)
if options.commit and logmsg: if options.commit and logmsg:
print "Commiting update for " + metafile print "Commiting update for " + metafile
if subprocess.call("git add " + metafile, shell=True) != 0: if subprocess.call(["git", "commit", "-m",
print "Git add failed" "'"+logmsg.replace("'", "\\'")+"'", "--", metafile]) != 0:
sys.exit(1)
if subprocess.call("git commit -m '" + logmsg.replace("'", "\\'") + "'", shell=True) != 0:
print "Git commit failed" print "Git commit failed"
sys.exit(1) sys.exit(1)