From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRENJ-00034l-3K for ptxdist@pengutronix.de; Tue, 30 Mar 2021 15:25:41 +0200 Received: from [2a0a:edc0:0:1101:1d::39] (helo=dude03.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1lRENI-0003g2-K1 for ptxdist@pengutronix.de; Tue, 30 Mar 2021 15:25:40 +0200 Received: from mol by dude03.red.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1lRENI-00HWhZ-G3 for ptxdist@pengutronix.de; Tue, 30 Mar 2021 15:25:40 +0200 Date: Tue, 30 Mar 2021 15:25:40 +0200 From: Michael Olbrich Message-ID: <20210330132540.GC4162561@pengutronix.de> References: <20210330075202.7928-1-s.trumtrar@pengutronix.de> <20210330092436.sobgqu3zs3jzhrr7@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210330092436.sobgqu3zs3jzhrr7@pengutronix.de> Subject: Re: [ptxdist] [PATCH 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: ptxdist@pengutronix.de On Tue, Mar 30, 2021 at 11:24:36AM +0200, Roland Hieber wrote: > On Tue, Mar 30, 2021 at 09:52:01AM +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 > > --- > > 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 > > +# > > +# 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))" > > Add a --tags here so it also uses non-annotated tags. That's always a bit problematic: I've seen projects that use annotated tags for releases and other tags for random stuff. Maybe: git describe 2>/dev/null || git describe --always --tags Michael > - Roland > > > + > > + 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 > > > > -- > 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 > _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de