[oe-commits] Paul Eggleton : scripts/combo-layer: avoid saving last revision if unchanged

git at git.openembedded.org git at git.openembedded.org
Tue Feb 21 15:00:40 UTC 2012


Module: openembedded-core.git
Branch: master
Commit: 4592f238de3fe6b0384c334774be9fcfc0985e4f
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=4592f238de3fe6b0384c334774be9fcfc0985e4f

Author: Paul Eggleton <paul.eggleton at linux.intel.com>
Date:   Tue Feb 14 13:44:05 2012 +0000

scripts/combo-layer: avoid saving last revision if unchanged

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 at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 scripts/combo-layer |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/scripts/combo-layer b/scripts/combo-layer
index 648dda2..0f28cfa 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -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):
     """





More information about the Openembedded-commits mailing list