diff options
| author | Matthias Andree <matthias.andree@gmx.de> | 2014-01-10 11:54:37 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2014-01-10 11:54:37 +0100 |
| commit | 9b76f895bcd50c97df66c7e0192e045245eb519f (patch) | |
| tree | 0ce5dac1b3f7a0996a9bc098d137f278de3b1ced /scripts | |
| parent | 3deabea8932715dae2b7b95e08b1be96d1bc0361 (diff) | |
| download | busybox-w32-9b76f895bcd50c97df66c7e0192e045245eb519f.tar.gz busybox-w32-9b76f895bcd50c97df66c7e0192e045245eb519f.tar.bz2 busybox-w32-9b76f895bcd50c97df66c7e0192e045245eb519f.zip | |
build system: fix non-portable sed constructs.
This includes proper line breaks for labels and closing braces,
and removing non-portable \n and \t in s/// functions.
Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/gen_build_files.sh | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/gen_build_files.sh b/scripts/gen_build_files.sh index 0989b2fe5..e8fa831be 100755 --- a/scripts/gen_build_files.sh +++ b/scripts/gen_build_files.sh | |||
| @@ -31,7 +31,12 @@ generate() | |||
| 31 | # copy stdin to stdout | 31 | # copy stdin to stdout |
| 32 | cat | 32 | cat |
| 33 | # print everything after INSERT line | 33 | # print everything after INSERT line |
| 34 | sed -n '/^INSERT$/ { :l; n; p; bl }' "${src}" | 34 | sed -n '/^INSERT$/ { |
| 35 | :l | ||
| 36 | n | ||
| 37 | p | ||
| 38 | bl | ||
| 39 | }' "${src}" | ||
| 35 | } >"${dst}.tmp" | 40 | } >"${dst}.tmp" |
| 36 | if ! cmp -s "${dst}" "${dst}.tmp"; then | 41 | if ! cmp -s "${dst}" "${dst}.tmp"; then |
| 37 | gen "${dst}" | 42 | gen "${dst}" |
| @@ -52,7 +57,12 @@ sed -n 's@^//applet:@@p' "$srctree"/*/*.c "$srctree"/*/*/*.c \ | |||
| 52 | # We add line continuation backslash after each line, | 57 | # We add line continuation backslash after each line, |
| 53 | # and insert empty line before each line which doesn't start | 58 | # and insert empty line before each line which doesn't start |
| 54 | # with space or tab | 59 | # with space or tab |
| 55 | sed -n -e 's@^//usage:\([ \t].*\)$@\1 \\@p' -e 's@^//usage:\([^ \t].*\)$@\n\1 \\@p' \ | 60 | TAB="$(printf '\tX')" |
| 61 | TAB="${TAB%X}" | ||
| 62 | LF="$(printf '\nX')" | ||
| 63 | LF="${LF%X}" | ||
| 64 | sed -n -e 's@^//usage:\([ '"$TAB"'].*\)$@\1 \\@p' \ | ||
| 65 | -e 's@^//usage:\([^ '"$TAB"'].*\)$@\'"$LF"'\1 \\@p' \ | ||
| 56 | "$srctree"/*/*.c "$srctree"/*/*/*.c \ | 66 | "$srctree"/*/*.c "$srctree"/*/*/*.c \ |
| 57 | | generate \ | 67 | | generate \ |
| 58 | "$srctree/include/usage.src.h" \ | 68 | "$srctree/include/usage.src.h" \ |
