All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] extract-headers: work correctly with older 'awk'
@ 2009-10-28 17:12 Oren Laadan
       [not found] ` <1256749963-6009-1-git-send-email-orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Oren Laadan @ 2009-10-28 17:12 UTC (permalink / raw)
  To: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

From: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>

Older versions of awk (mawk, specifically) do not understand
constructs like "[[:space:]]", "[[:digit:]] etc. Replace these with
"[ \t]", "[0-9]".

Cc: Matt Helsley <matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
---
 scripts/extract-headers.sh |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/extract-headers.sh b/scripts/extract-headers.sh
index 2de523b..b64e59c 100755
--- a/scripts/extract-headers.sh
+++ b/scripts/extract-headers.sh
@@ -49,7 +49,7 @@ if [ -z "${KERNELSRC}" -o '!' -d "${KERNELSRC}" ]; then
 fi
 
 # Match cpp includes
-INCLUDE_PRE_REGEX='#[[:space:]]*include[[:space:]]*\([<"]'
+INCLUDE_PRE_REGEX='#[ \t]*include[ \t]*\([<"]'
 INCLUDE_FILE_REGEX='[^">]*'
 INCLUDE_POST_REGEX='[">]\)'
 
@@ -84,7 +84,7 @@ function do_cpp ()
 	sed -e 's|'"${INCLUDE_REGEX}"'|/*#include \1*/|g' "${CPP_FILE}" | \
 	cpp -CC -P -U__KERNEL__ -undef -nostdinc -fdirectives-only -dDI "$@" | \
 	awk 'BEGIN { do_print = 0; }
-	     /#[[:space:]]*define '"${START_DEFINE}"'/  { do_print = 1; next; }
+	     /#[ \t]*define '"${START_DEFINE}"'/  { do_print = 1; next; }
 	     (do_print == 1)				{ print }' | \
 	cat -s | \
 	sed -e 's|/\*'"${INCLUDE_REGEX}"'\*/|#include \1|g' | \
@@ -144,7 +144,7 @@ echo '#endif /* _CHECKPOINT_CKPT_HDR_H_ */' >> "${OUTPUT_INCLUDES}/linux/checkpo
 # We use ARCH_COND to break up architecture-specific sections of the header.
 #
 ARCH_COND='#if'
-REGEX='[[:space:]]*#[[:space:]]*define[[:space:]]+__NR_(checkpoint|restart|clone_with_pids)[[:space:]]+[[:digit:]]+'
+REGEX='[ \t]*#[ \t]*define[ \t]+__NR_(checkpoint|restart|clone_with_pids)[ \t]+[0-9]+'
 
 cat - <<-EOFOE
 /*
@@ -167,7 +167,7 @@ while read UNISTDH ; do
 	CPPARCH="$(karch_to_cpparch "${KARCH}" "${WORDBITS}")"
 	echo -e "${ARCH_COND} __${CPPARCH}__\\n"
 	grep -E "${REGEX}" "${UNISTDH}" | \
-	sed -e 's/^[[:space:]]*#[[:space:]]*define[[:space:]]\+__NR_\([^[:space:]]\+\)[[:space:]]\+\([^[:space:]]\+\).*$/#\tifndef __NR_\1\n#\t\tdefine __NR_\1 \2\n#\tendif\n/'
+	sed -e 's/^[ \t]*#[ \t]*define[ \t]\+__NR_\([^ \t]\+\)[ \t]\+\([^ \t]\+\).*$/#\tifndef __NR_\1\n#\t\tdefine __NR_\1 \2\n#\tendif\n/'
 	ARCH_COND='#elif'
 done
 
-- 
1.6.0.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] extract-headers: work correctly with older 'awk'
       [not found] ` <1256749963-6009-1-git-send-email-orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
@ 2009-10-28 17:27   ` Matt Helsley
  0 siblings, 0 replies; 2+ messages in thread
From: Matt Helsley @ 2009-10-28 17:27 UTC (permalink / raw)
  To: Oren Laadan; +Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

On Wed, Oct 28, 2009 at 01:12:43PM -0400, Oren Laadan wrote:
> From: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
> 
> Older versions of awk (mawk, specifically) do not understand
> constructs like "[[:space:]]", "[[:digit:]] etc. Replace these with
> "[ \t]", "[0-9]".
> 
> Cc: Matt Helsley <matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>

Reviewed-by: Matt Helsley <matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

Cheers,
	-Matt Helsley

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-10-28 17:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-28 17:12 [PATCH] extract-headers: work correctly with older 'awk' Oren Laadan
     [not found] ` <1256749963-6009-1-git-send-email-orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
2009-10-28 17:27   ` Matt Helsley

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.