metadata: rename metafile to metadatapath when it is a path

To keep the code clear, change the code to use separate variables for the
path to the metadata file, and for the file object of the opened metadata.
This commit is contained in:
Hans-Christoph Steiner 2015-08-05 11:37:30 +02:00
parent 285c06d156
commit 6f334558df
3 changed files with 38 additions and 38 deletions

View file

@ -493,14 +493,14 @@ def checkupdates_app(app, first=True):
logging.warn('Invalid auto update mode "' + mode + '" on ' + app['id'])
if commitmsg:
metafile = os.path.join('metadata', app['id'] + '.txt')
metadata.write_metadata(metafile, app)
metadatapath = os.path.join('metadata', app['id'] + '.txt')
metadata.write_metadata(metadatapath, app)
if options.commit:
logging.info("Commiting update for " + metafile)
logging.info("Commiting update for " + metadatapath)
gitcmd = ["git", "commit", "-m", commitmsg]
if 'auto_author' in config:
gitcmd.extend(['--author', config['auto_author']])
gitcmd.extend(["--", metafile])
gitcmd.extend(["--", metadatapath])
if subprocess.call(gitcmd) != 0:
logging.error("Git commit failed")
sys.exit(1)