envsetup: dopush: Update regex to match remaining build time

QPR2 introduced remaining build time in the progress box [0]
but it was broken with tee cmd so dopush() was worked fine.
Now, QPR3 fixed that issue so dopush() is broken.

Example:
[ 99% 394/395 1m30s remaining] Copy: out/target/product/devon/apex/art_boot_images/javalib/arm/boot.art
[100% 395/395 1m30s remaining] Install: out/target/product/devon/system/framework/framework.jar

Change-Id: Ifdfcfe0f750d39f4e3fe7d669e5094729d75e224
This commit is contained in:
Dhina17 2024-07-10 18:32:14 +05:30 committed by Bartłomiej Rudecki
parent caad3af7fc
commit fe0af9d2f6
Signed by: przekichane
GPG key ID: 751F23C6F014EF76

View file

@ -804,19 +804,19 @@ function dopush()
# Install: <file>
if [ $is_gnu_sed -gt 0 ]; then
LOC="$(cat $OUT/.log | sed -r -e 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' -e 's/^\[ {0,2}[0-9]{1,3}% [0-9]{1,6}\/[0-9]{1,6}\] +//' \
LOC="$(cat $OUT/.log | sed -r -e 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' -e 's/^\[ {0,2}[0-9]{1,3}% [0-9]{1,6}\/[0-9]{1,6}( [0-9]{0,2}?h?[0-9]{0,2}?m?[0-9]{0,2}s remaining)?\] +//' \
| grep '^Install: ' | cut -d ':' -f 2)"
else
LOC="$(cat $OUT/.log | sed -E "s/"$'\E'"\[([0-9]{1,3}((;[0-9]{1,3})*)?)?[m|K]//g" -E "s/^\[ {0,2}[0-9]{1,3}% [0-9]{1,6}\/[0-9]{1,6}\] +//" \
LOC="$(cat $OUT/.log | sed -E "s/"$'\E'"\[([0-9]{1,3}((;[0-9]{1,3})*)?)?[m|K]//g" -E "s/^\[ {0,2}[0-9]{1,3}% [0-9]{1,6}\/[0-9]{1,6}( [0-9]{0,2}?h?[0-9]{0,2}?m?[0-9]{0,2}s remaining)?\] +//" \
| grep '^Install: ' | cut -d ':' -f 2)"
fi
# Copy: <file>
if [ $is_gnu_sed -gt 0 ]; then
LOC="$LOC $(cat $OUT/.log | sed -r -e 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' -e 's/^\[ {0,2}[0-9]{1,3}% [0-9]{1,6}\/[0-9]{1,6}\] +//' \
LOC="$LOC $(cat $OUT/.log | sed -r -e 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' -e 's/^\[ {0,2}[0-9]{1,3}% [0-9]{1,6}\/[0-9]{1,6}( [0-9]{0,2}?h?[0-9]{0,2}?m?[0-9]{0,2}s remaining)?\] +//' \
| grep '^Copy: ' | cut -d ':' -f 2)"
else
LOC="$LOC $(cat $OUT/.log | sed -E "s/"$'\E'"\[([0-9]{1,3}((;[0-9]{1,3})*)?)?[m|K]//g" -E 's/^\[ {0,2}[0-9]{1,3}% [0-9]{1,6}\/[0-9]{1,6}\] +//' \
LOC="$LOC $(cat $OUT/.log | sed -E "s/"$'\E'"\[([0-9]{1,3}((;[0-9]{1,3})*)?)?[m|K]//g" -E 's/^\[ {0,2}[0-9]{1,3}% [0-9]{1,6}\/[0-9]{1,6}( [0-9]{0,2}?h?[0-9]{0,2}?m?[0-9]{0,2}s remaining)?\] +//' \
| grep '^Copy: ' | cut -d ':' -f 2)"
fi