* [PATCH] Makefile: fix shell error for darwin major/minor version check
@ 2023-01-22 0:42 Christian Marangi
2023-01-23 18:49 ` Simon Glass
2023-02-07 16:53 ` Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Christian Marangi @ 2023-01-22 0:42 UTC (permalink / raw)
To: Simon Glass, Pali Rohár, Heinrich Schuchardt,
Marek Behún, Quentin Schulz, u-boot
Cc: Christian Marangi
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 <ansuelsmth@gmail.com>
---
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 ;)
--
2.38.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Makefile: fix shell error for darwin major/minor version check
2023-01-22 0:42 [PATCH] Makefile: fix shell error for darwin major/minor version check Christian Marangi
@ 2023-01-23 18:49 ` Simon Glass
2023-02-07 16:53 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2023-01-23 18:49 UTC (permalink / raw)
To: Christian Marangi
Cc: Pali Rohár, Heinrich Schuchardt, Marek Behún,
Quentin Schulz, u-boot
On Sat, 21 Jan 2023 at 17:42, Christian Marangi <ansuelsmth@gmail.com> wrote:
>
> 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 <ansuelsmth@gmail.com>
> ---
> Makefile | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Makefile: fix shell error for darwin major/minor version check
2023-01-22 0:42 [PATCH] Makefile: fix shell error for darwin major/minor version check Christian Marangi
2023-01-23 18:49 ` Simon Glass
@ 2023-02-07 16:53 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2023-02-07 16:53 UTC (permalink / raw)
To: Christian Marangi
Cc: Simon Glass, Pali Rohár, Heinrich Schuchardt,
Marek Behún, Quentin Schulz, u-boot
[-- Attachment #1: Type: text/plain, Size: 561 bytes --]
On Sun, Jan 22, 2023 at 01:42:10AM +0100, Christian Marangi wrote:
> 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 <ansuelsmth@gmail.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
Applied to u-boot/master, thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-02-07 16:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-22 0:42 [PATCH] Makefile: fix shell error for darwin major/minor version check Christian Marangi
2023-01-23 18:49 ` Simon Glass
2023-02-07 16:53 ` Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.