[libcamera-devel] [PATCH] libcamera: Add build time to version string
Niklas Söderlund
niklas.soderlund at ragnatech.se
Wed Aug 5 14:57:00 CEST 2020
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 have 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-05T12:55:11+00:00
Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
---
utils/gen-version.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/utils/gen-version.sh b/utils/gen-version.sh
index 7f7872ceba7b038a..93bc97d6d8a8a24a 100755
--- a/utils/gen-version.sh
+++ b/utils/gen-version.sh
@@ -32,4 +32,6 @@ git diff-index --quiet HEAD || version="$version-dirty"
# of the git SHA1 and remove the initial 'v'.
version=$(echo "$version" | sed -e 's/-/+/' | sed -e 's/-g/-/' | cut -c 2-)
-echo "$version"
+buildtime=$(date --iso-8601=seconds --utc)
+
+echo "$version $buildtime"
--
2.28.0
More information about the libcamera-devel
mailing list