[coreboot-gerrit] Patch set updated for coreboot: buildgcc: printf no-color before quiting

Zheng Bao (fishbaozi@gmail.com) gerrit at coreboot.org
Sat Aug 6 17:00:33 CEST 2016


Zheng Bao (fishbaozi at gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16066

-gerrit

commit cee47317d48148d87ac1c27fb8a9f70af70c3133
Author: zbao <fishbaozi at gmail.com>
Date:   Fri Aug 5 13:41:51 2016 +0800

    buildgcc: printf no-color before quiting
    
    On some kind of terms, the color-ctrl letters don't work.
    The backspaces can not delete correct number of letters.
    So we don't print color-ctrl letters in loop.
    
    Change-Id: I1f1729095e8968a9344ed9f1f278f7c78f7110e9
    Signed-off-by: Zheng Bao <fishbaozi at gmail.com>
---
 util/crossgcc/buildgcc | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index c3f9aa4..d989011 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -225,10 +225,9 @@ download_showing_percentage() {
 	url=$1
 	printf " ..${red}  0%%"
 	wget --no-check-certificate $url 2>&1 | while read line; do
-		printf "${red}"
 		echo $line | grep -o "[0-9]\+%" | awk '{printf("\b\b\b\b%4s", $1)}'
-		printf "${NC}"
 	done
+	printf "${NC}"
 }
 
 download() {
@@ -357,6 +356,12 @@ build()
 	fi
 }
 
+quit()
+{
+	printf "${NC}Stop\n"
+	exit 1
+}
+
 cleanup()
 {
 	if [ $SAVETEMPS -ne 0 ]; then
@@ -679,6 +684,8 @@ print_stable() {
 	esac
 }
 
+trap quit 1 2 3 15
+
 # Look if we have getopt. If not, build it.
 export PATH=$PATH:.
 getopt - > /dev/null 2>/dev/null || gcc -o getopt getopt.c



More information about the coreboot-gerrit mailing list