summaryrefslogtreecommitdiffhomepage
path: root/scripts/gen_build_files.sh
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-04-16 17:59:34 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2011-04-16 17:59:34 +0200
commitc3dadba699264c39bf6183505a09e9b28c636481 (patch)
tree8ef0e98b561b2afed65d6ba865bcbc429b04295f /scripts/gen_build_files.sh
parentb0b8884009f9844e75d10f9e5d4ac16ef6b36170 (diff)
gen_build_files.sh: do not use "sed --" for now
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'scripts/gen_build_files.sh')
-rwxr-xr-xscripts/gen_build_files.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/gen_build_files.sh b/scripts/gen_build_files.sh
index 03831f501..e518a9008 100755
--- a/scripts/gen_build_files.sh
+++ b/scripts/gen_build_files.sh
@@ -1,5 +1,9 @@
#!/bin/sh
+# Note: was using sed OPTS CMD -- FILES
+# but users complain that many sed implementations
+# are misinterpreting --.
+
test $# -ge 2 || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; }
# cd to objtree
@@ -43,7 +47,7 @@ generate()
}
# (Re)generate include/applets.h
-s=`sed -n 's@^//applet:@@p' -- "$srctree"/*/*.c "$srctree"/*/*/*.c`
+s=`sed -n 's@^//applet:@@p' "$srctree"/*/*.c "$srctree"/*/*/*.c`
generate \
"$srctree/include/applets.src.h" \
"include/applets.h" \
@@ -55,7 +59,7 @@ generate \
# and insert empty line before each line which doesn't start
# with space or tab
# (note: we need to use \\\\ because of ``)
-s=`sed -n -e 's@^//usage:\([ \t].*\)$@\1 \\\\@p' -e 's@^//usage:\([^ \t].*\)$@\n\1 \\\\@p' -- "$srctree"/*/*.c "$srctree"/*/*/*.c`
+s=`sed -n -e 's@^//usage:\([ \t].*\)$@\1 \\\\@p' -e 's@^//usage:\([^ \t].*\)$@\n\1 \\\\@p' "$srctree"/*/*.c "$srctree"/*/*/*.c`
generate \
"$srctree/include/usage.src.h" \
"include/usage.h" \
@@ -71,7 +75,7 @@ generate \
if test -f "$src"; then
mkdir -p -- "$d" 2>/dev/null
- s=`sed -n 's@^//kbuild:@@p' -- "$srctree/$d"/*.c`
+ s=`sed -n 's@^//kbuild:@@p' "$srctree/$d"/*.c`
generate \
"${src}" "${dst}" \
"# DO NOT EDIT. This file is generated from Kbuild.src" \
@@ -83,7 +87,7 @@ generate \
if test -f "$src"; then
mkdir -p -- "$d" 2>/dev/null
- s=`sed -n 's@^//config:@@p' -- "$srctree/$d"/*.c`
+ s=`sed -n 's@^//config:@@p' "$srctree/$d"/*.c`
generate \
"${src}" "${dst}" \
"# DO NOT EDIT. This file is generated from Config.src" \