[gnome-continuous-yocto/gnomeostree-3.28-rocko: 1767/8267] buildhistory: output package variables in a repeatable order



commit 95403e3ecd6dde3816c6ec19643075106d6562d0
Author: Ross Burton <ross burton intel com>
Date:   Mon Aug 8 14:01:45 2016 +0100

    buildhistory: output package variables in a repeatable order
    
    This code was outputting variables by iterating a dictionary.  In Py2 this
    always results in the same iteration order but with Py3 the order changes every
    execution, which resulted in buildhistory having to store diffs where fields
    were simply re-ordered.
    
    (From OE-Core rev: f9faa8df85317d12743134a44576b4882a9fb22a)
    
    Signed-off-by: Ross Burton <ross burton intel com>
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 meta/classes/buildhistory.bbclass |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 2db9145..6e5de0e 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -318,16 +318,14 @@ def write_pkghistory(pkginfo, d):
         f.write(u"PV = %s\n" %  pkginfo.pv)
         f.write(u"PR = %s\n" %  pkginfo.pr)
 
-        pkgvars = {}
-        pkgvars['PKG'] = pkginfo.pkg if pkginfo.pkg != pkginfo.name else ''
-        pkgvars['PKGE'] = pkginfo.pkge if pkginfo.pkge != pkginfo.pe else ''
-        pkgvars['PKGV'] = pkginfo.pkgv if pkginfo.pkgv != pkginfo.pv else ''
-        pkgvars['PKGR'] = pkginfo.pkgr if pkginfo.pkgr != pkginfo.pr else ''
-        for pkgvar in pkgvars:
-            val = pkgvars[pkgvar]
-            if val:
-                f.write(u"%s = %s\n" % (pkgvar, val))
-
+        if pkginfo.pkg != pkginfo.name:
+            f.write(u"PKG = %s\n" % pkginfo.pkg)
+        if pkginfo.pkge != pkginfo.pe:
+            f.write(u"PKGE = %s\n" % pkginfo.pkge)
+        if pkginfo.pkgv != pkginfo.pv:
+            f.write(u"PKGV = %s\n" % pkginfo.pkgv)
+        if pkginfo.pkgr != pkginfo.pr:
+            f.write(u"PKGR = %s\n" % pkginfo.pkgr)
         f.write(u"RPROVIDES = %s\n" %  pkginfo.rprovides)
         f.write(u"RDEPENDS = %s\n" %  pkginfo.rdepends)
         f.write(u"RRECOMMENDS = %s\n" %  pkginfo.rrecommends)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]