From patchwork Wed Aug 5 20:47:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 9243 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 94FFFBD86F for ; Wed, 5 Aug 2020 20:47:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 200A86059F; Wed, 5 Aug 2020 22:47:16 +0200 (CEST) Received: from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net [195.74.38.229]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id EDC886039D for ; Wed, 5 Aug 2020 22:47:14 +0200 (CEST) X-Halon-ID: d2fd844b-d75c-11ea-a39b-005056917f90 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p54ac52a8.dip0.t-ipconnect.de [84.172.82.168]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA id d2fd844b-d75c-11ea-a39b-005056917f90; Wed, 05 Aug 2020 22:47:13 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Wed, 5 Aug 2020 22:47:03 +0200 Message-Id: <20200805204703.2532732-1-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3] libcamera: Add build time to version string for dirty builds X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Having the build time in the version string is useful when building from a dirty worktree and deploying to targets as a quick way to identify the binary has been deployed successfully. Before this change the version string is reported as libcamera v0.0.0+1692-aaff196a-dirty While with this change the version string is reported as libcamera v0.0.0+1692-aaff196a-dirty (2020-08-05T22:42:18+02:00) Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- * Changes since v2 - Wrap timestmap between parentheses - Print time in local timezone - Fix spelling in commit message --- utils/gen-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/gen-version.sh b/utils/gen-version.sh index 7f7872ceba7b038a..b09ad495f86a7a58 100755 --- a/utils/gen-version.sh +++ b/utils/gen-version.sh @@ -26,7 +26,7 @@ if [ -z "$build_dir" ] || (echo "$build_dir" | grep -q "$src_dir") then git update-index --refresh > /dev/null 2>&1 fi -git diff-index --quiet HEAD || version="$version-dirty" +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'.