[coreboot-gerrit] Patch set updated for coreboot: buildgcc: Show the progress when downloading

Zheng Bao (zheng.bao@amd.com) gerrit at coreboot.org
Sun Sep 6 08:45:13 CET 2015


Zheng Bao (zheng.bao at amd.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11520

-gerrit

commit f89f6137312ce006b50364c75e69e66d5b0e15d9
Author: zbao <fishbaozi at gmail.com>
Date:   Sun Sep 6 04:44:38 2015 -0400

    buildgcc: Show the progress when downloading
    
    Change-Id: I4559e88d541738a594dce92e23589992f234cb9b
    Signed-off-by: Zheng Bao <zheng.bao at amd.com>
    Signed-off-by: Zheng Bao <fishbaozi at gmail.com>
---
 util/crossgcc/buildgcc | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 0ed9a39..a2c4b81 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -188,6 +188,14 @@ compute_sum() {
 	printf "(checksum created. ${RED}Note. Please upload sum/$1.cksum if the corresponding archive is upgraded.)${NC}"
 }
 
+download_one() {
+	url=$1
+	printf " ..  0%%"
+	wget --no-check-certificate $url 2>&1 | while read line; do
+		echo $line | grep -o "[0-9]\+%" | awk '{printf("\b\b\b\b%4s", $1)}'
+	done
+}
+
 download() {
 	package=$1
 	archive="$(eval echo \$$package"_ARCHIVE")"
@@ -201,14 +209,13 @@ download() {
 		printf "(downloading from $archive)"
 		rm -f tarballs/$FILE
 		cd tarballs
-		wget --no-check-certificate -q $archive
-		wgetret=$?
+		download_one $archive
 		cd ..
 		compute_sum $FILE
 	fi
 
 	if [ ! -f tarballs/$FILE ]; then
-		printf "\n${RED}Failed to download $FILE. Wget returns $wgetret. See 'man wget'.${NC}\n"
+		printf "\n${RED}Failed to download $FILE.${NC}\n"
 		exit 1
 	fi
 	printf "\n"



More information about the coreboot-gerrit mailing list