From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dan.rpsys.net (5751f4a1.skybroadband.com [87.81.244.161]) by mail.openembedded.org (Postfix) with ESMTP id 2727870031 for ; Mon, 9 May 2016 13:12:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by dan.rpsys.net (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id u49DCMYW016193 for ; Mon, 9 May 2016 14:12:22 +0100 Received: from dan.rpsys.net ([127.0.0.1]) by localhost (dan.rpsys.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ewybE8OD1NTB for ; Mon, 9 May 2016 14:12:22 +0100 (BST) Received: from hex ([192.168.3.34]) (authenticated bits=0) by dan.rpsys.net (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id u49DCGnS016184 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 9 May 2016 14:12:17 +0100 Message-ID: <1462799536.21831.140.camel@linuxfoundation.org> From: Richard Purdie To: openembedded-core Date: Mon, 09 May 2016 14:12:16 +0100 X-Mailer: Evolution 3.16.5-1ubuntu3.1 Mime-Version: 1.0 Subject: [PATCH] update-alternatives: Fix determinism issue 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: , X-List-Received-Date: Mon, 09 May 2016 13:12:28 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit getVarFlags returns a dict and there is therefore no sort order. This means the order of the X_VARDEPS_X variables can change and hence the task checksums can change. This can lead to rebuilds of any parts of the system using update-alternatives and their dependees. This is a particular issue under python v3. Add in a sort to make the order of the variables deterministic. Signed-off-by: Richard Purdie diff --git a/meta/classes/update-alternatives.bbclass b/meta/classes/update-alternatives.bbclass index 70a8185..1fdd681 100644 --- a/meta/classes/update-alternatives.bbclass +++ b/meta/classes/update-alternatives.bbclass @@ -71,14 +71,14 @@ def gen_updatealternativesvardeps(d): # First compute them for non_pkg versions for v in vars: - for flag in (d.getVarFlags(v) or {}): + for flag in sorted((d.getVarFlags(v) or {}).keys()): if flag == "doc" or flag == "vardeps" or flag == "vardepsexp": continue d.appendVar('%s_VARDEPS' % (v), ' %s:%s' % (flag, d.getVarFlag(v, flag, False))) for p in pkgs: for v in vars: - for flag in (d.getVarFlags("%s_%s" % (v,p)) or {}): + for flag in sorted((d.getVarFlags("%s_%s" % (v,p)) or {}).keys()): if flag == "doc" or flag == "vardeps" or flag == "vardepsexp": continue d.appendVar('%s_VARDEPS_%s' % (v,p), ' %s:%s' % (flag, d.getVarFlag('%s_%s' % (v,p), flag, False))) -- cgit v0.10.2