From a4274bf35aa45c7848442427082ef33a4264ff85 Mon Sep 17 00:00:00 2001 From: Alcaro Date: Tue, 17 Apr 2018 22:25:07 +0200 Subject: [PATCH] (#7) Redownload the Firefox tarballs if truncated, rather than profiling with corrupt data --- make.sh | 5 +++++ profile/download.sh | 17 +++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/make.sh b/make.sh index 24123f1..2044cac 100755 --- a/make.sh +++ b/make.sh @@ -43,6 +43,11 @@ if [ ! -e profile/choice ]; then done fi +#if download was aborted, resume it +if [ -e profile/firefox-45.0esr.tar ]; then + profile/download.sh +fi + #clean up rm flips flips.exe floating.zip obj/* diff --git a/profile/download.sh b/profile/download.sh index 3f8fd1b..8ce1dca 100755 --- a/profile/download.sh +++ b/profile/download.sh @@ -1,8 +1,17 @@ #!/bin/sh -FX45=https://ftp.mozilla.org/pub/firefox/releases/45.0esr/linux-x86_64/en-US/firefox-45.0esr.tar.bz2 -FX52=https://ftp.mozilla.org/pub/firefox/releases/52.0esr/linux-x86_64/en-US/firefox-52.0esr.tar.bz2 +SRC=profile/firefox-45.0esr.tar +DST=profile/firefox-52.0esr.tar +SRCSIZE=101529600 +DSTSIZE=113336320 +SRCURL=https://ftp.mozilla.org/pub/firefox/releases/45.0esr/linux-x86_64/en-US/firefox-45.0esr.tar.bz2 +DSTURL=https://ftp.mozilla.org/pub/firefox/releases/52.0esr/linux-x86_64/en-US/firefox-52.0esr.tar.bz2 + +if [ ! -f $SRC ] || [ $(wc -c <$SRC) -lt $SRCSIZE ]; then + wget $SRCURL -O- | bzcat > $SRC || exit $? +fi +if [ ! -f $DST ] || [ $(wc -c <$DST) -lt $DSTSIZE ]; then + wget $DSTURL -O- | bzcat > $DST || exit $? +fi -wget $FX45 -O- | bzcat > profile/firefox-45.0esr.tar || exit $? -wget $FX52 -O- | bzcat > profile/firefox-52.0esr.tar || exit $? echo y > profile/choice