Attention is currently required from: Zheng Bao.
Hello Zheng Bao,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/78324?usp=email
to review the following change.
Change subject: buildgcc: Match the string of downloading percentage more precisely ......................................................................
buildgcc: Match the string of downloading percentage more precisely
The command "wget" prints some hyperlink with "%", which will be filtered in by previous regular expression. So we need to change to match the string with exactly 2 digits and a percent symbol.
TEST: echo 45% | grep -o "<[0-9]{1,2}%" 45% echo 245% | grep -o "<[0-9]{1,2}%" <empty> echo aa% | grep -o "<[0-9]{1,2}%" <empty>
Change-Id: I6ef9e7c87fd4ee6cc707346954d91e6e3af3b939 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M util/crossgcc/buildgcc 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/78324/1
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index ebc9fcb..9b2fbed 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -1060,7 +1060,7 @@ url=$1 printf "... ${red} 0%%" wget --tries=3 "$url" 2>&1 | while read -r line; do - echo "$line" | grep -o "[0-9]+%" | awk '{printf("\b\b\b\b%4s", $1)}' + echo "$line" | grep -o "<[0-9]{1,2}%" | awk '{printf("\b\b\b\b%4s", $1)}' done printf "${NC}... " }