Fix for systems with old non-POSIX awk.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51640 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -62,6 +62,24 @@ PREP="$WORKDIR/PREP"
|
|||||||
STDERR="$WORKDIR/STDERR"
|
STDERR="$WORKDIR/STDERR"
|
||||||
ERR=0
|
ERR=0
|
||||||
|
|
||||||
|
# Filter to show lines of genertated XSLT when they are mentioned.
|
||||||
|
showxslt() {
|
||||||
|
awk '{
|
||||||
|
print;
|
||||||
|
if (sub(/.*generated XSLT line */, "") && sub(/[^0-9].*/, ""))
|
||||||
|
{
|
||||||
|
system("sed -ne "$0"p '$XSLT'");
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
# Test it works as old version of awk don't have sub or system functions.
|
||||||
|
if showxslt </dev/null 2>/dev/null; then
|
||||||
|
SHOWXSLT=showxslt
|
||||||
|
else
|
||||||
|
SHOWXSLT=cat
|
||||||
|
fi
|
||||||
|
|
||||||
# Change the names of the temporary files in an error message to something
|
# Change the names of the temporary files in an error message to something
|
||||||
# to something more informative
|
# to something more informative
|
||||||
errout()
|
errout()
|
||||||
@@ -71,14 +89,7 @@ errout()
|
|||||||
if [ -s "$STDERR" ]; then
|
if [ -s "$STDERR" ]; then
|
||||||
sed "s|file ${WORKPAT}|${WORKPAT}|g;\
|
sed "s|file ${WORKPAT}|${WORKPAT}|g;\
|
||||||
s|${WORKPAT}/XSLT|generated XSLT|g;\
|
s|${WORKPAT}/XSLT|generated XSLT|g;\
|
||||||
s|${WORKPAT}/PREP|$NAME (preprocessed)|g" "$STDERR" |
|
s|${WORKPAT}/PREP|$NAME (preprocessed)|g" "$STDERR" | $SHOWXSLT
|
||||||
awk '{
|
|
||||||
print;
|
|
||||||
if (sub(/.*generated XSLT line */, "") && sub(/[^0-9].*/, ""))
|
|
||||||
{
|
|
||||||
system("sed -ne "$0"p '$XSLT'");
|
|
||||||
}
|
|
||||||
}'
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user