Skip to contentSkip to conversation

Makefile: Avoid non-portable GNU sed extension

PATCH In review Mark Kettenis 3 participants 4 messages May 5, 2022 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: Avoid non-portable GNU sed extension

Use [:space:] instead of \s and \S in regular expression that determines the sandbox target architecture. Fixes the build failure on OpenBSD introduced with commit 4e65ca00f3a3 ("efi_loader: bootmgr: add booting from removable media").

Fixes f7691a6d73 ("sandbox: allow cross-compiling sandbox")
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index ea80f00716..6eceeb35b4 100644
@@ -21,7 +21,7 @@ include include/host_arch.h
 ifeq ("", "$(CROSS_COMPILE)")
   MK_ARCH="${shell uname -m}"
 else
-  MK_ARCH="${shell echo $(CROSS_COMPILE) | sed -n 's/^\s*\([^\/]*\/\)*\([^-]*\)-\S*/\2/p'}"
+  MK_ARCH="${shell echo $(CROSS_COMPILE) | sed -n 's/^[[:space:]]*\([^\/]*\/\)*\([^-]*\)-[^[:space:]]*/\2/p'}"
 endif
 unexport HOST_ARCH
 ifeq ("x86_64", $(MK_ARCH))
Signature · 1 line
2.36.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Mark Kettenis

Use [:space:] instead of \s and \S in regular expression that determines the sandbox target architecture. Fixes the build failure on OpenBSD introduced with commit 4e65ca00f3a3 ("efi_loader: bootmgr: add booting from removable media").

Fixes f7691a6d73 ("sandbox: allow cross-compiling sandbox")

nits, use 12 first digits of hash

Fixes f7691a6d736b ("sandbox: allow cross-compiling sandbox")
Quoted 1 line
Quoted 17 lines
---
  Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index ea80f00716..6eceeb35b4 100644
@@ -21,7 +21,7 @@ include include/host_arch.h
  ifeq ("", "$(CROSS_COMPILE)")
    MK_ARCH="${shell uname -m}"
  else
-  MK_ARCH="${shell echo $(CROSS_COMPILE) | sed -n 's/^\s*\([^\/]*\/\)*\([^-]*\)-\S*/\2/p'}"
+  MK_ARCH="${shell echo $(CROSS_COMPILE) | sed -n 's/^[[:space:]]*\([^\/]*\/\)*\([^-]*\)-[^[:space:]]*/\2/p'}"
  endif
  unexport HOST_ARCH
  ifeq ("x86_64", $(MK_ARCH))
#2 lore raw
Quoted 9 lines

Date: Thu, 5 May 2022 16:55:24 +0200
From: Heinrich Schuchardt <[email protected]>

Quoted 5 lines · Mark Kettenis

Use [:space:] instead of \s and \S in regular expression that determines the sandbox target architecture. Fixes the build failure on OpenBSD introduced with commit 4e65ca00f3a3 ("efi_loader: bootmgr: add booting from removable media").

Quoted 4 lines
Quoted 1 line
Fixes f7691a6d73 ("sandbox: allow cross-compiling sandbox")

nits, use 12 first digits of hash

Fixes f7691a6d736b ("sandbox: allow cross-compiling sandbox")

Hmm, checkpatch didn't catch that one. Is this something I should do a resubmit for?

Quoted 23 lines
Quoted 1 line
Quoted 17 lines
---
  Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index ea80f00716..6eceeb35b4 100644
@@ -21,7 +21,7 @@ include include/host_arch.h
  ifeq ("", "$(CROSS_COMPILE)")
    MK_ARCH="${shell uname -m}"
  else
-  MK_ARCH="${shell echo $(CROSS_COMPILE) | sed -n 's/^\s*\([^\/]*\/\)*\([^-]*\)-\S*/\2/p'}"
+  MK_ARCH="${shell echo $(CROSS_COMPILE) | sed -n 's/^[[:space:]]*\([^\/]*\/\)*\([^-]*\)-[^[:space:]]*/\2/p'}"
  endif
  unexport HOST_ARCH
  ifeq ("x86_64", $(MK_ARCH))
#3 lore raw

Am 5. Mai 2022 18:58:48 MESZ schrieb Mark Kettenis <[email protected]>:

Quoted 9 lines
Quoted 9 lines

Date: Thu, 5 May 2022 16:55:24 +0200
From: Heinrich Schuchardt <[email protected]>

Quoted 5 lines · Mark Kettenis

Use [:space:] instead of \s and \S in regular expression that determines the sandbox target architecture. Fixes the build failure on OpenBSD introduced with commit 4e65ca00f3a3 ("efi_loader: bootmgr: add booting from removable media").

Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Fixes f7691a6d73 ("sandbox: allow cross-compiling sandbox")

nits, use 12 first digits of hash

Fixes f7691a6d736b ("sandbox: allow cross-compiling sandbox")

Hmm, checkpatch didn't catch that one. Is this something I should do a resubmit for?

No. I will just consider it in my pull request.

Best regards

Heinrich

Quoted 24 lines
Quoted 24 lines
Quoted 2 lines
Quoted 17 lines
---
  Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index ea80f00716..6eceeb35b4 100644
@@ -21,7 +21,7 @@ include include/host_arch.h
  ifeq ("", "$(CROSS_COMPILE)")
    MK_ARCH="${shell uname -m}"
  else
-  MK_ARCH="${shell echo $(CROSS_COMPILE) | sed -n 's/^\s*\([^\/]*\/\)*\([^-]*\)-\S*/\2/p'}"
+  MK_ARCH="${shell echo $(CROSS_COMPILE) | sed -n 's/^[[:space:]]*\([^\/]*\/\)*\([^-]*\)-[^[:space:]]*/\2/p'}"
  endif
  unexport HOST_ARCH
  ifeq ("x86_64", $(MK_ARCH))