webbuild-functions: some optimizations of sed parsing functions
This commit is contained in:
parent
2c09744bbd
commit
ee1a94af6f
@ -253,8 +253,10 @@ function parse_patch_output() {
|
||||
}
|
||||
|
||||
function parse_build_output() {
|
||||
#s|\(.\{10000\}\).*|\1 [CUT - LONG LINE]|;
|
||||
sed "s|\r.*||;
|
||||
s|\(.\{10000\}\).*|\1 [CUT - LONG LINE]|;s|\\\|\\\\\\\|g;s|<|\<|g;s|[[:cntrl:]]\[[0-9;]*m||g;
|
||||
s|\\\|\\\\\\\|g;s|<|\<|g;
|
||||
s|[[:cntrl:]]\[[0-9;]*m||g;
|
||||
s|<font|<font|g;
|
||||
s|</font|</font|g;
|
||||
s|^\([\+#] .*\)|<font style=\"color:cyan\">\1</font>|;
|
||||
@ -267,8 +269,10 @@ function parse_build_output() {
|
||||
}
|
||||
|
||||
function parse_generic_output() {
|
||||
# s|\(.\{10000\}\).*|\1 [CUT - LONG LINE]|;
|
||||
sed "s|\r.*||;
|
||||
s|\(.\{10000\}\).*|\1 [CUT - LONG LINE]|;s|<|\<|g;s|[[:cntrl:]]\[[0-9;]*m||g;
|
||||
s|<|\<|g;
|
||||
s|[[:cntrl:]]\[[0-9;]*m||g;
|
||||
s|<font|<font|g;
|
||||
s|</font|</font|g;
|
||||
s|^\([\+#] .*\)|<font style=\"color:cyan\">\1</font>|;
|
||||
@ -278,13 +282,12 @@ function parse_generic_output() {
|
||||
|
||||
function google_search() {
|
||||
while read line; do
|
||||
local SEARCH_STRING=`echo "$line" | sed "s|.*%SRCURL%\(.*\)%SRCURLEND%.*|\1|"`
|
||||
if [ "$SEARCH_STRING" = "$line" ]; then
|
||||
if [ "${line/\%SRCURL\%}" == "${line}" ]; then
|
||||
echo "$line"
|
||||
else
|
||||
SEARCH_STRING=`echo $SEARCH_STRING | sed "s|\<|<|"`
|
||||
local SEARCH_STRING=`echo "$line" | sed "s|.*%SRCURL%\(.*\)%SRCURLEND%.*|\1|;s|\<|<|"`
|
||||
local SEARCH_STRING_ENCODED=`cgi_encodevar "$1 $SEARCH_STRING"`
|
||||
echo "$line" | sed "s|%SRCURL%.*%SRCURLEND%|href=\"http://www.google.com/search?q=$SEARCH_STRING_ENCODED\" target=_new title=\"Search this error on the Web\"|g"
|
||||
echo "$line" | sed "s|%SRCURL%.*%SRCURLEND%|href=\"https://www.google.com/search?q=$SEARCH_STRING_ENCODED\" target=_new title=\"Search this error on the Web\"|g"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ function showlog() {
|
||||
tail -n +0 -f $f --pid $PROCESSPID | stdbuf -oL sed "s|<\([/]pre>\)|\<\1|g"
|
||||
echo -n "<!-- ENDSCROLL -->"
|
||||
else
|
||||
if [ $LOGFILESIZE -lt 2097152 ]; then
|
||||
if [ $LOGFILESIZE -lt 12097152 ]; then
|
||||
if [ -r $f ]; then
|
||||
cat $f | parse_build_output $PACKAGE
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user