On Thu, Apr 01, 2021 at 06:52:51AM +0200, Steffen Trumtrar wrote:
> 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 <[email protected]>
> ---
> changes in v2:
>     - use "--tags" in git describe
> 
>  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..07856db967b4
> --- /dev/null
> +++ b/scripts/lib/ptxd_make_vcs_version.sh
> @@ -0,0 +1,20 @@
> +#!/bin/bash
> +#
> +# Copyright (C) 2020 by Steffen Trumtrar <[email protected]>
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +ptxd_make_vcs_version() {
> +    PTXDIST_VCS_VERSION="$(echo $(git describe 2>/dev/null || git describe 
> --always --tags))"

We should probably redirect stderr for the second git command as well.

> +
> +    if [ -z "${PTXDIST_VCS_VERSION}" ]; then
> +       PTXDIST_BUILD_VERSION_VCS="unknown"

Wrong indention (on tab here). And this should be:

        PTXDIST_VCS_VERSION="unknown"

right?

Michael

> +    fi
> +
> +    export PTXDIST_VCS_VERSION
> +}
> +export -f ptxd_make_vcs_version
> +
> +ptxd_make_vcs_version
> -- 
> 2.29.2
> 
> 
> _______________________________________________
> ptxdist mailing list
> [email protected]
> To unsubscribe, send a mail with subject "unsubscribe" to 
> [email protected]
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
[email protected]
To unsubscribe, send a mail with subject "unsubscribe" to 
[email protected]

Reply via email to