[{"id":26615,"web_url":"https://patchwork.libcamera.org/comment/26615/","msgid":"<167838342353.3936253.13123913770371163025@Monstersaurus>","date":"2023-03-09T17:37:03","subject":"Re: [libcamera-devel] [PATCH] meson: Fix git version parsing","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2023-03-09 17:21:15)\n> When extracting the build metadata from the git version, we use the\n> string strip() method to remove the version prefix. This is incorrect,\n> as the strip() method takes a set of characters to be removed, not a\n> literal string. Fix it by splitting the git version string on the '+'\n> character and keeping the suffix.\n> \n> Fixes: 02518e598e8f (\"meson: Rewrite .replace usage\")\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  meson.build | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/meson.build b/meson.build\n> index 0f89b45a0169..189e97736d90 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -41,8 +41,8 @@ if libcamera_version != project_version\n>  \n>      # Replace the version components reported by git with the release version,\n>      # but keep all trailing information supplied by git.\n> -    libcamera_git_version = (project_version +\n> -                             libcamera_git_version.strip(libcamera_version))\n> +    libcamera_git_version = (project_version + '+' +\n> +                             libcamera_git_version.split('+')[1])\n\nLooks too obvious. Why didn't I use this in the first place ;-)\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n>      libcamera_version = project_version\n>  \n>      # Append a marker to show we have modified this version string\n> \n> base-commit: f852b7fbc4960ea83bab49b75408fb13462db8ba\n> -- \n> Regards,\n> \n> Laurent Pinchart\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 6571BBDE17\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  9 Mar 2023 17:37:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B9E7F626D5;\n\tThu,  9 Mar 2023 18:37:07 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9E9B161ED7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  9 Mar 2023 18:37:06 +0100 (CET)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 16319589;\n\tThu,  9 Mar 2023 18:37:06 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1678383427;\n\tbh=xnsdrnoqnfzX1qCcR/BjDa2h7wIXtXRD9uEbhBKT/BE=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=V8TjZF3ywC91w7gerS4oW6OZb3LcTI8p0LJh1KhnzVnm3Z+t46VTpW8T1sM07Huvm\n\twJp6b1hMp8Qa6gyrzRjtwByIu4Mq92lQQUNJ8kbkwCeeYUOTYfU4tdaIc/bXXoWZ3K\n\tfGQxiBJBhqrkLhMMHoz2Pm5nlCQhVQ+jz+G/t7wono6iknoncze/aw0LkO2gx9TehB\n\tdMHKBdo202YTmjFcIP70vGcPPlLZ8hLXO09rf/I9u7a46Ip2fVkwDkRhnNOzqboPYs\n\tTym+GWuKHkKn/vhZaAXBUW0qz6Fn84klkasxN30zi+9+kAlSEPQDmAKnIik8qgXXtH\n\t/UQ5qeq+H2Uig==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1678383426;\n\tbh=xnsdrnoqnfzX1qCcR/BjDa2h7wIXtXRD9uEbhBKT/BE=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=NZS4/dvCoduLIBrd35izwfRcb+F219xMCL9MQOKU3Kzk8udo4UQa6LyX2rnrbCaCz\n\tT9QDEZK8TJ38VzGrL0iVavivBRuRvMw/3/eGiRqS1vIcpE2Q5KeoDkbzE/6vSqaaud\n\tsLgieeFpV/7F5Oxc7GiV9hPpHpt4tn8M1c2pc3Pg="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"NZS4/dvC\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20230309172115.15216-1-laurent.pinchart@ideasonboard.com>","References":"<20230309172115.15216-1-laurent.pinchart@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 09 Mar 2023 17:37:03 +0000","Message-ID":"<167838342353.3936253.13123913770371163025@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH] meson: Fix git version parsing","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":26616,"web_url":"https://patchwork.libcamera.org/comment/26616/","msgid":"<0f31d063-7483-dad8-7527-2dc16e9d791d@wolfvision.net>","date":"2023-03-10T05:00:43","subject":"Re: [libcamera-devel] [PATCH] meson: Fix git version parsing","submitter":{"id":135,"url":"https://patchwork.libcamera.org/api/people/135/","name":"Michael Riesch","email":"michael.riesch@wolfvision.net"},"content":"Hi Laurant, Kieran,\n\nOn 3/9/23 18:37, Kieran Bingham wrote:\n> Quoting Laurent Pinchart (2023-03-09 17:21:15)\n>> When extracting the build metadata from the git version, we use the\n>> string strip() method to remove the version prefix. This is incorrect,\n>> as the strip() method takes a set of characters to be removed, not a\n>> literal string. Fix it by splitting the git version string on the '+'\n>> character and keeping the suffix.\n>>\n>> Fixes: 02518e598e8f (\"meson: Rewrite .replace usage\")\n>> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>> ---\n>>  meson.build | 4 ++--\n>>  1 file changed, 2 insertions(+), 2 deletions(-)\n>>\n>> diff --git a/meson.build b/meson.build\n>> index 0f89b45a0169..189e97736d90 100644\n>> --- a/meson.build\n>> +++ b/meson.build\n>> @@ -41,8 +41,8 @@ if libcamera_version != project_version\n>>  \n>>      # Replace the version components reported by git with the release version,\n>>      # but keep all trailing information supplied by git.\n>> -    libcamera_git_version = (project_version +\n>> -                             libcamera_git_version.strip(libcamera_version))\n>> +    libcamera_git_version = (project_version + '+' +\n>> +                             libcamera_git_version.split('+')[1])\n\nIs it safe to assume that metadata is present in this case, i.e., the\nlist produced by libcamera_git_version.split('+') contains at least two\nentries?\n\nWith that addressed:\n\nReviewed-by: Michael Riesch <michael.riesch@wolfvision.net>\n\nBest regards,\nMichael\n\n> \n> Looks too obvious. Why didn't I use this in the first place ;-)\n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n>>      libcamera_version = project_version\n>>  \n>>      # Append a marker to show we have modified this version string\n>>\n>> base-commit: f852b7fbc4960ea83bab49b75408fb13462db8ba\n>> -- \n>> Regards,\n>>\n>> Laurent Pinchart\n>>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id F0B22BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 10 Mar 2023 05:00:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EE78B626B2;\n\tFri, 10 Mar 2023 06:00:50 +0100 (CET)","from EUR05-DB8-obe.outbound.protection.outlook.com\n\t(mail-db8eur05on20608.outbound.protection.outlook.com\n\t[IPv6:2a01:111:f400:7e1a::608])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4E23261ED5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Mar 2023 06:00:48 +0100 (CET)","from DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5)\n\tby DBAPR08MB5608.eurprd08.prod.outlook.com (2603:10a6:10:1a5::17)\n\twith Microsoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19;\n\tFri, 10 Mar 2023 05:00:46 +0000","from DU0PR08MB9155.eurprd08.prod.outlook.com\n\t([fe80::6f4d:f868:c89:4db1]) by\n\tDU0PR08MB9155.eurprd08.prod.outlook.com\n\t([fe80::6f4d:f868:c89:4db1%4]) with mapi id 15.20.6178.017;\n\tFri, 10 Mar 2023 05:00:46 +0000"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1678424451;\n\tbh=htrrhX7bTqg6VcO9zVX2MII9mRz1UkASdjGtZBfdEak=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=II86Nqw+8c/z5c61qzEKBtTQ7f0/bt7w9AAk+NnfiVY4bxM/9HsAYdEjcRSL2BaZ9\n\tLQgB1M1uIQY1ZE4JD8WbuVEmiCPzU0dmAFa0dJclAUFyMjCCc23+Bz/nYS2vhLJkcB\n\t7lfGuwyx+Vx6mu+EJ9mNSvBJe8Oj+TpsasTUMCTfSN+Ni54wOk2TZaD5slYmPl6+6p\n\tEQ5LZrEcXBuXkKv2mfKKibDHIgCAE9z3u0AuUkqoGTk2hXVSqVT39ziDOozOMa/6Tv\n\tUIECgec6VJpe7O/ixdfqgUrKubYtcGCHyAQkpriOYf78u+gz3yp3/K986vvSuL1c/p\n\tBt/dpF14ugDXg==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net;\n\ts=selector2;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n\tbh=/vGFwKbP9752d3l6j907vTOKP2GvuR5cvn4te2zWFQU=;\n\tb=ya2Kf5ktS2TtctYGLPLlr2D/xY72Q12h4HRBLbpUXOhqxO2NdRaWpf3wlvX9aZFjw1qx0ZT7AoY3Z/gP6ua6mTaq/KWjrmcp6VQbHCheWFJMqv8mR616olz9W9BjfAjTIlZu6qSfQgVGJztcBPXOVrvufMItMgGahPJlnYoGgDA="],"Authentication-Results":["lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=wolfvision.net\n\theader.i=@wolfvision.net\n\theader.b=\"ya2Kf5kt\"; dkim-atps=neutral","dkim=none (message not signed)\n\theader.d=none;dmarc=none action=none header.from=wolfvision.net;"],"ARC-Seal":"i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n\tb=mdwjYExsLjYxrOb8Y/4ejF3R9wyNvezRsVQB3zXEoINQCJsXHbUVmcMU6ADpDqwJTTuSdJdusAlJGGkBIeY5s84g7D9xGNRyWp1yhUQafvimIvk3Y9AAN0pp7xiZvLqWp9zlsEkeZsgs1/szWj13Nh/A3pCJUhZ0uiEy+TiZh5ob77uH5WW8+XaFPsRK2hSzE1vrypociDY4+IRSYJDO7aT3mwzkOeAanM92wfnqRkxkE/qLt6YhYdEpwlRUTAl+v1z90anDslDRivK+wV+lWBf861Ew1k+e2qP7LNbMcnEeoMJYHCeOEnWGNslLKZU0dgVfGTCcTcIYXTWlXh4oIQ==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n\ts=arcselector9901;\n\th=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;\n\tbh=/vGFwKbP9752d3l6j907vTOKP2GvuR5cvn4te2zWFQU=;\n\tb=R11UaLtF+Z2/bw1uFRszYeWGkHoS5gKo050Z+nPQeBApdGKfMSQl6h9mNEPGR8O/o+uUlwp8qeGTpXegc2iYzPrcPM8Rc2MH2uI17NACi+w7qXFP2C76k1Z0ZnFCn3iIMjlz6z0S2mcayIxk7e46lbWHbGYzGs3hP5sQWLAiYoXHK6Y2sBv7DuBCE8idXauzYiagzELxJkRWWc5Mvy89lmBo/ZD/4txNjoh1QVBpacU4Uk/s0SF36F0nGHWmPb+8LCWk/6Kh0b6hLQvsaHoDVtOMacfFPPx2kF7mQfqbc79V9jqzyynHZyUhBTFUMeVMcGikuXsQJMTgzTKCLSB5cw==","ARC-Authentication-Results":"i=1; mx.microsoft.com 1; spf=pass\n\tsmtp.mailfrom=wolfvision.net; dmarc=pass action=none\n\theader.from=wolfvision.net; dkim=pass header.d=wolfvision.net;\n\tarc=none","Message-ID":"<0f31d063-7483-dad8-7527-2dc16e9d791d@wolfvision.net>","Date":"Fri, 10 Mar 2023 06:00:43 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n\tThunderbird/102.8.0","Content-Language":"en-US","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20230309172115.15216-1-laurent.pinchart@ideasonboard.com>\n\t<167838342353.3936253.13123913770371163025@Monstersaurus>","In-Reply-To":"<167838342353.3936253.13123913770371163025@Monstersaurus>","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"7bit","X-ClientProxiedBy":"ZR2P278CA0043.CHEP278.PROD.OUTLOOK.COM\n\t(2603:10a6:910:47::17) To DU0PR08MB9155.eurprd08.prod.outlook.com\n\t(2603:10a6:10:416::5)","MIME-Version":"1.0","X-MS-PublicTrafficType":"Email","X-MS-TrafficTypeDiagnostic":"DU0PR08MB9155:EE_|DBAPR08MB5608:EE_","X-MS-Office365-Filtering-Correlation-Id":"c527fe1b-4043-45da-6639-08db21246888","X-MS-Exchange-SenderADCheck":"1","X-MS-Exchange-AntiSpam-Relay":"0","X-Microsoft-Antispam":"BCL:0;","X-Microsoft-Antispam-Message-Info":"E86ftyAPZAgBfU/OUx4udG1/dzewl/w7Y7R3Z8FgMtXkP2dbN3r4DuJYlolDMwSL+DCA6aMHHN4p8cH0pgljzoOtXka9LfOK4uC/ITp9vbg655k6eXh93E2OGcQk6P7qYsEtBXkaGMwNmz9/SVEDdEjkCyLuBlo+GDQ7wLggMh0Z7JY6x/QAQ/Ig1uFLTjRZoSJf9GqcxrNCXL5FpkM98uc//Cjw7+XBWNFMoT02MKFbK8MZz4/uc6FO11N7Ql+dhcHMq5OrM42K+mk/QWFxT17aSLWvQxvrnHmYysdunG9pr8VjxLNoGU6tyNXNMFl9LPmGx53XdRQMLc86iXSSNwuI25iZe+92DafxEbaqoZ453pVxb7oTv7likiElJAREA/aXfa5OFwR+xewr48g42FDBFv98SDZyndDZkitiaZLA1gaZArHb6f72CiJ8cfsbu9pcSy3wm6Z9A5MJf1yVipIIXnzASLubTx80sEfdyv1b4zKLLj0cvZYaDn7lgKlS63+STIvgp4/tmpeqHwf4opyHxooEhMKU2Mm9/YEnMGmBgrqJ/CWnJDFPSaHBqI6oiPEA6T/fzAKXJKqSZvvp9tTLxhdXKJd4AODna2Wdky8rSbd+StRmeHQY01fey+MDidgkFvY2PxdEHs12lk7nelGEhZTQJCi4NfTQYN4nl+LH5q7TKl13rQd8nEcbl5LxiN7IeNs0jwmBIw4oLMOYBpo2M67tG55ooXy81BbYc7M=","X-Forefront-Antispam-Report":"CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n\tIPV:NLI; SFV:NSPM; H:DU0PR08MB9155.eurprd08.prod.outlook.com; PTR:;\n\tCAT:NONE; \n\tSFS:(13230025)(4636009)(346002)(136003)(39840400004)(366004)(396003)(376002)(451199018)(31686004)(2906002)(44832011)(8936002)(5660300002)(36756003)(41300700001)(66946007)(66476007)(8676002)(66556008)(31696002)(86362001)(316002)(478600001)(6486002)(38100700002)(110136005)(6506007)(6512007)(53546011)(186003)(6666004)(2616005)(83380400001)(45980500001)(43740500002);\n\tDIR:OUT; SFP:1101; ","X-MS-Exchange-AntiSpam-MessageData-ChunkCount":"1","X-MS-Exchange-AntiSpam-MessageData-0":"=?utf-8?q?HFcv2a3rSmbd6OeLoV81Vkheq?=\n\t=?utf-8?q?vh+4x7uZW8tZYO5YHRQJ7dRaTe/OTl2LzEclBPmrgSc0nE2hfJAWbU9L?=\n\t=?utf-8?q?Gb/4j+MmtzBfwSccjqw6dcgOYVrXlFzbTJs40S3M2aI4751E9TicHjsD?=\n\t=?utf-8?q?30Blr8Kbc74dg9CAcZ/GbUZLOt7zy7YIUd0EnBR9E2TfwWvezBlKl6wu?=\n\t=?utf-8?q?lM9alsj6dDq5adnvZaIwhsREDe2fRzxcTP8aMQcHPZFX0/okvyuZ6C4s?=\n\t=?utf-8?q?catYIabsQ8q+a5Nlj1LAHBpws/GoaJIN22/TJuj96rFbDAoOTKbP01HO?=\n\t=?utf-8?q?ujr9PmxB9tr1e3RiT6aUYkxUmT3E/oGaoCrMkFqJvsQ5t6xYRYFx5XiI?=\n\t=?utf-8?q?6wALXpa7TMHD0d7mYqfaYpWI/84g27Cm13Hd8l3gTd5m1TsdffM9adYV?=\n\t=?utf-8?q?fDzAS827C9yebsvOmZ9I25sb//egplg9pVXUONI/Vu7XEaoR1izlTUtn?=\n\t=?utf-8?q?AmGRZUfHAySJGhJrUlq278aWbzloJOrcAagHoEkti0WDIMNiq6q1bWqk?=\n\t=?utf-8?q?UMRBC76RtvK+0jAAivrIT5fL3FdrZYpgEhG/g6ymIsH6Rk4xiq5stXQ0?=\n\t=?utf-8?q?iaaMSH2k/UBWii8D4iEtxDbl8M0TOg5yRxcZUO+jvMw9shkvBMHcwAuY?=\n\t=?utf-8?q?8QNfFcOV7fsexPgI+lEA8HaWdG51bOiBIVg1MhvqS+gDvy24qngJ9Tyi?=\n\t=?utf-8?q?UHJdvnoEdnn5DQrz93DLGm8gQw6FORZVvV0yXw+abIjEFxNUhP+/4tUf?=\n\t=?utf-8?q?YNolL9myNxAgbsW+ovbfU2m8UBidgOybkSkzybe3vYADvWzGtSf9FPdU?=\n\t=?utf-8?q?+l4wwsCAX8TpPy5lb9MYq70KCX6L07uMI5gSUFOwAn/69VrdmW23dVRG?=\n\t=?utf-8?q?ZSQEIaSQgzld30UBGKUDyFYJh0wcBolZdEAR0YXKjOeLBRBBL+z85lbP?=\n\t=?utf-8?q?Pyn3fYsUJoAp8f8bUW2iJ3PDb3Dt/K0hKWYI9vMNTshYESFZEDsbhOn6?=\n\t=?utf-8?q?X2CmHt5U0K4u9iemyAFqPkHX+M48I75se4bXnnnO5E/RDHcdKSwZfhah?=\n\t=?utf-8?q?6II46fjVyRg1Ndn/cT0ulVcT6U7tH5WmBB+W3Yc6umefdLbC2McMzv/k?=\n\t=?utf-8?q?UPLpbRY8m368cYuPXeBKAXPtZf+BroWO+6Wr+ANy4Yf3YXg/l9MXCYJU?=\n\t=?utf-8?q?99QfF1oVGy+qshfdw7/fBbEiP4Nx4YvemTu9FsRo9EYZtEehj5ljcjRl?=\n\t=?utf-8?q?lQb8qIWV7cAUIuYJDifFV5iV+IFHTp1ZI1HEiEfBQ/lW8P/Fh7aNUb9E?=\n\t=?utf-8?q?LI6EwltjSAEW8OET6sXI2TOiAYUA08akMgs7kjUKxs3Z5lrxgF4WUZQ6?=\n\t=?utf-8?q?hYogr+DkpZpbBDXT9tsgrgFeAAdV2ojsUhNa3gfrEvf//y80cHmfi420?=\n\t=?utf-8?q?aFZalIaFN8GiaMCNABzBnKwecY9+dIOT5OP9gx4Fcc0bGhX7gnqbfiV0?=\n\t=?utf-8?q?YGxqd5cHyNi5b7TSvl60weBaDhvEr8izHtfyNOSmi8SBI5Hkj7Dv+dbH?=\n\t=?utf-8?q?v5e8ybbVSM2TE3GveFFF5UNVuoHbuNpbTQ1HMUQGwNZlKLJy1eqnhtP7?=\n\t=?utf-8?q?OUePwicT66dg4MkFdg0brbnvh2Vu+svqjFHof3RzJ3cJ9gnkNtNAmfVM?=\n\t=?utf-8?q?T2Cp1SiRcrqEqDEUN4tbB3wBHkgjJ60hMgiyhkvWGYZUEzCvArQLAGHb?=\n\t=?utf-8?q?3sk1cGwfoOOMuwEOTCRozOgkFqJjCmCqH8phuNlCCuOpPo+CJqeVL4r3?=\n\t=?utf-8?b?R2M9?=","X-OriginatorOrg":"wolfvision.net","X-MS-Exchange-CrossTenant-Network-Message-Id":"c527fe1b-4043-45da-6639-08db21246888","X-MS-Exchange-CrossTenant-AuthSource":"DU0PR08MB9155.eurprd08.prod.outlook.com","X-MS-Exchange-CrossTenant-AuthAs":"Internal","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"10 Mar 2023 05:00:46.1084\n\t(UTC)","X-MS-Exchange-CrossTenant-FromEntityHeader":"Hosted","X-MS-Exchange-CrossTenant-Id":"e94ec9da-9183-471e-83b3-51baa8eb804f","X-MS-Exchange-CrossTenant-MailboxType":"HOSTED","X-MS-Exchange-CrossTenant-UserPrincipalName":"/F3u51GjR0H/7P7S/LaViJ/7w38X+KcNG7xRdFQpvKrmL2FkIapGBaDUlUw5wncfaCi8MxGSJsqt20z4S4g57NlXpylxdLw2dfR+DDBu0QY=","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"DBAPR08MB5608","Subject":"Re: [libcamera-devel] [PATCH] meson: Fix git version parsing","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Michael Riesch via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Michael Riesch <michael.riesch@wolfvision.net>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":26623,"web_url":"https://patchwork.libcamera.org/comment/26623/","msgid":"<20230310113055.GE5342@pendragon.ideasonboard.com>","date":"2023-03-10T11:30:55","subject":"Re: [libcamera-devel] [PATCH] meson: Fix git version parsing","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Michael,\n\nOn Fri, Mar 10, 2023 at 06:00:43AM +0100, Michael Riesch wrote:\n> On 3/9/23 18:37, Kieran Bingham wrote:\n> > Quoting Laurent Pinchart (2023-03-09 17:21:15)\n> >> When extracting the build metadata from the git version, we use the\n> >> string strip() method to remove the version prefix. This is incorrect,\n> >> as the strip() method takes a set of characters to be removed, not a\n> >> literal string. Fix it by splitting the git version string on the '+'\n> >> character and keeping the suffix.\n> >>\n> >> Fixes: 02518e598e8f (\"meson: Rewrite .replace usage\")\n> >> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> >> ---\n> >>  meson.build | 4 ++--\n> >>  1 file changed, 2 insertions(+), 2 deletions(-)\n> >>\n> >> diff --git a/meson.build b/meson.build\n> >> index 0f89b45a0169..189e97736d90 100644\n> >> --- a/meson.build\n> >> +++ b/meson.build\n> >> @@ -41,8 +41,8 @@ if libcamera_version != project_version\n> >>  \n> >>      # Replace the version components reported by git with the release version,\n> >>      # but keep all trailing information supplied by git.\n> >> -    libcamera_git_version = (project_version +\n> >> -                             libcamera_git_version.strip(libcamera_version))\n> >> +    libcamera_git_version = (project_version + '+' +\n> >> +                             libcamera_git_version.split('+')[1])\n> \n> Is it safe to assume that metadata is present in this case, i.e., the\n> list produced by libcamera_git_version.split('+') contains at least two\n> entries?\n\nGood point. I don't think it should happen in practice, as this code is\nonly reached when the meson and git version don't match, and in that\ncase I wouldn't expect the branch HEAD to point to a tag, so there\nshould be a '+' sign. Nonetheless, I think we should fix it.\n\nThere's also an issue if the string contains multiple '+', which can be\nthe case when the build metadata contain a timestamp with a timezone.\nmeson doesn't support arrays slicing (e.g. .split('+')[1:]), and has no\nstring .length() method that would allow us to use .substring(). I'll\nsee what I can do.\n\n> With that addressed:\n> \n> Reviewed-by: Michael Riesch <michael.riesch@wolfvision.net>\n> \n> Best regards,\n> Michael\n> \n> > Looks too obvious. Why didn't I use this in the first place ;-)\n> > \n> > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > \n> >>      libcamera_version = project_version\n> >>  \n> >>      # Append a marker to show we have modified this version string\n> >>\n> >> base-commit: f852b7fbc4960ea83bab49b75408fb13462db8ba","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 33026BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 10 Mar 2023 11:30:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8DE9961ED6;\n\tFri, 10 Mar 2023 12:30:54 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 246F8603B1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Mar 2023 12:30:53 +0100 (CET)","from pendragon.ideasonboard.com\n\t(117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9E63AEF;\n\tFri, 10 Mar 2023 12:30:52 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1678447854;\n\tbh=U0BC5ATs+jNk5cIuE96olnEDksXja4WkXZTqnRLxvXM=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=z4k1zNMZXRUyRJyyy75OgFgyyaESm7UHjHq2Abx9xRHW3HPueyCmBUlOtifTCL5RU\n\tjWT9mLtNj8koHQVYWcVLUdaQo9+jolCMZNmm3Y0yaiuVbGtS9vQJXdEcmKWMTfCLXn\n\tt10QAc6YrRbnujYLXn0YRPtPSSgx74eUSC7LuYg7eRyfxTtnus/pKNteQN/xswBbd+\n\tPskg2OI6PIT9chqYxwFAt1jWUF3P7Gn62yh+xJdoQROvTi2QMUem1eF6QrTZpP/ALt\n\txa3Cc3KyUYV6yZwL1qOGdwGl+GFZ/zY1ZeQ2X3YfP6s6lp37APkQkAG3e21l4+QHle\n\touR3hzmNGjDKA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1678447852;\n\tbh=U0BC5ATs+jNk5cIuE96olnEDksXja4WkXZTqnRLxvXM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=lu44JlXLyu3vSv08e6/vnXbkKkDeAa0xIUqry4x3Xt5+8ydgbLWr/Zk1wgwoRzRP6\n\tZLdJvkb+1YdYl8cwfjfWMl1pQ7Tpz1zL9iy/cNvGOmevA1/6WTYHmHkJMHed7457bR\n\tqC38kEDEbnys7QaHrsfaQRbs4Cue97GM+T37lIow="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"lu44JlXL\"; dkim-atps=neutral","Date":"Fri, 10 Mar 2023 13:30:55 +0200","To":"Michael Riesch <michael.riesch@wolfvision.net>","Message-ID":"<20230310113055.GE5342@pendragon.ideasonboard.com>","References":"<20230309172115.15216-1-laurent.pinchart@ideasonboard.com>\n\t<167838342353.3936253.13123913770371163025@Monstersaurus>\n\t<0f31d063-7483-dad8-7527-2dc16e9d791d@wolfvision.net>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<0f31d063-7483-dad8-7527-2dc16e9d791d@wolfvision.net>","Subject":"Re: [libcamera-devel] [PATCH] meson: Fix git version parsing","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]