From patchwork Wed May 3 10:23:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Hundeb=C3=B8ll?= X-Patchwork-Id: 1776469 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="key not found in DNS" header.d=geanix.com header.i=@geanix.com header.a=rsa-sha256 header.s=first header.b=QkDAlOGo; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QBCjC0FWyz20fg for ; Wed, 3 May 2023 20:23:57 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A47B684756; Wed, 3 May 2023 12:23:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=geanix.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=geanix.com header.i=@geanix.com header.b="QkDAlOGo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4BA5584757; Wed, 3 May 2023 12:23:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 Received: from first.geanix.com (first.geanix.com [116.203.34.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2BA75846CB for ; Wed, 3 May 2023 12:23:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=geanix.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=martin@geanix.com Received: from xps.lan (85.184.138.13.dynamic.dhcp.aura-net.dk [85.184.138.13]) by first.geanix.com (Postfix) with ESMTPSA id 1E2544E4489; Wed, 3 May 2023 10:23:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=geanix.com; s=first; t=1683109423; bh=ITS3JEAICWJUPeD+SNhAxHYwmZns5jnmNcs4mpUa7SI=; h=From:To:Cc:Subject:Date; b=QkDAlOGoKXTqSsRLRIJzLeSSNrbHkwVwOv6YC6KBtmU0/OxS6Ih24xRTZQiMnpCIU sUZZoSwplBOpYz+WpRF7DQWaB8a7lvIIyv+J5OYKDN2UMH2ALpCvLzIYL049/Ng6bs eiDod0x8GcRggF27EikCeFBTItBCcFPfUeBx+cLUsWTZKFre4YgO3bEhog+dENKHDm AYKyvv17zumADFjPWGZqpsw1Dicgl4XU19dNsAMmySrPXKzsCtcUyhf4N054e3YGfE kueReVnodaH3pD1T4SHFTB+0o0K4CobhqT8dw8tagphWnDKzsHi66ICPRCHivmKXZN gJY6tWY3vhyDA== From: =?utf-8?q?Martin_Hundeb=C3=B8ll?= To: Simon Glass , u-boot@lists.denx.de Cc: =?utf-8?q?Martin_Hundeb=C3=B8ll?= Subject: [PATCH] scripts: dtc-version: support git version strings too Date: Wed, 3 May 2023 12:23:39 +0200 Message-Id: <20230503102339.94626-1-martin@geanix.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Building dtc from git causes the version number to start with a 'v' (e.g. v1.7.0). printf then fails to parse 'v1' as a decimal value, and prints '000700' instead of '010700'. Subsequently, the build fails, because '000700' is less than the required '010400' version. Signed-off-by: Martin Hundebøll --- scripts/dtc-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dtc-version.sh b/scripts/dtc-version.sh index bfb514e179..53ff868bcd 100755 --- a/scripts/dtc-version.sh +++ b/scripts/dtc-version.sh @@ -20,7 +20,7 @@ if ! which $dtc >/dev/null ; then exit 1 fi -MAJOR=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 1) +MAJOR=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 1 | tr -d v) MINOR=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 2) PATCH=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 3 | cut -d - -f 1)