gen_constants: rewrite sed to be a bit more readable
Use the -E flag to get ERE behavior by default so we don't need to escape
chars in a BRE. Also switch the delimiter to avoid escaping that too.
Change-Id: I6d73bcad1d8544d40eaa74e4b70a1e29549edeb2
diff --git a/gen_constants.sh b/gen_constants.sh
index 02a35ec..7b39156 100755
--- a/gen_constants.sh
+++ b/gen_constants.sh
@@ -39,9 +39,9 @@
# #ifdef AT_FDCWD
# { "AT_FDWCD", AT_FDCWD },
# endif
-SED_MULTILINE='s/#define \([[:upper:]][[:upper:]0-9_]*\).*/#ifdef \1\
+SED_MULTILINE='s@#define ([[:upper:]][[:upper:]0-9_]*).*@#ifdef \1\
{ "\1", \1 },\
-#endif \/\/ \1/'
+#endif // \1@'
# Passes the previous list of #includes to the C preprocessor and prints out
# all #defines whose name is all-caps. Excludes a few symbols that are known
@@ -57,7 +57,7 @@
grep '^#define [[:upper:]][[:upper:]0-9_]* ' | \
grep -Ev '(SIGRTMAX|SIGRTMIN|SIG_|NULL)' | \
sort -u | \
- sed -e "${SED_MULTILINE}")
+ sed -Ee "${SED_MULTILINE}")
{ NULL, 0 },
};
EOF