diff --git a/build/envsetup.sh b/build/envsetup.sh index 509f6818..f6948211 100644 --- a/build/envsetup.sh +++ b/build/envsetup.sh @@ -816,8 +816,10 @@ function dopush() rm -f $OUT/.log;return $ret fi + is_gnu_sed=`sed --version | head -1 | grep -c GNU` + # Install: - if [ `uname` = "Linux" ]; then + 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}\] +//' \ | grep '^Install: ' | cut -d ':' -f 2)" else @@ -826,7 +828,7 @@ function dopush() fi # Copy: - if [ `uname` = "Linux" ]; then + 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}\] +//' \ | grep '^Copy: ' | cut -d ':' -f 2)" else