summaryrefslogtreecommitdiffstats
path: root/scripts
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 14:05:36 +0000
commitf82983034e63b46fb149f4559bbdfe486f22f520 (patch)
tree216297679d53ecba5dccbfcaafdd26487bf11f86 /scripts
parent948d28e80101f26715b67dea169dbbd81dd37f91 (diff)
downloadpoky-f82983034e63b46fb149f4559bbdfe486f22f520.tar.gz
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 <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/combo-layer12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer
index f3480dcf5a..e2b180dc7e 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -230,6 +230,18 @@ def action_update(conf, args):
230 action_apply_patch(conf, args) 230 action_apply_patch(conf, args)
231 runcmd("rm -rf %s" % patch_dir) 231 runcmd("rm -rf %s" % patch_dir)
232 232
233 # Step 7: commit the updated config file if it's being tracked
234 relpath = os.path.relpath(conf.conffile)
235 try:
236 output = runcmd("git status --porcelain %s" % relpath)
237 except:
238 # Outside the repository
239 output = None
240 if output:
241 logger.info("Committing updated configuration file")
242 if output.lstrip().startswith("M"):
243 runcmd('git commit -m "Automatic commit to update last_revision" %s' % relpath)
244
233def action_apply_patch(conf, args): 245def action_apply_patch(conf, args):
234 """ 246 """
235 apply the generated patch list to combo repo 247 apply the generated patch list to combo repo