From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Date: Wed, 7 Apr 2021 16:43:58 +0200 From: Michael Olbrich Message-ID: <20210407144358.GB8755@pengutronix.de> References: <20210401083641.9251-1-s.trumtrar@pengutronix.de> <20210404171640.j5lz6yw7wccxhlbm@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210404171640.j5lz6yw7wccxhlbm@pengutronix.de> Subject: Re: [ptxdist] [PATCH v3 1/2] ptxd_make_vcs_version: add script to determine vcs hash List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: Steffen Trumtrar Cc: ptxdist@pengutronix.de, Roland Hieber On Sun, Apr 04, 2021 at 07:16:40PM +0200, Roland Hieber wrote: > On Thu, Apr 01, 2021 at 10:36:40AM +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 > > --- > > changes in v3: > > - redirect stderr on second git call, too > > - fix PTXDIST_BUILD_VERSION_VCS -> PTXDIST_VCS_VERSION > > - fix whitespace on indent > > > > changes in v2: > > - use "--tags" in git describe > > > > scripts/lib/ptxd_make_vcs_version.sh | 22 ++++++++++++++++++++++ > > 1 file changed, 22 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..338658aa789f > > --- /dev/null > > +++ b/scripts/lib/ptxd_make_vcs_version.sh > > @@ -0,0 +1,22 @@ > > +#!/bin/bash > > +# > > +# Copyright (C) 2020 by Steffen Trumtrar > > +# > > +# 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 2>/dev/null))" > > Hmm, why do you do an additional echo here when git-describe already > outputs the thing? Steffen? I can do a local fixup to drop the echo, but I need to know if there is a reason to keep it. Michael > > + > > + if [ -z "${PTXDIST_VCS_VERSION}" ]; then > > + PTXDIST_VCS_VERSION="unknown" > > + fi > > + > > + export PTXDIST_VCS_VERSION > > +} > > +export -f ptxd_make_vcs_version > > + > > +ptxd_make_vcs_version > > -- > > 2.29.2 > > -- > Roland Hieber, Pengutronix e.K. | r.hieber@pengutronix.de | > Steuerwalder Str. 21 | https://www.pengutronix.de/ | > 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | > > _______________________________________________ > ptxdist mailing list > ptxdist@pengutronix.de > To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de > -- 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 ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de