From e9bd28d0d8ace29bca0f40514ec646875d66d300 Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 20 Dec 2023 21:31:58 -0500 Subject: [PATCH] fetch-lua follow-up --- sys/unix/Makefile.top | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/sys/unix/Makefile.top b/sys/unix/Makefile.top index 09c79dfaf..96d8108cb 100644 --- a/sys/unix/Makefile.top +++ b/sys/unix/Makefile.top @@ -324,26 +324,29 @@ fetch-lua: fetch-Lua fetch-Lua: @( mkdir -p lib && cd lib && \ n=0; \ + export curlstatus=1; \ luaurl=https://$(LUA_URL)/lua-$(LUA_VERSION).tar.gz; \ while [ $${n} -lt 2 ]; do \ - echo trying $$luaurl; \ - shac1=`command -v shasum`; \ - shac2=`command -v sha256sum`; \ - if [ ! -z $$shac1 ]; then \ - shac="$$shac1 -a 256"; elif [ ! -z $$shac2 ]; then \ - shac=$$shac2; else echo "CAUTION: no way to check integrity"; \ - fi; \ - curl -R -O $$luaurl; \ - export curlstatus=$$?; \ - if [ $$curlstatus -eq 0 ]; then \ - if [ ! -z "$$shac" ]; then \ - echo Checking integrity with $$shac; \ - $$shac -w -c ../submodules/CHKSUMS < lua-$(LUA_VERSION).tar.gz; \ + if [ $$curlstatus -ne 0 ]; then \ + echo trying $$luaurl; \ + shac1=`command -v shasum`; \ + shac2=`command -v sha256sum`; \ + if [ ! -z $$shac1 ]; then \ + shac="$$shac1 -a 256"; elif [ ! -z $$shac2 ]; then \ + shac=$$shac2; else echo "CAUTION: no way to check integrity"; \ fi; \ - tar zxf lua-$(LUA_VERSION).tar.gz && \ - rm -f lua-$(LUA_VERSION).tar.gz; \ + curl -R -O $$luaurl; \ + export curlstatus=$$?; \ + if [ $$curlstatus -eq 0 ]; then \ + if [ ! -z "$$shac" ]; then \ + echo Checking integrity with $$shac; \ + $$shac -w -c ../submodules/CHKSUMS < lua-$(LUA_VERSION).tar.gz; \ + fi; \ + tar zxf lua-$(LUA_VERSION).tar.gz && \ + rm -f lua-$(LUA_VERSION).tar.gz; \ + fi; \ + luaurl=https://$(LUA_URL_MIRROR)/lua-$(LUA_VERSION).tar.gz; \ fi; \ - luaurl=https://$(LUA_URL_MIRROR)/lua-$(LUA_VERSION).tar.gz; \ n=`expr $$n + 1`; \ done; \ true )