From f82983034e63b46fb149f4559bbdfe486f22f520 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Wed, 2 Nov 2011 18:00:07 +0000 Subject: scripts/combo-layer: auto-commit updated config file If the config file is tracked within the combo-layer repository and it is updated at the end of the "update" operation (because last_revision has been changed), then automatically commit the file. This ensures that multiple people can perform updates on different machines without the last revision information going missing. (If the file is outside the repository or is masked via .gitignore, this will do nothing.) (From OE-Core rev: 14f89acb43b0d9bec09b94668fbb056c7b5b1456) Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- scripts/combo-layer | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'scripts/combo-layer') diff --git a/scripts/combo-layer b/scripts/combo-layer index f3480dc..e2b180d 100755 --- a/scripts/combo-layer +++ b/scripts/combo-layer @@ -230,6 +230,18 @@ def action_update(conf, args): action_apply_patch(conf, args) runcmd("rm -rf %s" % patch_dir) + # Step 7: commit the updated config file if it's being tracked + relpath = os.path.relpath(conf.conffile) + try: + output = runcmd("git status --porcelain %s" % relpath) + except: + # Outside the repository + output = None + if output: + logger.info("Committing updated configuration file") + if output.lstrip().startswith("M"): + runcmd('git commit -m "Automatic commit to update last_revision" %s' % relpath) + def action_apply_patch(conf, args): """ apply the generated patch list to combo repo -- cgit v1.1