mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 1/2] ptxd_make_vcs_version: add script to determine vcs hash
@ 2021-03-30  7:52 Steffen Trumtrar
  2021-03-30  7:52 ` [ptxdist] [PATCH 2/2] rules: barebox: support barebox buildsystem_version Steffen Trumtrar
  2021-03-30  9:24 ` [ptxdist] [PATCH 1/2] ptxd_make_vcs_version: add script to determine vcs hash Roland Hieber
  0 siblings, 2 replies; 4+ messages in thread
From: Steffen Trumtrar @ 2021-03-30  7:52 UTC (permalink / raw)
  To: ptxdist

Add a script to determine a uniquely abbreviated commit object of the
current bsp state. The information is exported to the variable
PTXDIST_VCS_VERSION so it can be used from other scripts and rules.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
 scripts/lib/ptxd_make_vcs_version.sh | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 scripts/lib/ptxd_make_vcs_version.sh

diff --git a/scripts/lib/ptxd_make_vcs_version.sh b/scripts/lib/ptxd_make_vcs_version.sh
new file mode 100644
index 000000000000..680fb38ff818
--- /dev/null
+++ b/scripts/lib/ptxd_make_vcs_version.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+#
+# Copyright (C) 2020 by Steffen Trumtrar <s.trumtrar@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+ptxd_make_vcs_version() {
+    PTXDIST_VCS_VERSION="$(echo $(git describe --always))"
+
+    if [ -z "${PTXDIST_VCS_VERSION}" ]; then
+       PTXDIST_BUILD_VERSION_VCS="unknown"
+    fi
+
+    export PTXDIST_VCS_VERSION
+}
+export -f ptxd_make_vcs_version
+
+ptxd_make_vcs_version
-- 
2.29.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-30 13:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30  7:52 [ptxdist] [PATCH 1/2] ptxd_make_vcs_version: add script to determine vcs hash Steffen Trumtrar
2021-03-30  7:52 ` [ptxdist] [PATCH 2/2] rules: barebox: support barebox buildsystem_version Steffen Trumtrar
2021-03-30  9:24 ` [ptxdist] [PATCH 1/2] ptxd_make_vcs_version: add script to determine vcs hash Roland Hieber
2021-03-30 13:25   ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox