From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0] helo=leviathan.pengutronix.de) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRr3V-0002dR-VN for ptxdist@pengutronix.de; Thu, 01 Apr 2021 08:43:50 +0200 References: <20210401045252.916-1-s.trumtrar@pengutronix.de> <20210401054618.GI8755@pengutronix.de> From: Steffen Trumtrar In-reply-to: <20210401054618.GI8755@pengutronix.de> Date: Thu, 01 Apr 2021 08:43:48 +0200 Message-ID: <87v996bj2z.fsf@pengutronix.de> MIME-Version: 1.0 Subject: Re: [ptxdist] [PATCH v2 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 Michael Olbrich writes: > 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 >> --- >> 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 >> +# >> +# 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. > Ok. >> + >> + 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? > Right, of course. Best regards, Steffen -- Pengutronix e.K. | Dipl.-Inform. Steffen Trumtrar | 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