summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2016-08-08 14:01:45 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-10 10:46:32 +0100
commit95403e3ecd6dde3816c6ec19643075106d6562d0 (patch)
tree7a5cc3a4f7b3776bf0984487d28c71472f48795a /meta
parent7b33b23d0ee170ea0ff3a3b102b9fc1c3ef17cbe (diff)
downloadpoky-95403e3ecd6dde3816c6ec19643075106d6562d0.tar.gz
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>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/buildhistory.bbclass18
1 files changed, 8 insertions, 10 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 2db9145abd..6e5de0ef69 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -318,16 +318,14 @@ def write_pkghistory(pkginfo, d):
318 f.write(u"PV = %s\n" % pkginfo.pv) 318 f.write(u"PV = %s\n" % pkginfo.pv)
319 f.write(u"PR = %s\n" % pkginfo.pr) 319 f.write(u"PR = %s\n" % pkginfo.pr)
320 320
321 pkgvars = {} 321 if pkginfo.pkg != pkginfo.name:
322 pkgvars['PKG'] = pkginfo.pkg if pkginfo.pkg != pkginfo.name else '' 322 f.write(u"PKG = %s\n" % pkginfo.pkg)
323 pkgvars['PKGE'] = pkginfo.pkge if pkginfo.pkge != pkginfo.pe else '' 323 if pkginfo.pkge != pkginfo.pe:
324 pkgvars['PKGV'] = pkginfo.pkgv if pkginfo.pkgv != pkginfo.pv else '' 324 f.write(u"PKGE = %s\n" % pkginfo.pkge)
325 pkgvars['PKGR'] = pkginfo.pkgr if pkginfo.pkgr != pkginfo.pr else '' 325 if pkginfo.pkgv != pkginfo.pv:
326 for pkgvar in pkgvars: 326 f.write(u"PKGV = %s\n" % pkginfo.pkgv)
327 val = pkgvars[pkgvar] 327 if pkginfo.pkgr != pkginfo.pr:
328 if val: 328 f.write(u"PKGR = %s\n" % pkginfo.pkgr)
329 f.write(u"%s = %s\n" % (pkgvar, val))
330
331 f.write(u"RPROVIDES = %s\n" % pkginfo.rprovides) 329 f.write(u"RPROVIDES = %s\n" % pkginfo.rprovides)
332 f.write(u"RDEPENDS = %s\n" % pkginfo.rdepends) 330 f.write(u"RDEPENDS = %s\n" % pkginfo.rdepends)
333 f.write(u"RRECOMMENDS = %s\n" % pkginfo.rrecommends) 331 f.write(u"RRECOMMENDS = %s\n" % pkginfo.rrecommends)