Thread (6 messages) 6 messages, 2 authors, 2012-02-21
STALE5237d
Revisions (2)
  1. v1 current
  2. v1 [diff vs current]

[PATCH 3/4] scripts/combo-layer: avoid saving last revision if unchanged

From: Paul Eggleton <hidden>
Date: 2012-02-14 13:52:28
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 scripts/combo-layer |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/scripts/combo-layer b/scripts/combo-layer
index 8fb27f6..7457ba2 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -283,7 +283,8 @@ def apply_patchlist(conf, repos):
                     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):
     """
-- 
1.7.5.4


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help