From patchwork Thu Aug 13 12:48:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 95086 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A69AC5CFEB for ; Thu, 13 Aug 2026 12:48:42 +0000 (UTC) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.18285.1786625318989385700 for ; Thu, 13 Aug 2026 05:48:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=AyBi8dlJ; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.42, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-47db714766aso547881f8f.0 for ; Thu, 13 Aug 2026 05:48:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1786625317; x=1787230117; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=gpWXLK9Jg20sWquk/z2KwTUPYeWOiL6yqMQ40E+L4oM=; b=AyBi8dlJvQ6RoIo3dv435JF53p/K1OzDJk0OZ2JiXRSq1ANId8GSRJGCiPDRAOY3ky hy9fiwuv4/gF6pZ1woI2z8nZhxVNro/GfRhKGor2bohgIeODGvQ+WBcMvu2X04pCOSNh 7D822fYLU51KsTfkRFqJEhbpd8x6mBH1R+gT8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786625317; x=1787230117; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=gpWXLK9Jg20sWquk/z2KwTUPYeWOiL6yqMQ40E+L4oM=; b=jrPNmQ1IJnT8RmZ9fucnAAjRwQDiIO8N/veo3G+v4L6LwduLFI9reXJY4CwsgyNcPf Ti7cTC4cxPwRuVHhVxSoSDF/n4w4oP3G1lGC5Zi3/4GgK2yq8D0yZES2kvE0Tggr0odR 7c9HTpnjzm59tiNLPqyl/0FID75QTohvWL4bLEP85w4oZ7DVikeNqUZk862HlP6+hl5l MBNmhKCIM0MSh7A/WM2OyS3bB3C27D6LDDEs/t5xYJThjylj7vm7IfmQOiJ109tDqm7I QsxRx/0IuYh4+y0ryZ7JKO1ct1zJq7wpORAafX4BiRtnon5FQAo3300whB8NzzVfg9Dr HwMQ== X-Gm-Message-State: AOJu0YwA6MpOHx5q1MesrK4INRbDvpyxYjOxkere7MwCCQaHF/vnuhHZ 3Ofit7pSgu6NzsaDEc/e2SMI3Cw8TSXPYD+NXKPRMGaG/0JxkWG3uJtEgr2iDXTkbP2eRR/tBHO zpwKUg1E= X-Gm-Gg: AR+sD11Stjegd+dXDtcaqlMwLMWn2IfkmjvWwgUCUgXgkmMLSqUSxjYYUO0M0Px/H5y 91OdEedhMkH4evnMImdoOWvvwDt0bu2+HJQ5fAo2THlrChp9QKh6nmTqh5iEG/bDuOkh6w5h5pe ravgI41lu6kwn2iQtxXVI5ax8BxPbrNfi6UqsjG5jxCsQm3XMAoBnmbM4RVnYbpVw4vsUoqFE5p 7+oiPOT4lYm1DGpgUmMzrfyaRKjyZo9+7WRiEnV4a26Ng2A6uDfK9FfCWe3IqZctoIy4LcfGVcm Gw0quOJtLTnwTVIVqi/fSAdayDUjUFXEt+VMM2S0b6SdHkifpDXt2nOoBL0UO+e41yUdOSN34vx WEo8e1RiASkvaj1C/dSnLEFJy03cOivU5zePTUkLLPmQvdHtOHNI4x9hNFp2V0smujqXwU6RFIW 0wG+BPtQ6h2isxZEZZ75DwT9kMVF1gG/SbmLXhedQBb6YmzXf6I0ITxRhGWXOXhJxcQULnaxgpr 1QCP9yjuiQ7gmThgg== X-Received: by 2002:a05:6000:2c0e:b0:481:314b:b041 with SMTP id ffacd0b85a97d-4815a5c9325mr7283285f8f.7.1786625316712; Thu, 13 Aug 2026 05:48:36 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:e77b:339c:e0c2:6c8d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4815a5b6616sm6685768f8f.25.2026.08.13.05.48.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2026 05:48:35 -0700 (PDT) From: Richard Purdie To: bitbake-devel@lists.openembedded.org Subject: [PATCH 1/6] fetch/__init__: Clean up minor mirror code duplication Date: Thu, 13 Aug 2026 13:48:29 +0100 Message-ID: <20260813124834.1770307-1-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 13 Aug 2026 12:48:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19923 The mirror_from_string calls can be in try_mirror along with the debug logging. Signed-off-by: Richard Purdie --- lib/bb/fetch2/__init__.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py index ea007f36816..604208c2c82 100644 --- a/lib/bb/fetch2/__init__.py +++ b/lib/bb/fetch2/__init__.py @@ -1183,15 +1183,18 @@ def try_mirror_url(fetch, origud, ud, ld, check = False): if ud.lockfile and ud.lockfile != origud.lockfile: bb.utils.unlockfile(lf) -def try_mirrors(fetch, d, origud, mirrors, check = False): +def try_mirrors(fetch, d, origud, mirrorvar, check = False): """ Try to use a mirrored version of the sources. This method will be automatically called before the fetchers go. d Is a bb.data instance uri is the original uri we're trying to download - mirrors is the list of mirrors we're going to try + mirrorvar is variable name that contains the list of mirrors we're going to try """ + logger.debug("Trying mirrors in %s" % mirrorvar) + mirrors = mirror_from_string(d.getVar(mirrorvar)) + ld = d.createCopy() uris, uds = build_mirroruris(origud, mirrors, ld) @@ -1716,11 +1719,11 @@ class FetchMethod(object): """ return True - def try_mirrors(self, fetch, urldata, d, mirrors, check=False): + def try_mirrors(self, fetch, urldata, d, mirrorvar, check=False): """ Try to use a mirror """ - return bool(try_mirrors(fetch, d, urldata, mirrors, check)) + return bool(try_mirrors(fetch, d, urldata, mirrorvar, check)) def checkstatus(self, fetch, urldata, d): """ @@ -1921,9 +1924,7 @@ class Fetch(object): if m.verify_donestamp(ud, self.d) and not m.need_update(ud, self.d): done = True elif m.try_premirror(ud, self.d): - logger.debug("Trying PREMIRRORS") - mirrors = mirror_from_string(self.d.getVar('PREMIRRORS')) - done = m.try_mirrors(self, ud, self.d, mirrors) + done = m.try_mirrors(self, ud, self.d, 'PREMIRRORS') if done: try: # early checksum verification so that if the checksum of the premirror @@ -1975,9 +1976,7 @@ class Fetch(object): # Remove any incomplete fetch if not verified_stamp and m.cleanup_upon_failure(): m.clean(ud, d) - logger.debug("Trying MIRRORS") - mirrors = mirror_from_string(d.getVar('MIRRORS')) - done = m.try_mirrors(self, ud, d, mirrors) + done = m.try_mirrors(self, ud, d, 'MIRRORS') if not done or not m.done(ud, d): if firsterr: @@ -2027,14 +2026,13 @@ class Fetch(object): logger.debug("Testing URL %s", u) # First try checking uri, u, from PREMIRRORS mirrors = mirror_from_string(self.d.getVar('PREMIRRORS')) - ret = m.try_mirrors(self, ud, self.d, mirrors, True) + ret = m.try_mirrors(self, ud, self.d, 'PREMIRRORS', True) if not ret: # Next try checking from the original uri, u ret = m.checkstatus(self, ud, self.d) if not ret: # Finally, try checking uri, u, from MIRRORS - mirrors = mirror_from_string(self.d.getVar('MIRRORS')) - ret = m.try_mirrors(self, ud, self.d, mirrors, True) + ret = m.try_mirrors(self, ud, self.d, 'MIRRORS', True) if not ret: raise FetchError("URL doesn't work", u) From patchwork Thu Aug 13 12:48:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 95085 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75836C5DF66 for ; Thu, 13 Aug 2026 12:48:42 +0000 (UTC) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.18130.1786625319966883812 for ; Thu, 13 Aug 2026 05:48:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=aad5nu9x; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.48, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-4813ea321cdso603198f8f.1 for ; Thu, 13 Aug 2026 05:48:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1786625318; x=1787230118; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=5bKzIS7uiPiHMh1413O3cJUYz2vgckZ4OdATy8Xb9TY=; b=aad5nu9x7sM+SQJ+EyOuhTyTY9RxxzGC4hUDkVLTKz1YZM4EdbebeTGoVwIFNUXXNQ P/uoqw1ALAsJNU9ZOHbY9CqamvDutiFYV7+Xvly83dhq4+geWRIYGoRWlmfFB1eBxASh MC8G+orwtYpmBC+dP3Ffp2AsqDxLpL5Cn3/yQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786625318; x=1787230118; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=5bKzIS7uiPiHMh1413O3cJUYz2vgckZ4OdATy8Xb9TY=; b=Km8YrVEfvf+OWKkJhGhPSfYob7ZQhAcf5xz4S4SZhUFwqSpgmvIPxcoVaoXRKXj2Pb NeuLmhnjd4//wftqBsL4TDJ61W6abyDeVYnohzOhOVTEnMvJ27v/5R9cc7la1haqU1xq 79pAq/BxJXjdNF+lI2YFMJ7SkPhstabK5IXoI3GZtvsAUfTSXufTheRqzGcTwBcDt0/j n9vm2jtF8KEjCoge35kl6bZERN11whMQkdyYdWHQxqq5ty5LjM7vhBMqkLCGZ+OmbbsR E40UhTSpMbMau81pQctQAbZK09009+rR3Cu27V89jDfFKVVjh1dl8OqLE4LzL8NfI9wM h68w== X-Gm-Message-State: AOJu0YwbdNOrSanjBbtmUuzU3HHIbZ1dEwlUlK+kTQqSlEcP792NOkAB +BpCddeJveUuJz+PAdtjSEgXRkHYKc0AaWpes033ETKhJn9/xC9+DcaSPo7QpQQOZaY9WkwxHsC G1JDVlFQ= X-Gm-Gg: AR+sD120U23hyaUh1hHEWBYzYEuSxU8GFOcmTe7dwvyABEZZSwqQv5/rrU85aIkwBW1 mg1dpkmevYHYNYlTHI8DlmLdfQQuUWyyB0E40ugiYN2IYNZHZITX4p0ieyW7zQPuYMyfX3NTVe9 OcSAIcfEyUnSzi2UXVm52/8+DWxcGcSCtqp77gmywuABXTKHcOq4XLcwa3OuPsOtof6efVSAwEH b/gIZXSG4kmBPNjK50Ir6XVxp9nUDNYbugxqejpEyAWoBfnmzJ9gGZDAtJxclXXqiEAvWQOO5aM 8O6SW6SZ3vNhKgCWkjmvYuVMH0Q3oaHKeg5X5l+xZy0k3FW/Ulanh/p4cNFqQMROL8n3qtCkINy 3oIZAlYIiAC/jxeTwJwvEv3yCmK1+Beuatmvslx2IUXg3EZd7HKQcd1aM0OUv6VP/VacDxWwxzZ vKcj7xYljgR2sNVQPVyLc4Dnx/6NGYKI+vHPPDhQ+CwmGpzxv0X/25cn3N0BXnDQMKCK7Vxu4vD naajScH0+C9YyKp5g== X-Received: by 2002:a5d:584e:0:b0:481:57de:df20 with SMTP id ffacd0b85a97d-4815a5436ffmr6764125f8f.15.1786625318007; Thu, 13 Aug 2026 05:48:38 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:e77b:339c:e0c2:6c8d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4815a5b6616sm6685768f8f.25.2026.08.13.05.48.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2026 05:48:37 -0700 (PDT) From: Richard Purdie To: bitbake-devel@lists.openembedded.org Subject: [PATCH 2/6] fetch2: Drop unneeded checksum check Date: Thu, 13 Aug 2026 13:48:30 +0100 Message-ID: <20260813124834.1770307-2-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260813124834.1770307-1-richard.purdie@linuxfoundation.org> References: <20260813124834.1770307-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 13 Aug 2026 12:48:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19924 This was added in 022adb30dbb0df764c9fb515918cb9a88e4f8d6f however the checksum exception is now correctly handled in try_mirror_url so this code block is just duplication and not needed anymore. Signed-off-by: Richard Purdie --- lib/bb/fetch2/__init__.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py index 604208c2c82..51db8304c65 100644 --- a/lib/bb/fetch2/__init__.py +++ b/lib/bb/fetch2/__init__.py @@ -1925,15 +1925,6 @@ class Fetch(object): done = True elif m.try_premirror(ud, self.d): done = m.try_mirrors(self, ud, self.d, 'PREMIRRORS') - if done: - try: - # early checksum verification so that if the checksum of the premirror - # contents mismatch the fetcher can still try upstream and mirrors - m.update_donestamp(ud, self.d) - except ChecksumError as e: - logger.warning("Checksum failure encountered with premirror download of %s - will attempt other sources." % u) - logger.debug(str(e)) - done = False d = self.d if premirroronly: From patchwork Thu Aug 13 12:48:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 95087 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89C66C5CFCF for ; Thu, 13 Aug 2026 12:48:42 +0000 (UTC) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.18287.1786625320688963767 for ; Thu, 13 Aug 2026 05:48:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=SnLER6y7; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.49, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-47c2b362ee2so608255f8f.1 for ; Thu, 13 Aug 2026 05:48:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1786625319; x=1787230119; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=7rT1RqIT8yX3AchQLDVJfAbgqaqJmpogUeZbP9TgSno=; b=SnLER6y7VvIVkzpC9gaCEuaFBJsBeoSkjwCWWU8vZp8Z8XNZHY3eggCxeAAYzKjql+ ZTjFGL89XPQMKke+Q5EoE8mvkOV8zEuR0c56Vsqa64IcDgEuJKs0c9kmLUkeJoXK+8XN rkkKsrKue9BmVF/HDaaX22nDSb3pb5CAulpvg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786625319; x=1787230119; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=7rT1RqIT8yX3AchQLDVJfAbgqaqJmpogUeZbP9TgSno=; b=dP6KZFJcQmH5cK61VvvOUz+9L1X3CGKxTlEP8c5Gu9PeeZaUyqBd2ZZpKvxBaDel3K dTV4HqGApmVnusryDcYFDSn2G0mDevSuYsCiPT7tjU1/aV8BjGYgBTLimUsfsHk2xFaS CsXp0IHSfRAb93joFuqyzuVmtM6d3CjgrKKWGzWZar8Bi2cJw5sDXkfv78zS5gWxgd4Q KBaHIyTHrB0ShwIx7xK9A6pYy2SEev3JqFEqCj5t11PhRVsS3hkOtLOf46+YcKKHAmEh mpnQ2dve/XOHDBYDFaabVtk5FEs33F+e1BRwSoVwgbFvhL/xo4SHxJaQ0wUEsg3JxFpi ff0g== X-Gm-Message-State: AOJu0YyUws5FsPPRkBHXivkCpOeO3KUFchF9hAO1kl00vcCda6IwzaNa PCplOMFAwmj+J/vo2q5nXYhvyoSPO9rRURzXxyi5Ta8JS5f7RWP7RL/9wF3UbuTQFu/P+TGTfYh 7vsBx43o= X-Gm-Gg: AR+sD10nQKt3BZUbCK2GVhYfbX3vizWkHH0yuCBARODi4zJEkyaweVlrX9qshrP1IU/ XCoIT+2PZoxVYgQIUyWcjo/uAMmbJ7rrX0wADOvGZb34PhQHx2Ko1sNTO/1Bvawcn9BFV0+O5jP anCdtTeIallOTav/P4jOHMbCYgC7saaTN+6wvMjYh3M4zz4yL6lDyYIEPT4J7vDQeKLy8KQ6Var IbPFdWBqV9Ttis+IKPLqQSP9w8eFLkaJB/1Puc0gOMNq/WwCOqV4sJgdHp6DgbIYFEZ8Nmxvs2O cLHl4fHezG/3HAE1Eec65issV+yJIruKl7J7PsfVR3RYlNrmt0Sf+SisC+N+4gDWlNf0vqHwdr0 FLmFhZvqb7k+b9Gpudp6Y0pjrQiR7kUmShgvSE4whC1C5/qrQUt5VDIcAdmG6Vktdn34iRLyubp Bz/Vy+tXf+2HSC1zcvYlEgFYV/lGBoGOJhFkcGGFE5+sZAygaK+5kNyxp2nVdNqsvbUj2LnCvo5 GS/xV39yioD67obLQ== X-Received: by 2002:a05:6000:3113:b0:47f:80f0:8d33 with SMTP id ffacd0b85a97d-4815a058652mr7878740f8f.30.1786625318944; Thu, 13 Aug 2026 05:48:38 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:e77b:339c:e0c2:6c8d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4815a5b6616sm6685768f8f.25.2026.08.13.05.48.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2026 05:48:38 -0700 (PDT) From: Richard Purdie To: bitbake-devel@lists.openembedded.org Subject: [PATCH 3/6] fetch2: Drop ESTALE error handling Date: Thu, 13 Aug 2026 13:48:31 +0100 Message-ID: <20260813124834.1770307-3-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260813124834.1770307-1-richard.purdie@linuxfoundation.org> References: <20260813124834.1770307-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 13 Aug 2026 12:48:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19925 This is old code and nobody I've talked to using NFS has seen this. Translating this into a checksum error probably isn't correct, even if we did want to silently handle it. I propose we remove this code and see if anyone des really need something like this, if so, writing it correctly without the ChecksumError usage. Signed-off-by: Richard Purdie --- lib/bb/fetch2/__init__.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py index 51db8304c65..2676e0962b9 100644 --- a/lib/bb/fetch2/__init__.py +++ b/lib/bb/fetch2/__init__.py @@ -1156,12 +1156,6 @@ def try_mirror_url(fetch, origud, ud, ld, check = False): except bb.fetch2.NetworkAccess: raise - except IOError as e: - if e.errno in [errno.ESTALE]: - logger.warning("Stale Error Observed %s." % ud.url) - return False - raise - except bb.fetch2.BBFetchException as e: if isinstance(e, ChecksumError): logger.warning("Mirror checksum failure for url %s (original url: %s)\nCleaning and trying again." % (ud.url, origud.url)) @@ -1976,12 +1970,6 @@ class Fetch(object): m.update_donestamp(ud, d) - except IOError as e: - if e.errno in [errno.ESTALE]: - logger.error("Stale Error Observed %s." % u) - raise ChecksumError("Stale Error Detected") - raise - except BBFetchException as e: if isinstance(e, NoChecksumError): (message, _) = e.args From patchwork Thu Aug 13 12:48:32 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 95088 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 972C2C5DF67 for ; Thu, 13 Aug 2026 12:48:42 +0000 (UTC) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.18288.1786625321661372253 for ; Thu, 13 Aug 2026 05:48:41 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=ZIfxToFf; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.46, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-47f3b39f2a1so1920391f8f.2 for ; Thu, 13 Aug 2026 05:48:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1786625320; x=1787230120; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=uqompJTxlFaD8h+sxVr2B+BvQk2DgizptmZDTlPv1no=; b=ZIfxToFfzs5cVitu7vHaG1pc3OExqIi03MwCcmARvfpDfYNUYL/L05/Ptn4cwA02Jm Y7BrwxfvRE7vGh43sQX5eYGxI86YVTbZb9VJAKPfH7UfFJWzQE8tP7zduXZZeVFKMobu jYvOGs/lh5SHaj5+/xwbtragXkFAGm/mWc44s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786625320; x=1787230120; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=uqompJTxlFaD8h+sxVr2B+BvQk2DgizptmZDTlPv1no=; b=B4CmnIkWZKCREp4OX1deKIY4bR7NFQ4UnSa+rdq7d2jeh2o1gP22QwoUF3SCqdtq44 B/y0dgRnY1B3MLZIG/o+bMY6vKkEAFDCQ/g+qHXrnynKClSrWqIXNMIX7/Pm44snVVbF vMhSHdVp/+0kaboRo+VgVYshP5VAUmcSNyNFAVZux13nCcqIQNjFsvLi3NeyYb5Ki/xG bCWKle6Td+VnJpOR8sfZ+vdcfoW58AdGu9DPrXvV8Vq4Fyed83zk6b0WRq4nyCTXUDlY 9BLFhbDGirIvMqVzrh3zgTCD6+TC3uYbEKvV0EcLXF7b/+carfPHD16lOD4Blk5scWYg YDuQ== X-Gm-Message-State: AOJu0YzbgKl9ZWKFFO0ob7QD4igwbLL02YVsTvBiGK5DyqgSV4OwBTxk 1P0StlSqipdYExdUVf+O2nNWvq41KwgmLc7zkpLnpOJAUw09EoOMwBHGf4V0SaR33t5n437abEv 8ejfPF8w= X-Gm-Gg: AR+sD10IttSCL0kZnZnFo5yAGWMLwoyfn1ZrLnwOvGrLUdRaf/Jf6139KAE5q5gNgsa V7tfisJzwTQNTLompd0i0Hu9VCjPgl4lqWAdFCsAqlVwQMl3BPKLXTVSnZI+MimUlE+jGDhEROz 3Ao6zL2u51SW9wmFyktm+TVwu+qrINnLpGJZmchdtk4S9tBnaO8zTW55gIU6YfA2jzQAYxfmsog aXtlb8myX22jMOkUZYOXN5dAfphubFTFkLuS4npZGNA9/16UXHY6DXPJTNYLh4Csx9NhSIeaPCH sX7zu+T7CDz2MJ0YDIoMIIht9usU+wxNHGOC+m514U+e4hbMUu35hlDgCIw5xZAvWWPxQOLNDDU ttBAVtflNQlv6XDSCeKtJRpUnLZUjWZ4LRINFQ+Ki8x+y+IdesFr1Wf1HhgVl5id6N8nkd5daz/ E9rRfzl+mHOK+nMuBqRNJ0ibcgoZR1WCpBA4V1XykZDZ3Hk+JkA5J20ckwhPWv/hcM+p7/GeIaN FNklU/M3W81cWEJNgLsPBGmHk+m X-Received: by 2002:a05:6000:46c4:b0:481:5bce:4485 with SMTP id ffacd0b85a97d-4815bce4854mr3856365f8f.13.1786625319909; Thu, 13 Aug 2026 05:48:39 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:e77b:339c:e0c2:6c8d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4815a5b6616sm6685768f8f.25.2026.08.13.05.48.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2026 05:48:39 -0700 (PDT) From: Richard Purdie To: bitbake-devel@lists.openembedded.org Subject: [PATCH 4/6] utils: Allow lockfile/unlockfile to take empty names Date: Thu, 13 Aug 2026 13:48:32 +0100 Message-ID: <20260813124834.1770307-4-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260813124834.1770307-1-richard.purdie@linuxfoundation.org> References: <20260813124834.1770307-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 13 Aug 2026 12:48:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19926 I've been torn on whether to allow this for a long time. The context manager does allow it and it does allow code simplification if it can just accept no locks are present so on balance, it is probably slightly neater. Signed-off-by: Richard Purdie --- lib/bb/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/bb/utils.py b/lib/bb/utils.py index 8b8d381faa5..92b60b39d2c 100644 --- a/lib/bb/utils.py +++ b/lib/bb/utils.py @@ -529,6 +529,9 @@ def lockfile(name, shared=False, retry=True, block=False): Returns the locked file descriptor in case of success, ``None`` otherwise. """ + if not name: + return None + basename = os.path.basename(name) if len(basename) > 255: root, ext = os.path.splitext(basename) @@ -594,6 +597,9 @@ def unlockfile(lf): No return value. """ + if not lf: + return + try: # If we had a shared lock, we need to promote to exclusive before # removing the lockfile. Attempt this, ignore failures. From patchwork Thu Aug 13 12:48:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 95089 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E320C5CFCF for ; Thu, 13 Aug 2026 12:48:52 +0000 (UTC) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.18132.1786625323017022226 for ; Thu, 13 Aug 2026 05:48:43 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=c+Ch6KLr; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.41, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-47f633e6058so573569f8f.0 for ; Thu, 13 Aug 2026 05:48:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1786625321; x=1787230121; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=YVCEs0Xl7BcbEP+LDjP6IUYst2jpv4xnAZJxMS5M2AU=; b=c+Ch6KLruj6BybWO5tTO2xNOjuHeEL4YAw96KWKcHCBuOP9Jmy+krHeykZYa8OLxe1 z1VS1p57mplW5XNHpiUHn8QDISvUGGuiDaY4hIccknl4BMt1+YYmaV4DXHDPXzV3Vxta An0LYf6uXv7ia5IwbwB/pBkOXhZ+n9ma+SG1k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786625321; x=1787230121; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=YVCEs0Xl7BcbEP+LDjP6IUYst2jpv4xnAZJxMS5M2AU=; b=g+IGgH0ahCL+QMyfad6f3IdcWl1bTpkg3bXTzIuuEO0qnPP8P0wM1IAztfIKHXm7Z7 98XSVl5zUA3lAe+/WMw/HwwdzcGyOrsvvNgw5RQeSyictJF0aghlpnFRhO8G2CplLuLR Ft7oLWk948Z3JmbABUuc5HFOMhkN76jkcLiPQhT/7h8RGZ3lmUCI91SLOgFsCtrp9DE8 AbPhgNzNb/Es61tbn/y2JioLUHbdEaspiaORc2OsYmt5ZRjX+yF8o6f68BDZPMESDO3U j7aeWNQ0n6D18jltrxX2P/fJetucM75OrZf7NJL8aHpmBivY8Z2d/IN04z4f8YKsMSV0 x3hw== X-Gm-Message-State: AOJu0YxwDdpkZHEvYw6L4kNKYeL2DcLZzzeVSBfyUCfeQyf6lAV4D0w1 89K6iBXZl0zb0a+ZLT/VIvJPz7FkXRzyOMqfOcjv6rgSFMELOroYBSDZ6/ZAeQzF87Sbkql2WgM dOdCZEn0= X-Gm-Gg: AR+sD13kiZmfkSTFt5W67fzI2IXqQ+0w3doqkwhjGvQOmjl/rgQ592OSu4/rjgBPBOF qO6FIBxK0m+oBVLieBwohkls5cLUueZCZlqhcYVze3ihk3W70w4Vk0Z+OY/krxtnJG7nvC4s7fw +qJ5rVbiI9Cje4jnJZuZLe2R3vhGYktQazaBrbUs7o4Adg1K0kOE3+z3VC4u1p5cub+I0Kx9813 dDBOj11H22IzS3y0zlhAz73D7Bf7oBIN+dAZt9NlZtvNpX1Zdl91QW4jv1HKitVkCpi72NRa+0M P+7al3KB5l9s/74hUMWeXb13w0hrZzNCMPrl1QhtmIHoRwIUnnC4tC94GpqT5++YmuoggRT0jmw 2vWMQPD6RGDJX4sRhbDXaKVn6IojzmL/nr0VG4aueINDy/sn8SpwNCPIemQ7Uk6CBrLzbF2QL4d XndurxMsPfwJYqf1N0Kn+xXaObuZW3cwu24pILJQGEg+j+O28bak8Lbeh30szvPmJgKf0183oE0 piyiXgG/63Zt1ymvA== X-Received: by 2002:a5d:5007:0:b0:472:fe1a:1ee9 with SMTP id ffacd0b85a97d-4815a0285a1mr6425690f8f.20.1786625321160; Thu, 13 Aug 2026 05:48:41 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:e77b:339c:e0c2:6c8d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4815a5b6616sm6685768f8f.25.2026.08.13.05.48.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2026 05:48:40 -0700 (PDT) From: Richard Purdie To: bitbake-devel@lists.openembedded.org Subject: [PATCH 5/6] utils: Add lockfile_to_exclusive Date: Thu, 13 Aug 2026 13:48:33 +0100 Message-ID: <20260813124834.1770307-5-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260813124834.1770307-1-richard.purdie@linuxfoundation.org> References: <20260813124834.1770307-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 13 Aug 2026 12:48:52 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19927 Add a function which turns a shared lock into an exclusive lock. This is useful for planned changes to the fetcher code. Signed-off-by: Richard Purdie --- lib/bb/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/bb/utils.py b/lib/bb/utils.py index 92b60b39d2c..b635f68a153 100644 --- a/lib/bb/utils.py +++ b/lib/bb/utils.py @@ -587,6 +587,13 @@ def lockfile(name, shared=False, retry=True, block=False): if not retry: return None +def lockfile_to_exclusive(lf): + if not lf: + return + fileno = lf.fileno() + fcntl.flock(fileno, fcntl.LOCK_EX) + return + def unlockfile(lf): """ Unlock a file locked using ``bb.utils.lockfile()``. From patchwork Thu Aug 13 12:48:34 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 95090 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A99AC5CFEB for ; Thu, 13 Aug 2026 12:48:52 +0000 (UTC) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.18292.1786625324364940644 for ; Thu, 13 Aug 2026 05:48:44 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=OcWJrzda; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.49, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-480033bdcf4so420201f8f.2 for ; Thu, 13 Aug 2026 05:48:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1786625322; x=1787230122; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=1liaYcjqx1BoXbvtMlNRXjDqGa2iESeDmfAnlKfT3oI=; b=OcWJrzdaTFKSWDlnx/CjG9kxFKKk8LZtAs+MuY5qbOcdqbQLPWA266PY0dc2qOHcOl 2ANdxlPvwhvMUW7ZHuDjf30FknONWOMq5pwv3lSWVdgPdtbB3w6UBWJrDAQbGnfZdAge 5Zd+sCAjlwji8C1HXUcz8G8+xqRFzaPIO9Ftg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786625322; x=1787230122; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=1liaYcjqx1BoXbvtMlNRXjDqGa2iESeDmfAnlKfT3oI=; b=Tq7NO8D7JYfezwQHnwGEljt3x2+hFYDBjbPTMFZmwvN1MSBIWSYAjYzK4ylf+Nsmyc yHZhc/XT0RGXWy1E+SjL3GguDTrhnnIm/Mcwr9axrFXeB3HtLje9/taEAhojQwdTIXkL jzJafPZmT+2U4KC5hMckBRGIcjkfU+sh5Q79u38CUniqDlBet6j/2WDr6cPo2THMhnDC 45xSO2lsXRFKYBwLK64Ytgogg6Jd3AdRE+nA24FB3SXAOTRRbEwirR+DrFM+RYKxCKKM hr0o6Wp3xXkOM4/nK32CN0xWwtsD5SIhejY3yykW8/Pw69LW6RV5+vwFSQ0NRAXAteY4 dwdA== X-Gm-Message-State: AOJu0YyJYO0QAnkXCkBdwrSVWk/ubQjHoVwUq4HhFZmvypvutsIQVdkf tQ3vSjNRSYfDaCPR0DSuqXjNOTxnFqtOqGYbdSpVF5jS9WDIIEIEUW82LemmmxiTJFlLC/MM/Kq XNDsYCVY= X-Gm-Gg: AR+sD12gPSU6Byc+0cu2W1/EEZSQhKdq0IA7Kywz25tz42IaVoqG+zaUoiPEXjn3Lho AHxXUCXveajtpTfTg3UzYb+ZBFuv9CALVOSjpMgj0qtHLWarmbqd5uzXSmSKqkUv1bog8DugNsS D/rOPkf4Q6flyeSHcjcz6VqlIa3sw1BRDsLXLYlVvhKcSG+ZOzYTG+bM5CnXwlqjnsd6GH7+U5/ DJhUYRF4fE0NBcCBibCe1vhTJGGJ4Tc+l6g34USlfnLYyVYF/dBGzgngH6V8fSuC+XwmJcrjZNL mZlQoLTzRKetiOnN9+L8RutVRx8whwNI7sPazM2NDPJrdlHJm6CNumouRZOqVCkgl9/gMkSZ61o /ZsWKRn3JMLPZ77lcbS88stb4d/aJkVXtOPu2Ht/LHO2VFwLJCnmpoMIR2oqIHtYS2YtTOMOgH4 a6lNVbjLJQpLoR7r+BouwbGOHXCgU+GlYuAjrf9r8KB8K4xf3OaliPN1GGLn1Sstapat7AgJbEO TSrcS0UXppM0DpqAg== X-Received: by 2002:a05:6000:4715:b0:480:c5:d635 with SMTP id ffacd0b85a97d-48159b69091mr8829566f8f.0.1786625322386; Thu, 13 Aug 2026 05:48:42 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:e77b:339c:e0c2:6c8d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4815a5b6616sm6685768f8f.25.2026.08.13.05.48.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2026 05:48:41 -0700 (PDT) From: Richard Purdie To: bitbake-devel@lists.openembedded.org Subject: [PATCH 6/6] fetch2: Switch to shared locking for read accesses Date: Thu, 13 Aug 2026 13:48:34 +0100 Message-ID: <20260813124834.1770307-6-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260813124834.1770307-1-richard.purdie@linuxfoundation.org> References: <20260813124834.1770307-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 13 Aug 2026 12:48:52 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19928 Instead of always using an exclusive lock, use a shared lock for unpack and the initial checks of download. This should mean that if we don't need to make any writes to the download directory, we only ever need the shared lock. As soon as any writes are possible, switch to the full lock. Also take advanatge of being able to pass None to the lock functions. Signed-off-by: Richard Purdie --- lib/bb/fetch2/__init__.py | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py index 2676e0962b9..b6006fa38d7 100644 --- a/lib/bb/fetch2/__init__.py +++ b/lib/bb/fetch2/__init__.py @@ -1097,7 +1097,8 @@ def try_mirror_url(fetch, origud, ud, ld, check = False): # False means try another url try: - if ud.lockfile and ud.lockfile != origud.lockfile: + lf = None + if ud.lockfile != origud.lockfile: lf = bb.utils.lockfile(ud.lockfile) if check: @@ -1174,7 +1175,7 @@ def try_mirror_url(fetch, origud, ud, ld, check = False): pass return False finally: - if ud.lockfile and ud.lockfile != origud.lockfile: + if ud.lockfile != origud.lockfile: bb.utils.unlockfile(lf) def try_mirrors(fetch, d, origud, mirrorvar, check = False): @@ -1911,14 +1912,15 @@ class Fetch(object): done = False try: - if ud.lockfile: - lf = bb.utils.lockfile(ud.lockfile) + lf = bb.utils.lockfile(ud.lockfile, shared=True) self.d.setVar("BB_NO_NETWORK", network) if m.verify_donestamp(ud, self.d) and not m.need_update(ud, self.d): done = True - elif m.try_premirror(ud, self.d): - done = m.try_mirrors(self, ud, self.d, 'PREMIRRORS') + if not done: + bb.utils.lockfile_to_exclusive(lf) + if m.try_premirror(ud, self.d): + done = m.try_mirrors(self, ud, self.d, 'PREMIRRORS') d = self.d if premirroronly: @@ -1980,8 +1982,7 @@ class Fetch(object): raise finally: - if ud.lockfile: - bb.utils.unlockfile(lf) + bb.utils.unlockfile(lf) if checksum_missing_messages: logger.error("Missing SRC_URI checksum, please add those to the recipe: \n%s", "\n".join(checksum_missing_messages)) raise BBFetchException("There was some missing checksums in the recipe") @@ -2031,8 +2032,7 @@ class Fetch(object): ud = self.ud[u] ud.setup_localpath(self.d) - if ud.lockfile: - lf = bb.utils.lockfile(ud.lockfile) + lf = bb.utils.lockfile(ud.lockfile, shared=True) unpack_tracer.start_url(u) if update: @@ -2042,8 +2042,7 @@ class Fetch(object): unpack_tracer.finish_url(u) finally: - if ud.lockfile: - bb.utils.unlockfile(lf) + bb.utils.unlockfile(lf) unpack_tracer.complete() @@ -2068,16 +2067,14 @@ class Fetch(object): if not ud.localfile and ud.localpath is None: continue - if ud.lockfile: - lf = bb.utils.lockfile(ud.lockfile) + lf = bb.utils.lockfile(ud.lockfile) ud.method.clean(ud, self.d) if ud.donestamp: bb.utils.remove(ud.donestamp) finally: - if ud.lockfile: - bb.utils.unlockfile(lf) + bb.utils.unlockfile(lf) def expanded_urldata(self, urls=None): """