From patchwork Wed Sep 15 20:36:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 13858 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by patchwork.libcamera.org (Postfix) with ESMTPS id 227E2BDC71 for ; Wed, 15 Sep 2021 20:36:45 +0000 (UTC) Received: from localhost.localdomain (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B82D22A5; Wed, 15 Sep 2021 22:36:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1631738204; bh=L2OAxstbFr57gDxDiLXi5IVQYCSHK11Sm7L/1f5wGSA=; h=From:To:Cc:Subject:Date:From; b=pV+c1NeC1c2cSwBAS55946G+PKzCvLoIf62FkikJO59P3fHVcJbtPU/UZdfPznso8 co+HTY/BLIyEjbbzncNt3A0kFf/RsnbD6sYtHQOQvNjePaxgLYbUSOf3iZQl2y/xyW sdzF0JokOzDNV0lMiKyxNYqDHJWCO6plXWplR0yk= From: Kieran Bingham To: Cc: Kieran Bingham Subject: [PATCH] utils: gen-version: Remove redundant character Date: Wed, 15 Sep 2021 21:36:39 +0100 Message-Id: <20210915203639.796795-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 The 'g' version prefix, is added and then stripped. Prevent adding it in the first place, to simplify the implementation. Signed-off-by: Kieran Bingham --- utils/gen-version.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/gen-version.sh b/utils/gen-version.sh index b09ad495f86a..34d5d969311c 100755 --- a/utils/gen-version.sh +++ b/utils/gen-version.sh @@ -17,7 +17,7 @@ then # Handle an un-tagged repository sha=$(git describe --abbrev=8 --always 2>/dev/null) commits=$(git log --oneline | wc -l 2>/dev/null) - version="v0.0.0-$commits-g$sha" + version="v0.0.0-$commits-$sha" fi # Append a '-dirty' suffix if the working tree is dirty. Prevent false @@ -28,8 +28,8 @@ then fi git diff-index --quiet HEAD || version="$version-dirty ($(date --iso-8601=seconds))" -# Replace first '-' with a '+' to denote build metadata, strip the 'g' in from -# of the git SHA1 and remove the initial 'v'. -version=$(echo "$version" | sed -e 's/-/+/' | sed -e 's/-g/-/' | cut -c 2-) +# Replace first '-' with a '+' to denote build metadata, and remove the initial +# 'v'. +version=$(echo "$version" | sed -e 's/-/+/' | cut -c 2-) echo "$version"