From a7e83e9c4ea5caedf921cb492a6d19b738e5d0df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Thu, 14 Jan 2021 18:57:02 +0000 Subject: [PATCH] Do not try to redownload files that are already downloaded. --- rootfs.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rootfs.sh b/rootfs.sh index 8c44d6ea..53ad010e 100755 --- a/rootfs.sh +++ b/rootfs.sh @@ -87,7 +87,9 @@ cp tcc-patched.kaem tmp/after/ # tar 1.12 url=https://ftp.gnu.org/gnu/tar/tar-1.12.tar.gz pushd ../sources -wget --continue "$url" +if [ ! -f "$(basename $url)" ]; then + wget "$url" +fi popd cp "$(basename $url .tar.gz).kaem" tmp/after tar -C tmp/after -xf "../sources/$(basename $url)" @@ -95,7 +97,9 @@ tar -C tmp/after -xf "../sources/$(basename $url)" get_file() { url=$1 pushd ../sources - wget --continue "$url" + if [ ! -f "$(basename "$url")" ]; then + wget "$url" + fi popd ext="${url##*.}" if [ "$ext" = "tar" ]; then