From patchwork Mon Feb 19 00:38:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 39668 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 867CEC48BF6 for ; Mon, 19 Feb 2024 00:38:26 +0000 (UTC) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.80]) by mx.groups.io with SMTP id smtpd.web10.31109.1708303099666819519 for ; Sun, 18 Feb 2024 16:38:20 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=fO/4VGws; spf=pass (domain: axis.com, ip: 40.107.6.80, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YnBS5sOHVPwQAknTQ+417R19rjpFWPPvvLOqnlhejvBv3gaZptssnsSMV7v0yMtZg6fgaW4giG3awEbInP0TTeVqkxHSHYrPI4DP4fFPmOrQpfhHEO/CNV2VI628Trrra0Zh8ayCbAldah7MDutJ20NAZUSZlZAci1Kl9nyC/TqulGIjfysuW5uJtJtbHwbPnAbVTN3mmMXBMOspFQVJSoO5tUtwr3iI4A2rIXH7CRRKbtN6MBy67UfBRuKMCa8BZ9myqDiKgQ0CvG5lfzFldYOyyPrMYWf62Q409iZnfcGlhH7sq7oOTA29oqjCC+rWXdRpPDYZMYz1Ai0pTX/W+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1QzPOaYrfCdKr8ZwmBigzIxXvXPv3kM1YcJvx767B6c=; b=ERXFhedPh70YJkQ9qBj1qmYL0NGfZZO0PwBJuYbtljkM4s96OTb9QdWboSITS5MguEXwqZ/OYNNtfobPaSQa1P4yPf/MWwLSPzXRQmf+IRyLI+Lv6+QRHp08fPLxDNDivti31eZwg1EPmR5Nb5b1rpoej9ybj1aQ68j0TyV3BBtXMIC5Tl3qScet6cHjiRLEfSR1h71YmZNPaaUwvhTf9Uj2Nv3lD4ulzrGYtC5OYZkHOxHqqtYlzQYbKaPQXMeTgMf/KdoNRocjOHvniVinJ8kmeT2LGnV16IGA5dGLpQNVmvMZ01RtqLgYWcQZ9PqsSx5u5v69CCto7aTfnppsyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 195.60.68.100) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=axis.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1QzPOaYrfCdKr8ZwmBigzIxXvXPv3kM1YcJvx767B6c=; b=fO/4VGws3Da1+1LXJKMPgkJ8PNdutV2V6I32LQ+5NiwT4HYrCtg+e3zquLiysS7JlYXSciY/6+m3ThqzzW81wawAOFVbE2x2418Uu6UKS28tbouZ9CMGBYX1UJ1AFYL6ribfW22b/xPdJeXYPfAU4pnB6GFZtc1MMnTfeC99FCI= Received: from AS9PR05CA0091.eurprd05.prod.outlook.com (2603:10a6:20b:498::6) by VI1PR02MB6094.eurprd02.prod.outlook.com (2603:10a6:800:18a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.38; Mon, 19 Feb 2024 00:38:14 +0000 Received: from AMS0EPF000001B6.eurprd05.prod.outlook.com (2603:10a6:20b:498:cafe::2c) by AS9PR05CA0091.outlook.office365.com (2603:10a6:20b:498::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.34 via Frontend Transport; Mon, 19 Feb 2024 00:38:14 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=axis.com; Received-SPF: Fail (protection.outlook.com: domain of axis.com does not designate 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; Received: from mail.axis.com (195.60.68.100) by AMS0EPF000001B6.mail.protection.outlook.com (10.167.16.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7292.25 via Frontend Transport; Mon, 19 Feb 2024 00:38:14 +0000 Received: from se-mail01w.axis.com (10.20.40.7) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 19 Feb 2024 01:38:13 +0100 Received: from se-intmail01x.se.axis.com (10.0.5.60) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 19 Feb 2024 01:38:13 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id A577D14940 for ; Mon, 19 Feb 2024 01:38:13 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 41J0cDbo3024900 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Mon, 19 Feb 2024 01:38:13 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 41J0cDUr3024899 for bitbake-devel@lists.openembedded.org; Mon, 19 Feb 2024 01:38:13 +0100 From: Peter Kjellerstedt To: Subject: [PATCH 1/3] tests/fetch: Make test_git_latest_versionstring support a max version Date: Mon, 19 Feb 2024 01:38:03 +0100 Message-ID: <20240219003805.3024867-1-pkj@axis.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS0EPF000001B6:EE_|VI1PR02MB6094:EE_ X-MS-Office365-Filtering-Correlation-Id: 8416a950-fc6c-4481-f649-08dc30e30ea3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tue9qinY1J5DJqDSVIrFVNr8N8ZMXtiIE2aaLrwRTARqJX3RbT6Es+LtO6jYFuH7u5LLGnSVXv4xx9tPQ5PPMb5RKz+lmKpVHim5hSGmFRzpG2f70bfVMGSBwH0jBGVDMibUbOB7W/XUqiMr/htUVkeUDbikr/9xDEvKUkimWfQP1le+v4UAP+R0L9ZF0lAnQ7T8i+JRHXEFB8gaJ7L8kbdBGUBq0t7j77qt8LSxKJi/BDhecyM+mGDj1uD1csBZWWuBgI2op/U2O+/t0whgDJMhtewb+CfJYAHr2+tZWjJDUmUW7u1xe69SvywzSx43vC76q+wAS2g9ETcOAUX5n9Llrq123fQhSwgnSKLgtzeAqvgbNa3c2CXfnjEo2Gx2mNzOR8gg8g6KNHyE1f878VK8djeGGHAtB+jJ4raFR7psYWNh3r13/EYQ5XawgzVF7LkiH20/3JIlZ03Ar7QvBB3PzG+pnVweAzAh7txmXRsCYiBh78xteKs9X8fgH2RfOW6E028f/FouMptvN+owM3UWaYfaSp2IQqBsyiT4IdESzRXigNViJwbLzLhHOMwcHjjwwy60JruYIDXTsVPMyjNx5ZlGFVwWNz9+9KnSsBCdhi5obdfk66yEMTryIt24TYiFyqNF8SffRzhNB8yzCTAAelv5o/LudrBNoDPlT8k= X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(396003)(39840400004)(136003)(346002)(376002)(230922051799003)(64100799003)(451199024)(1800799012)(82310400011)(186009)(36860700004)(46966006)(5660300002)(2906002)(2616005)(36756003)(26005)(1076003)(478600001)(81166007)(356005)(83380400001)(336012)(426003)(70206006)(8936002)(70586007)(8676002)(6916009)(41300700001)(42186006)(6666004)(316002);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2024 00:38:14.0791 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8416a950-fc6c-4481-f649-08dc30e30ea3 X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af;Ip=[195.60.68.100];Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: AMS0EPF000001B6.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR02MB6094 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 19 Feb 2024 00:38:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15932 In some cases, the version found by latest_versionstring() may be higher than the real version. Make it possible to specify a maximum version so that this case can be detected. Signed-off-by: Peter Kjellerstedt --- bitbake/lib/bb/tests/fetch.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py index 41e1d8cf10..7e7f26d003 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py @@ -1370,36 +1370,36 @@ class FetchLatestVersionTest(FetcherTest): test_git_uris = { # version pattern "X.Y.Z" - ("mx-1.0", "git://github.com/clutter-project/mx.git;branch=mx-1.4;protocol=https", "9b1db6b8060bd00b121a692f942404a24ae2960f", "") + ("mx-1.0", "git://github.com/clutter-project/mx.git;branch=mx-1.4;protocol=https", "9b1db6b8060bd00b121a692f942404a24ae2960f", "", "") : "1.99.4", # version pattern "vX.Y" # mirror of git.infradead.org since network issues interfered with testing - ("mtd-utils", "git://git.yoctoproject.org/mtd-utils.git;branch=master;protocol=https", "ca39eb1d98e736109c64ff9c1aa2a6ecca222d8f", "") + ("mtd-utils", "git://git.yoctoproject.org/mtd-utils.git;branch=master;protocol=https", "ca39eb1d98e736109c64ff9c1aa2a6ecca222d8f", "", "") : "1.5.0", # version pattern "pkg_name-X.Y" # mirror of git://anongit.freedesktop.org/git/xorg/proto/presentproto since network issues interfered with testing - ("presentproto", "git://git.yoctoproject.org/bbfetchtests-presentproto;branch=master;protocol=https", "24f3a56e541b0a9e6c6ee76081f441221a120ef9", "") + ("presentproto", "git://git.yoctoproject.org/bbfetchtests-presentproto;branch=master;protocol=https", "24f3a56e541b0a9e6c6ee76081f441221a120ef9", "", "") : "1.0", # version pattern "pkg_name-vX.Y.Z" - ("dtc", "git://git.yoctoproject.org/bbfetchtests-dtc.git;branch=master;protocol=https", "65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf", "") + ("dtc", "git://git.yoctoproject.org/bbfetchtests-dtc.git;branch=master;protocol=https", "65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf", "", "") : "1.4.0", # combination version pattern - ("sysprof", "git://gitlab.gnome.org/GNOME/sysprof.git;protocol=https;branch=master", "cd44ee6644c3641507fb53b8a2a69137f2971219", "") + ("sysprof", "git://gitlab.gnome.org/GNOME/sysprof.git;protocol=https;branch=master", "cd44ee6644c3641507fb53b8a2a69137f2971219", "", "") : "1.2.0", - ("u-boot-mkimage", "git://git.denx.de/u-boot.git;branch=master;protocol=git", "62c175fbb8a0f9a926c88294ea9f7e88eb898f6c", "") + ("u-boot-mkimage", "git://git.denx.de/u-boot.git;branch=master;protocol=git", "62c175fbb8a0f9a926c88294ea9f7e88eb898f6c", "", "") : "2014.01", # version pattern "yyyymmdd" - ("mobile-broadband-provider-info", "git://gitlab.gnome.org/GNOME/mobile-broadband-provider-info.git;protocol=https;branch=master", "4ed19e11c2975105b71b956440acdb25d46a347d", "") + ("mobile-broadband-provider-info", "git://gitlab.gnome.org/GNOME/mobile-broadband-provider-info.git;protocol=https;branch=master", "4ed19e11c2975105b71b956440acdb25d46a347d", "", "") : "20120614", # packages with a valid UPSTREAM_CHECK_GITTAGREGEX # mirror of git://anongit.freedesktop.org/xorg/driver/xf86-video-omap since network issues interfered with testing - ("xf86-video-omap", "git://git.yoctoproject.org/bbfetchtests-xf86-video-omap;branch=master;protocol=https", "ae0394e687f1a77e966cf72f895da91840dffb8f", r"(?P(\d+\.(\d\.?)*))") + ("xf86-video-omap", "git://git.yoctoproject.org/bbfetchtests-xf86-video-omap;branch=master;protocol=https", "ae0394e687f1a77e966cf72f895da91840dffb8f", r"(?P(\d+\.(\d\.?)*))", "") : "0.4.3", - ("build-appliance-image", "git://git.yoctoproject.org/poky;branch=master;protocol=https", "b37dd451a52622d5b570183a81583cc34c2ff555", r"(?P(([0-9][\.|_]?)+[0-9]))") + ("build-appliance-image", "git://git.yoctoproject.org/poky;branch=master;protocol=https", "b37dd451a52622d5b570183a81583cc34c2ff555", r"(?P(([0-9][\.|_]?)+[0-9]))", "") : "11.0.0", - ("chkconfig-alternatives-native", "git://github.com/kergoth/chkconfig;branch=sysroot;protocol=https", "cd437ecbd8986c894442f8fce1e0061e20f04dee", r"chkconfig\-(?P((\d+[\.\-_]*)+))") + ("chkconfig-alternatives-native", "git://github.com/kergoth/chkconfig;branch=sysroot;protocol=https", "cd437ecbd8986c894442f8fce1e0061e20f04dee", r"chkconfig\-(?P((\d+[\.\-_]*)+))", "") : "1.3.59", - ("remake", "git://github.com/rocky/remake.git;protocol=https;branch=master", "f05508e521987c8494c92d9c2871aec46307d51d", r"(?P(\d+\.(\d+\.)*\d*(\+dbg\d+(\.\d+)*)*))") + ("remake", "git://github.com/rocky/remake.git;protocol=https;branch=master", "f05508e521987c8494c92d9c2871aec46307d51d", r"(?P(\d+\.(\d+\.)*\d*(\+dbg\d+(\.\d+)*)*))", "") : "3.82+dbg0.9", } @@ -1468,6 +1468,9 @@ class FetchLatestVersionTest(FetcherTest): self.assertTrue(verstring, msg="Could not find upstream version for %s" % k[0]) r = bb.utils.vercmp_string(v, verstring) self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s <= %s" % (k[0], v, verstring)) + if k[4]: + r = bb.utils.vercmp_string(verstring, k[4]) + self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s <= %s" % (k[0], verstring, k[4])) def test_wget_latest_versionstring(self): testdata = os.path.dirname(os.path.abspath(__file__)) + "/fetch-testdata" From patchwork Mon Feb 19 00:38:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 39667 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 8E060C54764 for ; Mon, 19 Feb 2024 00:38:26 +0000 (UTC) Received: from EUR02-VI1-obe.outbound.protection.outlook.com (EUR02-VI1-obe.outbound.protection.outlook.com [40.107.241.58]) by mx.groups.io with SMTP id smtpd.web11.31432.1708303105696254969 for ; Sun, 18 Feb 2024 16:38:26 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=rhLAK1mn; spf=pass (domain: axis.com, ip: 40.107.241.58, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GHk5qGE8lYtC3o9o6IaczoXVkzWN0eHC72DXLi3qy5+KcYtGQ6SSDNQFTexlRr2FDtMknoC0rHRpeRoh6ONtOs6RNUVFmVwCHF5X0aYVoX1WDc4HpyLjNKgmdEAMkvDVNRk9tgNhf/8YllQ49vv2BCgJwB/Z+ZYRz4WButCo4W8pRRPHBLuFfhoh7W/h+7W5vB1u6/bUx2p8Ed61jSSw1Foaip07HIflkbft9ziJQa1bQjr1l644w6NQR/T3mUBDM3N5fAdADDaYn+bb44+bpLwhbTeuiJh5yv3UscszQPhdEsyddUHQkDkTI6BVPbg/GirX3IkcQDz4mpR6/eYjRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wbAQanpTV8gbc3fnkQfaRAY9mCC6hjC5UY/pIEmW4Go=; b=dqFeBDuiJPldYXdGwoMnlEGCMpbi4Bda84g6DNPHZsq4WdP46dhlBrYVX0QBG4eGoLMc0ijhpclP44rBAWDvtBK7OyY/TyJ2LR7EQKfU2bGOaPlWC40VxTW25tJGvNf5L3grTA45GuMlDXgDDUdoIQXP+E7rx4aIgv04mSAWG1Tgd1LgHjndA8jA6oDaWN/o3xLKpufzjvio1apIIWPj5VCiazXm67ht2zKLA0xOY/NxKfpTHaoFimAceciV2OO8ONKYlrjELDviS9n2oU2hyx3xb5NgsB1jWDN6qfPHpqDgoSpuZnUvPbvhmZduSfPoyKyoqjFOwy+VLAouioGlKw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 195.60.68.100) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=axis.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wbAQanpTV8gbc3fnkQfaRAY9mCC6hjC5UY/pIEmW4Go=; b=rhLAK1mnqcJI9D7SPGu+FprwQc394TV3DrvRdm6Pv5YXFBEAtZEA85nGvm2W076zDey90Kw4JQf37xvuFDj2ygQcer0tBr01aDfNrpESUvSs02iw8rvPmC2qEcbIaD0XHSJSRYD3MZDolulN2fN0m2J00jNoW9CfIoCuj3b3rO4= Received: from AM0PR02CA0163.eurprd02.prod.outlook.com (2603:10a6:20b:28d::30) by PRAPR02MB7905.eurprd02.prod.outlook.com (2603:10a6:102:29f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.32; Mon, 19 Feb 2024 00:38:22 +0000 Received: from AMS0EPF000001B2.eurprd05.prod.outlook.com (2603:10a6:20b:28d:cafe::1f) by AM0PR02CA0163.outlook.office365.com (2603:10a6:20b:28d::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.38 via Frontend Transport; Mon, 19 Feb 2024 00:38:22 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=axis.com; Received-SPF: Fail (protection.outlook.com: domain of axis.com does not designate 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; Received: from mail.axis.com (195.60.68.100) by AMS0EPF000001B2.mail.protection.outlook.com (10.167.16.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7292.25 via Frontend Transport; Mon, 19 Feb 2024 00:38:21 +0000 Received: from se-mail01w.axis.com (10.20.40.7) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 19 Feb 2024 01:38:21 +0100 Received: from se-intmail01x.se.axis.com (10.0.5.60) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 19 Feb 2024 01:38:21 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 0524814940 for ; Mon, 19 Feb 2024 01:38:21 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 41J0cKuc3024924 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Mon, 19 Feb 2024 01:38:20 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 41J0cK5E3024923 for bitbake-devel@lists.openembedded.org; Mon, 19 Feb 2024 01:38:20 +0100 From: Peter Kjellerstedt To: Subject: [PATCH 2/3] fetch2/git: A bit of clean-up of latest_versionstring() Date: Mon, 19 Feb 2024 01:38:04 +0100 Message-ID: <20240219003805.3024867-2-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240219003805.3024867-1-pkj@axis.com> References: <20240219003805.3024867-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS0EPF000001B2:EE_|PRAPR02MB7905:EE_ X-MS-Office365-Filtering-Correlation-Id: 35e34ffe-ba71-4e0f-7ca3-08dc30e312fd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: djEIfWBxzM3iEQVsV4p+9RjCWVJhb5HnIi2BHBSzrs+OeeOKwU/FOBXJaMidcowX5nEl8BfdrQODlgKYUvbztVKqKcx6NFtXKqqEHwfWoS8F/e/R4xmARyGuXstmwFJhbmT+bJddrVoYwlL0hBE/UjNaIDpFxWsHTza6fiAAn4iZuIhFDo5HuifofjFSenTOe/+p0wvfAFCrRx0SBHDiddLVcDoIVziomeKyY5SeWlS1mWFoMiVkbTt3TSaka89r6uliGqylxHeATwrubUHthlYYE9sXgnJuYZqR9hd8Qf/IHponPB804gO5ANtFcyNcUEwaYKWcFG/hF8Ltkuk0pZk1frwff+ckxhLqQO4do6/sU9rQSadZkkEFw7L5QE0plK5EmmXhZGCxG9oI0AWnvk/ZxkTwWKcd5Gbqotb3AT19GqGsVN6Qm8o3+dNPjidHOFrHfBySF5sv8N47bcpKzHl28TOAAaMdvhyS8QVPvuuOdHsYryvq/5PuHjNn41wLu07+qeYQRWTofIpAGp9ZHhOyj3EHWK+uFo+YUFWjEVO4NPFOxQ4aVskDMz6zcyKB1emkqxynDlxRFCuO5OBHnbcX+SUXNWL0Gkh6TImzxjUKrI14KDB/LDZEFT4kGsuUWQ/C+ci+NK0HzyhjtwPZH77HtQyCCIt1GjG4LAHbxAk= X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(396003)(376002)(136003)(39850400004)(346002)(230922051799003)(186009)(451199024)(64100799003)(1800799012)(82310400011)(36860700004)(46966006)(40470700004)(2906002)(8676002)(5660300002)(8936002)(83380400001)(1076003)(2616005)(26005)(336012)(82740400003)(36756003)(426003)(356005)(81166007)(70586007)(70206006)(42186006)(6916009)(316002)(478600001)(6666004)(41300700001);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2024 00:38:21.3610 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 35e34ffe-ba71-4e0f-7ca3-08dc30e312fd X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af;Ip=[195.60.68.100];Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: AMS0EPF000001B2.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PRAPR02MB7905 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 19 Feb 2024 00:38:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15933 This is mostly preparations for the next commit. Signed-off-by: Peter Kjellerstedt --- bitbake/lib/bb/fetch2/git.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 0deeb5cee1..a69371a57e 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py @@ -812,37 +812,36 @@ class Git(FetchMethod): """ pupver = ('', '') - tagregex = re.compile(d.getVar('UPSTREAM_CHECK_GITTAGREGEX') or r"(?P([0-9][\.|_]?)+)") try: output = self._lsremote(ud, d, "refs/tags/*") except (bb.fetch2.FetchError, bb.fetch2.NetworkAccess) as e: bb.note("Could not list remote: %s" % str(e)) return pupver + pver_re = re.compile(d.getVar('UPSTREAM_CHECK_GITTAGREGEX') or r"(?P([0-9][\.|_]?)+)") + nonrel_re = re.compile(r"(alpha|beta|rc|final)+") + verstring = "" - revision = "" for line in output.split("\n"): if not line: break - tag_head = line.split("/")[-1] + tag = line.split("/")[-1] # Ignore non-released branches - m = re.search(r"(alpha|beta|rc|final)+", tag_head) - if m: + if nonrel_re.search(tag): continue # search for version in the line - tag = tagregex.search(tag_head) - if tag is None: + m = pver_re.search(tag) + if not m: continue - tag = tag.group('pver') - tag = tag.replace("_", ".") + pver = m.group('pver').replace("_", ".") - if verstring and bb.utils.vercmp(("0", tag, ""), ("0", verstring, "")) < 0: + if verstring and bb.utils.vercmp(("0", pver, ""), ("0", verstring, "")) < 0: continue - verstring = tag + verstring = pver revision = line.split()[0] pupver = (verstring, revision) From patchwork Mon Feb 19 00:38:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kjellerstedt X-Patchwork-Id: 39669 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 7D421C48BF6 for ; Mon, 19 Feb 2024 00:38:36 +0000 (UTC) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (EUR01-DB5-obe.outbound.protection.outlook.com [40.107.15.50]) by mx.groups.io with SMTP id smtpd.web11.31433.1708303109847851875 for ; Sun, 18 Feb 2024 16:38:30 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@axis.com header.s=selector1 header.b=AAlGdCc0; spf=pass (domain: axis.com, ip: 40.107.15.50, mailfrom: peter.kjellerstedt@axis.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oMGY7UVtYV0P91ndNNW3w7aLiUwbf3Hh1FBS/Zv6ebkO2TZR3jLC6BQw7hpme/pXUTDcrpWzuO428qQSEKgiHOqtPKbA1nQVowAIJVE/JPYoMFBuiLFrJQ8m3Wvqdpt5gLSqHW/HD3ifyR1xGmZi6b0+3/Qjjr2nUo69r+hgh5ouIeGVKNB4d4lNsOaQAUz6oTqp5rh3LsqNm200Q6MPO5NJ21qJQUIQUzMWC3h5Ic+cf5htdgNJ+K1dq9Umvu8myg2u8wfmvnwrWS8egg/7aGDfQLqW6BLw+uzy0mm1QT5/ABNGbyaoKHb62o4X8nUcFhSxV/bevHXN/HofrlOnOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CycQONV7MZnIebn4w1kbEK3LvVusso+7d232uaF6ax4=; b=YohHjlv1WoWXeVSVfFAqznU4J+Zb4MyTFKvsqRmQsLcDkGX96nd2IhIbq7nqzLPLTGX/i/zFVIZNVN1WYMj5vKK9M96Vrr6h05lmKKAxAH6s/qLpL0gFt0aeHcg/z6OfY3gy6AIQuCwMf4mj09y6flytNPL/mS9vM/YErUpVoCEJoT9+/J0m6Zb40kRpPl5ZY2t/1B5z8kucx9ZEEWxSLYOBhWxRuQBJsOv8Zm8IdSGCATMAaLOcImXpkVMIEmXaDPG7KqPuqWrrmLDHdh/snB+7Gk+fAkXUmZQZfXbOijC9c9VaC2QyqlZ4g5BfOS3dFcrHgCYHsUCLY5AOR/bzEw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 195.60.68.100) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=axis.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CycQONV7MZnIebn4w1kbEK3LvVusso+7d232uaF6ax4=; b=AAlGdCc0VZ5xXmbldN9MxxanB8ryHC0JMR11NxCFYgTwnkJiucKDTpKnvgXfNfHKEZTKUvbZwJQ+Wl2yc6oEAN3dxFtH05u3Plh8aBOat96a8XZs/r4VUEYeeSKalRpoYku7c72TBGSp3rYMYWg+113hSa1FvaiXoJ0bdLhgJuE= Received: from AS9PR06CA0299.eurprd06.prod.outlook.com (2603:10a6:20b:45a::28) by PAWPR02MB9102.eurprd02.prod.outlook.com (2603:10a6:102:33a::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.34; Mon, 19 Feb 2024 00:38:26 +0000 Received: from AMS0EPF000001B5.eurprd05.prod.outlook.com (2603:10a6:20b:45a:cafe::f4) by AS9PR06CA0299.outlook.office365.com (2603:10a6:20b:45a::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.38 via Frontend Transport; Mon, 19 Feb 2024 00:38:26 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=axis.com; Received-SPF: Fail (protection.outlook.com: domain of axis.com does not designate 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; Received: from mail.axis.com (195.60.68.100) by AMS0EPF000001B5.mail.protection.outlook.com (10.167.16.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7292.25 via Frontend Transport; Mon, 19 Feb 2024 00:38:26 +0000 Received: from se-mail01w.axis.com (10.20.40.7) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 19 Feb 2024 01:38:24 +0100 Received: from se-intmail01x.se.axis.com (10.0.5.60) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 19 Feb 2024 01:38:24 +0100 Received: from saur (saur.se.axis.com [10.92.3.10]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id CFB9B14940 for ; Mon, 19 Feb 2024 01:38:24 +0100 (CET) Received: from saur.se.axis.com (localhost [127.0.0.1]) by saur (8.17.1/8.15.2) with ESMTPS id 41J0cOfh3024937 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Mon, 19 Feb 2024 01:38:24 +0100 Received: (from pkj@localhost) by saur.se.axis.com (8.17.1/8.17.1/Submit) id 41J0cOxK3024936 for bitbake-devel@lists.openembedded.org; Mon, 19 Feb 2024 01:38:24 +0100 From: Peter Kjellerstedt To: Subject: [PATCH 3/3] fetch2/git: Make latest_versionstring extract tags with slashes correctly Date: Mon, 19 Feb 2024 01:38:05 +0100 Message-ID: <20240219003805.3024867-3-pkj@axis.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240219003805.3024867-1-pkj@axis.com> References: <20240219003805.3024867-1-pkj@axis.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS0EPF000001B5:EE_|PAWPR02MB9102:EE_ X-MS-Office365-Filtering-Correlation-Id: 17f4b254-4ab5-48e2-e397-08dc30e315d9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Jzw6j6AjfDAKnQh93AxbNLKsBvyP9jtoSQQ8da9GW/qmIsQ/nMD+5tmHJZqWNDH0Q8LqN4QFoWdamr4zE5ywZtXfp/YEnVLh0MMtCQytl2BWORXSAsncDgD3dyCq7JHHqeuIWcJRuDnnNKhTYhS9caThOgPiIWSd7hANm67S+YrM5kSuRHTpu4+H5cDCOyAAuv0JZyN5GkH11s4RHqJaq7tVZGvDLsriUBByaQmWsDLbX6u+vlaYZwhibTP16ROFuqjAfKR+WDzNgaU4ICL6iVZu1hJ6EPDBr8s/j1kVSyfHz/q54AgNoxdHOnfmWySLvnXyboIFXNudMyNA4VR4+1WMZMR0Ba/zWxrLwZ34KUujmp5E5ANgr1pyZCH31b7gaS/vaRYC+/56Cf5yplE4DEHX1+12DxsRGVIS9ZQwG3QXxyXJVdpu0u0FJ6VfhshW/8cwchItgdnlfSBm6iuMWbmQroooyxkpT31jil0pPjk2SBX7hNg+g7abiVyk0DPmtZsIyhQpxS5LnLigNv1Hcmr0gFH2pSwhPtEi0pLBgwGwjzBVOwYx+jhxDjYl3q9NsGCdrNENSpGWchyaoLqDBN4RzmUWDd9CtvM1B2LJN2GO0Sa9MJHFYl0C0VbZamfZy1D2+EA1706aHVdFsbRPP09onX4pO5erke2o2nHyYyc= X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(346002)(396003)(39850400004)(136003)(376002)(230922051799003)(82310400011)(36860700004)(1800799012)(186009)(451199024)(64100799003)(40470700004)(46966006)(6666004)(42186006)(316002)(5660300002)(2906002)(6916009)(8936002)(70586007)(70206006)(8676002)(41300700001)(36756003)(2616005)(26005)(1076003)(478600001)(81166007)(83380400001)(426003)(336012)(356005)(82740400003);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2024 00:38:26.1765 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 17f4b254-4ab5-48e2-e397-08dc30e315d9 X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af;Ip=[195.60.68.100];Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: AMS0EPF000001B5.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR02MB9102 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 19 Feb 2024 00:38:36 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15934 Before, everything up to the last slash was removed when extracting the names of the tags. This would lead to that a tag such as "agent/11.0.0" would be incorrectly identified as "11.0.0", which would then be treated as a correct version matching "^(?P\d+(\.\d+)+)". Signed-off-by: Peter Kjellerstedt --- bitbake/lib/bb/fetch2/git.py | 9 +++++++-- bitbake/lib/bb/tests/fetch.py | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index a69371a57e..9e09678494 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py @@ -818,6 +818,7 @@ class Git(FetchMethod): bb.note("Could not list remote: %s" % str(e)) return pupver + rev_tag_re = re.compile(r"([0-9a-f]{40})\s+refs/tags/(.*)") pver_re = re.compile(d.getVar('UPSTREAM_CHECK_GITTAGREGEX') or r"(?P([0-9][\.|_]?)+)") nonrel_re = re.compile(r"(alpha|beta|rc|final)+") @@ -826,7 +827,12 @@ class Git(FetchMethod): if not line: break - tag = line.split("/")[-1] + m = rev_tag_re.match(line) + if not m: + continue + + (revision, tag) = m.groups() + # Ignore non-released branches if nonrel_re.search(tag): continue @@ -842,7 +848,6 @@ class Git(FetchMethod): continue verstring = pver - revision = line.split()[0] pupver = (verstring, revision) return pupver diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py index 7e7f26d003..832ae4d627 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py @@ -1401,6 +1401,8 @@ class FetchLatestVersionTest(FetcherTest): : "1.3.59", ("remake", "git://github.com/rocky/remake.git;protocol=https;branch=master", "f05508e521987c8494c92d9c2871aec46307d51d", r"(?P(\d+\.(\d+\.)*\d*(\+dbg\d+(\.\d+)*)*))", "") : "3.82+dbg0.9", + ("sysdig", "git://github.com/draios/sysdig.git;branch=dev;protocol=https", "4fb6288275f567f63515df0ff0a6518043ecfa9b", r"^(?P\d+(\.\d+)+)", "10.0.0") + : "0.28.0", } test_wget_uris = {