aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2010-11-24 15:06:49 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2010-11-24 15:06:49 +0100
commit749e305d3671368a8d08de002f5235298ed1ed53 (patch)
treeb59f1b6b1e88e181c06a492b773328b2cee86cc6
parent7386dd1e8a659616e1dab1b013986e4ba00a4835 (diff)
downloadbusybox-749e305d3671368a8d08de002f5235298ed1ed53.tar.gz
build system: fix for dash
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
-rwxr-xr-xscripts/gen_build_files.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/gen_build_files.sh b/scripts/gen_build_files.sh
index 130269b10..ac8ccb933 100755
--- a/scripts/gen_build_files.sh
+++ b/scripts/gen_build_files.sh
@@ -18,14 +18,17 @@ generate()
local src="$1" dst="$2" header="$3" insert="$4"
#chk "${dst}"
(
- echo "${header}"
+ # need to use printf: different shells have inconsistent
+ # rules re handling of "\n" in their params,
+ # and ${insert} definitely contains "\n"
+ printf "%s\n" "${header}"
if grep -qs '^INSERT$' "${src}"; then
sed -n '1,/^INSERT$/p' "${src}"
- echo "${insert}"
+ printf "%s\n" "${insert}"
sed -n '/^INSERT$/,$p' "${src}"
else
if [ -n "${insert}" ]; then
- echo "ERROR: INSERT line missing in: ${src}" 1>&2
+ printf "%s\n" "ERROR: INSERT line missing in: ${src}" 1>&2
fi
cat "${src}"
fi