summaryrefslogtreecommitdiff
path: root/scripts/combo-layer
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2011-11-02 18:00:07 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-07 13:58:39 +0000
commit14f89acb43b0d9bec09b94668fbb056c7b5b1456 (patch)
tree7c5b6755563adf882fbba87d12a5d0f25627974b /scripts/combo-layer
parentf03fa8bbafa82ce6b09c08bf86011b6c51eb3531 (diff)
downloadopenembedded-core-14f89acb43b0d9bec09b94668fbb056c7b5b1456.tar.gz
openembedded-core-14f89acb43b0d9bec09b94668fbb056c7b5b1456.tar.bz2
openembedded-core-14f89acb43b0d9bec09b94668fbb056c7b5b1456.tar.xz
openembedded-core-14f89acb43b0d9bec09b94668fbb056c7b5b1456.zip
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.) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'scripts/combo-layer')
-rwxr-xr-xscripts/combo-layer12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer
index f3480dcf5..e2b180dc7 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