[{"id":25422,"web_url":"https://patchwork.libcamera.org/comment/25422/","msgid":"<Y0mdrPVjneMNEvUF@pendragon.ideasonboard.com>","date":"2022-10-14T17:34:36","subject":"Re: [libcamera-devel] [PATCH] meson: Rewrite .replace usage","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the patch.\n\nOn Fri, Oct 14, 2022 at 05:46:30PM +0100, Kieran Bingham via libcamera-devel wrote:\n> Meson introduces a .replace() method in version 0.58.0. However we aim\n\ns/introduces/introduced/\n\n> to restrict ourselves to 0.56 meson features, as released by Debian\n> stable.\n> \n> The recent introduction of release management infrastructure makes use\n> of the .replace() method to fix up the version string when there is a\n> mis-match between the release version and any (lack) of tags in the git\n> version description. This breaks when built on systems with only meson\n> 0.56.\n> \n> Refactor this to use a concatenation of the project version and a\n> stripped git version to regenerate the full source version string that\n> will be reported by libcamera.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  meson.build | 6 ++++--\n>  1 file changed, 4 insertions(+), 2 deletions(-)\n> \n> diff --git a/meson.build b/meson.build\n> index 56910698988d..f218b8c2b296 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -38,8 +38,10 @@ if libcamera_version != meson.project_version()\n>              },\n>              bool_yn : true, section : 'Versions')\n>  \n> -    libcamera_git_version = libcamera_git_version.replace(libcamera_version,\n> -                                                          meson.project_version())\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 = (meson.project_version() +\n> +                             libcamera_git_version.strip(libcamera_version))\n>      libcamera_version = meson.project_version()\n>  \n>      # Append a marker to show we have modified this version string","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 EFCE6BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 14 Oct 2022 17:34:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3967862DC2;\n\tFri, 14 Oct 2022 19:34:41 +0200 (CEST)","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 C281462D8E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 14 Oct 2022 19:34:39 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 17DCC6DE;\n\tFri, 14 Oct 2022 19:34:39 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1665768881;\n\tbh=ucH+Y189curSo5JkYKdTQroFuxXLoO0uIKsPmG2GuQ4=;\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=Z4LDUjdTDKxWI1FtM+B9HhAEgOrN5JdEHULQGL9aAMnuhhKq7O9f59JAOpXozr2F3\n\t86tSOQOGKuuQA+vdffsWfln2wJLjJxx1qVsXAFU2KOjG3rscgWW7fPSICWlvTTIAAM\n\tOVtcnC+tFY//9m9wTuUBT6ISoHNzv4/bDCXzoOueZPmcF6n1JcKl/hvy5Nx/CXwpmV\n\twnUG0FqzNC+RUmIHS4Qncsnk7A9o6HqzdbHxudHKns/W488Pv4SFH0gZdd0ghyM5eO\n\tGK9vaVmXrsy+KFAKqzdn4wHv3lzqL3VVmuQOx2hdwyey9DI9oX9JFgBIhzJ0f5jtkw\n\tDN5F9ZWbnGo4Q==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1665768879;\n\tbh=ucH+Y189curSo5JkYKdTQroFuxXLoO0uIKsPmG2GuQ4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=NkUuaq0xND+Sqs1+oBJqGv/EqFf/YslP62eY1Quy+ETbGEuhVEHAHigSJ5TdmDJP7\n\tSkkmTQltSM/4m/zjWvqV9x1KEr02AcP/7pHSsRBBfkXd86C8351+Feb15ONK/TG9Yf\n\t2u3iLkasy6/AjqKM0GmEm2dvIxKW/2EEKNVySmV0="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"NkUuaq0x\"; dkim-atps=neutral","Date":"Fri, 14 Oct 2022 20:34:36 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<Y0mdrPVjneMNEvUF@pendragon.ideasonboard.com>","References":"<20221014164630.2847301-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20221014164630.2847301-1-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] meson: Rewrite .replace usage","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 <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]