[coreboot-gerrit] New patch to review for coreboot: 54a3d2d crossgcc: Re-download the archive if it is incomplete

Zheng Bao (zheng.bao@amd.com) gerrit at coreboot.org
Mon Dec 9 06:20:41 CET 2013


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

-gerrit

commit 54a3d2de3f6d1915da06fd679c23572a3efc3a9e
Author: Zheng Bao <fishbaozi at gmail.com>
Date:   Mon Dec 9 12:58:42 2013 +0800

    crossgcc: Re-download the archive if it is incomplete
    
    If the buildgcc is interrupt by Ctrl-C, probably part of
    a archive is downloaded. If we run buildgcc again, the
    incomplete archive would be considered as cached file
    and skipped.
    
    We need to test the archive by option -t or tar. If test
    is failed, we need to delete the partially-downloaded file
    and download it again.
    
    Discuss: Do we need to use option -c of wget to continue
    downloading?
    
    Change-Id: Ibb1aa25a0374f774e1e643fe5e698de7bf7cc418
    Signed-off-by: Zheng Bao <zheng.bao at amd.com>
    Signed-off-by: Zheng Bao <fishbaozi at gmail.com>
---
 util/crossgcc/buildgcc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 3754837..ae4e06f 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -266,8 +266,9 @@ for ARCHIVE in $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE $LIBELF_ARCHIVE  \
 	    $IASL_ARCHIVE $PYTHON_ARCHIVE $EXPAT_ARCHIVE; do
 	FILE=`basename $ARCHIVE`
 	printf " * $FILE "
-	test -f tarballs/$FILE && printf "(cached)" || (
+	test -f tarballs/$FILE && $TAR tf tarballs/$FILE >/dev/null 2>/dev/null && printf "(cached)" || (
 		printf "(downloading)"
+		rm -f tarballs/$FILE
 		cd tarballs
 		wget --no-check-certificate -q $ARCHIVE
 	)



More information about the coreboot-gerrit mailing list