From patchwork Mon Aug 8 19:40:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 73465 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp135288qga; Mon, 8 Aug 2016 12:40:54 -0700 (PDT) X-Received: by 10.98.86.85 with SMTP id k82mr166854706pfb.82.1470685254372; Mon, 08 Aug 2016 12:40:54 -0700 (PDT) Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id y87si38380286pfd.127.2016.08.08.12.40.53; Mon, 08 Aug 2016 12:40:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Received: from layers.openembedded.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 2521F771CA; Mon, 8 Aug 2016 19:40:40 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by mail.openembedded.org (Postfix) with ESMTP id BCAE1771B2 for ; Mon, 8 Aug 2016 19:40:38 +0000 (UTC) Received: by mail-wm0-f51.google.com with SMTP id f65so135835150wmi.0 for ; Mon, 08 Aug 2016 12:40:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=8muTSKLseTsEIvUXHsY+h49NsnPZAGv06wdXJ7SHyL4=; b=d2R82BJYg7vVPKFiH9xVD7KnnzB+5fdCh1uLRwD/Hs7wBQlwLCIDzIc4Weyns9qwwn c2gb7vcVfIC3oEf0eDpCdHjhdJQHlh4oIgb5uLLYaOtDSUWKCc7Bk2AHwVAZg4Cl3Hwe k/8cQHMh3x8nTxDGJXhLve1CgGaT4+NawaxVQ452pDWoDECbtwDtM1n2Fn3vqopjAHWD S7SDPoXkaPR7iT5DeOkplSbOX/vYbk+W6ajsljpKH+xz7c5rLqhdqbRFKc54R30gTAua gYWxi/6NcCco4Ji3XfbSCnJ7dyvd3BJWlclc+LyOZpoQSpDoS7GAtIMu/77feo+ai/cJ Wpsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=8muTSKLseTsEIvUXHsY+h49NsnPZAGv06wdXJ7SHyL4=; b=e8MQRR2AHuS0GNr8qQn46zEj5xL88LxR7PEKokS0tcwqOsQx6teG0nxvUBy4SuGyu6 D1RrQ+nTtot1s8m3QH9IKSypLVSHOviwtFtFV8MpRAoWCyEvIDrHh4HMczmT47iyGZl8 /kq6v9J11FKtplXQd2XPpNURikrRp5TWtJiCkuAL2U8AMXw+WkdCLmTxn8SI0+I5w883 k/TCwJ8ae2WJ2J94DktNuVwHSX15QEeJXe3Yfw8fg1jyZmReCUlo7gG4N50gHY6dkPbZ KzuJPYR7v6TkZIsW9GpNzV+azicwCVWytLKZAhD4jEkiSG3ZJ8Ma9Dq5mY4kiUwPGAkH n6KQ== X-Gm-Message-State: AEkooutUqhr+RXf9pQKgF6xxet8Gg1SGny9aKQP2cN2HEwRIb25R93L9FO/pwM6qc3GfVLcl X-Received: by 10.28.32.77 with SMTP id g74mr16673614wmg.45.1470685238265; Mon, 08 Aug 2016 12:40:38 -0700 (PDT) Received: from flashheart.burtonini.com (home.burtonini.com. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id kq2sm34392789wjc.41.2016.08.08.12.40.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Aug 2016 12:40:37 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Mon, 8 Aug 2016 20:40:34 +0100 Message-Id: <1470685234-21936-1-git-send-email-ross.burton@intel.com> X-Mailer: git-send-email 2.8.1 Subject: [OE-core] [PATCH] buildhistory: output package variables in a repeatable order X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org 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. Signed-off-by: Ross Burton --- meta/classes/buildhistory.bbclass | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) -- 2.8.1 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core 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)