From patchwork Sun Jan 22 00:42:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1730139 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=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=L748WT2N; 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 4P0DwX4xFpz23hB for ; Mon, 23 Jan 2023 00:43:54 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A89168558A; Sun, 22 Jan 2023 14:43:01 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="L748WT2N"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2A0CA85321; Sun, 22 Jan 2023 01:42:21 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C286084474 for ; Sun, 22 Jan 2023 01:42:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ansuelsmth@gmail.com Received: by mail-wm1-x32e.google.com with SMTP id l8so6602392wms.3 for ; Sat, 21 Jan 2023 16:42:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=CvEZPryu7dYxvdRZ/WozVVnDrwdiOP0oSwHhGVNQ51Y=; b=L748WT2NICIstZS37ef/iHvE/DCltcZMG1iHo4Qwb5fZyIPk2qJdILnpfQADU+sdTe TwKuCaIr0vklObLQgiBIM1bM7T+BF/UZTHmanQ86oX6Qga0BNigsn+ofUMG7HV412J3u izraY7+S3t4V6hZg0lBo7yX7TygTD/fVqA/UyKx0MING4Bw8zvl0mJqq5R6MQrKdd/i9 GlcxPABqaM2Yd+xbNhQStMujhmYyyAQ3vy0EB+xJKQQLbyNveOdwXjfGZeO+LL67IOdF Zb/ZT3x884ghhLsWS8WMujZ4CInfpP0OKJIAEWhAfFwWDO+tyyOswwLRnFUJqWMTXo/9 MePg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CvEZPryu7dYxvdRZ/WozVVnDrwdiOP0oSwHhGVNQ51Y=; b=Xa+ypBMNweOA1lYBlL+1bjSL1oJ245frfN2ZyppFozD8JVKro/9Cuezkr96QdrGdWI b5ZRJpoCbbOTOmDGfTBxuJQLoD+0AO89Wu/AsQolpe+cbnFvNuHR0twKKX5D+GweDtWo rbOUvQC5YP8CF0/m7yhSnuIdJgSZQmfWDEm4/pG+Pbg8quFhSfvVTVPVKP0V52IIoexl HODyM3nRNiFoEfNRjwEiYCIHmrniohG8UeApeHyLnLP6Qv8xChhK6efK/ebPew7jpS1A zVvbkftidBsfDdhenpP40bWE6wT56V/hkThm1bbK+0vOED2aY60buH24MFTvWVT+xqZO pSRg== X-Gm-Message-State: AFqh2kqmAXOTR+koLypCqYQssLVhF/HDpXqgRz7wXinOmB51gG3QYdHL dknFTjgzMjKh+lsnszFfRKo= X-Google-Smtp-Source: AMrXdXunrWC4zFjQzeKS0e2E9cfgsZEToyL6qOOy7LJTKPq/FExvNv15QF+t78liCpunzbvJkZeLZQ== X-Received: by 2002:a05:600c:5108:b0:3d3:49db:d84 with SMTP id o8-20020a05600c510800b003d349db0d84mr18577464wms.20.1674348138012; Sat, 21 Jan 2023 16:42:18 -0800 (PST) Received: from localhost.localdomain (93-34-92-88.ip49.fastwebnet.it. [93.34.92.88]) by smtp.googlemail.com with ESMTPSA id z12-20020adfd0cc000000b002bdff778d87sm16201616wrh.34.2023.01.21.16.42.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Jan 2023 16:42:17 -0800 (PST) From: Christian Marangi To: Simon Glass , =?utf-8?q?Pali_Roh=C3=A1r?= , Heinrich Schuchardt , =?utf-8?q?Marek_Beh=C3=BAn?= , Quentin Schulz , u-boot@lists.denx.de Cc: Christian Marangi Subject: [PATCH] Makefile: fix shell error for darwin major/minor version check Date: Sun, 22 Jan 2023 01:42:10 +0100 Message-Id: <20230122004210.26791-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 22 Jan 2023 14:42:59 +0100 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.6 at phobos.denx.de X-Virus-Status: Clean Fix shell error: /bin/sh: line 0: [: too many arguments for the darwin major/minor version check. It seems for os_x_before for some reason DARWIN_MAJOR_VERSION and DARWIN_MINOR_VERSION are empty. To fix this set DARWIN_MAJOR_VERSION and DARWIN_MINOR_VERSION to be evaluated once so the value is retained. Signed-off-by: Christian Marangi Reviewed-by: Simon Glass --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index eb354c045c..fceac081c8 100644 --- a/Makefile +++ b/Makefile @@ -318,8 +318,8 @@ endif # ifeq ($(HOSTOS),darwin) # get major and minor product version (e.g. '10' and '6' for Snow Leopard) -DARWIN_MAJOR_VERSION = $(shell sw_vers -productVersion | cut -f 1 -d '.') -DARWIN_MINOR_VERSION = $(shell sw_vers -productVersion | cut -f 2 -d '.') +DARWIN_MAJOR_VERSION := $(shell sw_vers -productVersion | cut -f 1 -d '.') +DARWIN_MINOR_VERSION := $(shell sw_vers -productVersion | cut -f 2 -d '.') os_x_before = $(shell if [ $(DARWIN_MAJOR_VERSION) -le $(1) -a \ $(DARWIN_MINOR_VERSION) -le $(2) ] ; then echo "$(3)"; else echo "$(4)"; fi ;)