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

Submitted by Paul Eggleton on Feb. 14, 2012, 1:44 p.m. | Patch ID: 21265


Message ID aad30e9967067a16b41bf2397b4b5750fa1985a6.1329226937.git.paul.eggleton@linux.intel.com
State Accepted
Commit 4592f238de3fe6b0384c334774be9fcfc0985e4f
Headers show

Commit Message

Paul Eggleton Feb. 14, 2012, 1:44 p.m.
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>
 scripts/combo-layer |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch hide | download patch | download mbox

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)
-        conf.update(name, "last_revision", lastrev)
+        if lastrev != repo['last_revision']:
+            conf.update(name, "last_revision", lastrev)
 def action_splitpatch(conf, args):