Skip to contentSkip to conversation

tools/tests/domid: don't pass -E to sed

PATCH In review Jan Beulich 3 participants 3 messages Oct 20, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/tests/domid: don't pass -E to sed

Even the 2018 edition of The Open Group Base Specifications Issue 7 [1] doesn't name -E as a standard option; only Issue 8 [2] does. As we can easily avoid anything "extended" about the expression used, drop the -E, escape the parentheses, and replace the sole + by *.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/
[2] https://pubs.opengroup.org/onlinepubs/9799919799/

Fixes b3d31533a047 ("tools/tests: introduce unit tests for domain ID allocator")
tools/tests/domid/Makefile +2 -2
@@ -10,8 +10,8 @@ include $(XEN_ROOT)/tools/Rules.mk
 TESTS := test-domid
 
 define list-c-headers
-$(shell sed -n -E \
-    's/^[ \t]*# *include[ \t]*[<"]([^">]+)[">].*/\1/p' $(1) 2>/dev/null)
+$(shell sed -n \
+    's/^[ \t]*# *include[ \t]*[<"]\([^">]*\)[">].*/\1/p' $(1) 2>/dev/null)
 endef
 
 # NB: $1 cannot be a list
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Jan Beulich

Even the 2018 edition of The Open Group Base Specifications Issue 7 [1] doesn't name -E as a standard option; only Issue 8 [2] does. As we can easily avoid anything "extended" about the expression used, drop the -E, escape the parentheses, and replace the sole + by *.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/
[2] https://pubs.opengroup.org/onlinepubs/9799919799/

Fixes b3d31533a047 ("tools/tests: introduce unit tests for domain ID allocator")
#2 lore raw
In reply to Jan Beulich
Quoted 10 lines · Jan Beulich

Even the 2018 edition of The Open Group Base Specifications Issue 7 [1] doesn't name -E as a standard option; only Issue 8 [2] does. As we can easily avoid anything "extended" about the expression used, drop the -E, escape the parentheses, and replace the sole + by *.

[1]https://pubs.opengroup.org/onlinepubs/9699919799/ [2]https://pubs.opengroup.org/onlinepubs/9799919799/

Fixes b3d31533a047 ("tools/tests: introduce unit tests for domain ID allocator")

~ Oleksii

Quoted 14 lines
tools/tests/domid/Makefile +2 -2
@@ -10,8 +10,8 @@ include $(XEN_ROOT)/tools/Rules.mk
  TESTS := test-domid
 
  define list-c-headers
-$(shell sed -n -E \
-    's/^[ \t]*# *include[ \t]*[<"]([^">]+)[">].*/\1/p' $(1) 2>/dev/null)
+$(shell sed -n \
+    's/^[ \t]*# *include[ \t]*[<"]\([^">]*\)[">].*/\1/p' $(1) 2>/dev/null)
  endef
 
  # NB: $1 cannot be a list