]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts/combo-layer: avoid saving last revision if unchanged
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Tue, 14 Feb 2012 13:44:05 +0000 (13:44 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 21 Feb 2012 14:55:51 +0000 (14:55 +0000)
If we are running an update and the last revision hasn't changed since
the last update, don't write to the configuration file. This avoids
committing the config file with no changes other than spontaneous
reordering of sections, which sometimes occurs due to the behaviour of
the internal dictionary in Python's ConfigParser class. (This can be
fixed properly but the fix is only easy in Python 2.7+ due to the
availability there of the collections.OrderedDict class, and we
currently want to be compatible with 2.6.x as well.)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/combo-layer

index 648dda2349ef6dc85b17c813cec1b1e5361f0a85..0f28cfa375b4b9cc315d10643383e1955d79fa64 100755 (executable)
@@ -268,7 +268,8 @@ def action_apply_patch(conf, args):
                     logger.info("After applying, run this tool again to apply the remaining patches")
                     conf.update(name, "last_revision", lastrev)
                     sys.exit(0)
-        conf.update(name, "last_revision", lastrev)
+        if lastrev != repo['last_revision']:
+            conf.update(name, "last_revision", lastrev)
 
 def action_splitpatch(conf, args):
     """