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>
This commit is contained in:
parent
3deabea893
commit
9b76f895bc
@ -31,7 +31,12 @@ generate()
|
|||||||
# copy stdin to stdout
|
# copy stdin to stdout
|
||||||
cat
|
cat
|
||||||
# print everything after INSERT line
|
# print everything after INSERT line
|
||||||
sed -n '/^INSERT$/ { :l; n; p; bl }' "${src}"
|
sed -n '/^INSERT$/ {
|
||||||
|
:l
|
||||||
|
n
|
||||||
|
p
|
||||||
|
bl
|
||||||
|
}' "${src}"
|
||||||
} >"${dst}.tmp"
|
} >"${dst}.tmp"
|
||||||
if ! cmp -s "${dst}" "${dst}.tmp"; then
|
if ! cmp -s "${dst}" "${dst}.tmp"; then
|
||||||
gen "${dst}"
|
gen "${dst}"
|
||||||
@ -52,7 +57,12 @@ sed -n 's@^//applet:@@p' "$srctree"/*/*.c "$srctree"/*/*/*.c \
|
|||||||
# We add line continuation backslash after each line,
|
# We add line continuation backslash after each line,
|
||||||
# and insert empty line before each line which doesn't start
|
# and insert empty line before each line which doesn't start
|
||||||
# with space or tab
|
# with space or tab
|
||||||
sed -n -e 's@^//usage:\([ \t].*\)$@\1 \\@p' -e 's@^//usage:\([^ \t].*\)$@\n\1 \\@p' \
|
TAB="$(printf '\tX')"
|
||||||
|
TAB="${TAB%X}"
|
||||||
|
LF="$(printf '\nX')"
|
||||||
|
LF="${LF%X}"
|
||||||
|
sed -n -e 's@^//usage:\([ '"$TAB"'].*\)$@\1 \\@p' \
|
||||||
|
-e 's@^//usage:\([^ '"$TAB"'].*\)$@\'"$LF"'\1 \\@p' \
|
||||||
"$srctree"/*/*.c "$srctree"/*/*/*.c \
|
"$srctree"/*/*.c "$srctree"/*/*/*.c \
|
||||||
| generate \
|
| generate \
|
||||||
"$srctree/include/usage.src.h" \
|
"$srctree/include/usage.src.h" \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user