From patchwork Mon Feb 27 21:15:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 18315 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 06553BE08A for ; Mon, 27 Feb 2023 21:15:20 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 398396265A; Mon, 27 Feb 2023 22:15:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1677532519; bh=jENDUjcdMzFowE17qK9JCOrQmpcbwVX5374cRXtI38I=; h=To:Date:List-Id:List-Post:From:List-Subscribe:List-Unsubscribe: List-Archive:Reply-To:List-Help:Subject:From; b=VZUDEC42YfYnIEQjFwyl3X9ALb3CM6KhlFZPiEys522RuWmgBiFTEmTnAna1RN7pa PgeHJS4q+CXI9+XSUc13i1+xn4seX6SiBq6cuzSjQWVmHYu2TdFvX2ocJUrb2Md86F KBnxj1kZLFodm9gCau15s2Yr6PP9uf6jf0o2JLzQRYsV+2fuRYwy+qu3z2QRbDTWM8 l09+JS+BobjNovBwjKgFK2JBu9JxYKfQ2DOcPEFrsX2K6q8xWLKz5v0nBHVtL311ck hngM+Q0xdJuuw1KdjT5fqur8kMB7EhkX0R7Bn40LbimTU0drWzDNnlDtL2Hr3XeCNR X3ML1VtnSGJ5A== To: libcamera-devel@lists.libcamera.org Date: Mon, 27 Feb 2023 22:15:04 +0100 MIME-Version: 1.0 Message-ID: List-Id: List-Post: X-Patchwork-Original-From: Michael Riesch via libcamera-devel From: Michael Riesch Precedence: list X-Mailman-Version: 2.1.29 X-BeenThere: libcamera-devel@lists.libcamera.org List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: Michael Riesch List-Help: Subject: [libcamera-devel] [PATCH v2] meson: Align handling of build metadata Content-Disposition: inline Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The build metadata is split off correctly from the version string obtained with utils/gen-version.sh, but for the meson project version this step is not carried out. However, since libcamera uses Semantic Versioning, it should be possible to add build metadata to the meson project version. Align the handling of the build metadata to resolve this mismatch. Signed-off-by: Michael Riesch --- v2 of this series follows a discussion with kbingham in #libcamera Changes in v2: - revise patch message to reflect the current mismatch and the proposed fix better - introduce the 'project_version' variable to avoid three .split() operations meson.build | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 9eee9d39..c8222338 100644 --- a/meson.build +++ b/meson.build @@ -25,13 +25,14 @@ if libcamera_git_version == '' endif libcamera_version = libcamera_git_version.split('+')[0] +project_version = meson.project_version().split('+')[0] # A shallow clone, or a clone without a reachable tag equivalent to the # meson.project_version() could leave the project in a mis-described state. # Produce a warning in this event, and fix to a best effort. -if libcamera_version != meson.project_version() +if libcamera_version != project_version warning('The sources disagree about the version: ' - + libcamera_version + ' != ' + meson.project_version()) + + libcamera_version + ' != ' + project_version) summary({'libcamera git version' : libcamera_git_version, 'Source version match' : false, @@ -40,9 +41,9 @@ if libcamera_version != meson.project_version() # Replace the version components reported by git with the release version, # but keep all trailing information supplied by git. - libcamera_git_version = (meson.project_version() + + libcamera_version = project_version + libcamera_git_version = (libcamera_version + libcamera_git_version.strip(libcamera_version)) - libcamera_version = meson.project_version() # Append a marker to show we have modified this version string libcamera_git_version += '-nvm'