don't attempt with a blank host name in fetch-lua

After exhausting the three URL's for fetch-lua, exit with error,
don't try to connect to a URL with a blank host name.
This commit is contained in:
nhmall
2026-06-04 20:01:46 -04:00
parent cdd42b88a2
commit 9566605ba2
+15 -10
View File
@@ -344,7 +344,8 @@ dofiles-nodlb:
LUA_URL :=www.lua.org/ftp
LUA_URL_MIRROR :=www.tecgraf.puc-rio.br/lua/mirror/ftp
LUA_URL_NHD :=www.nethack.org/download/thirdparty
LUA_URL_list:=$(LUA_URL) $(LUA_URL_MIRROR) $(LUA_URL_NHD)
LUA_CEASE_TRYING := __cease_trying__
LUA_URL_list:=$(LUA_URL) $(LUA_URL_MIRROR) $(LUA_URL_NHD) $(LUA_CEASE_TRYING)
#
#CURL := curl
#ask curl to return a failure code if error 404 is encountered
@@ -375,13 +376,14 @@ fetch-Lua:
mkdir -p lib && cd lib && \
while [ $$# -gt 0 ]; do \
shift; \
if [ $$curlstatus -ne 0 ]; then \
luaurl=https://$$1/$$luafile; \
echo Trying $$luaurl; \
$(CURL) -R -O $$luaurl; \
curlstatus=$$?; \
if [ $$curlstatus -eq 0 ]; then \
if [ ! -z "$$shac" ]; then \
if [ "$$1" != "$(LUA_CEASE_TRYING)" ]; then \
if [ $$curlstatus -ne 0 ]; then \
luaurl=https://$$1/$$luafile; \
echo Trying $$luaurl; \
$(CURL) -R -O $$luaurl; \
curlstatus=$$?; \
if [ $$curlstatus -eq 0 ]; then \
if [ ! -z "$$shac" ]; then \
CHKSUMS=../submodules/CHKSUMS; \
CHKSUMSTMP=../submodules/CHKSUMS.tmp; \
fgrep $$luafile < $$CHKSUMS > $$CHKSUMSTMP; \
@@ -391,10 +393,13 @@ fetch-Lua:
echo Checking integrity of $$luafile with $$shac; \
$$shac -w --ignore-missing -c $$CHKSUMSTMP < $$luafile; \
fi; \
fi; \
tar zxf $$luafile && \
rm -f $$luafile; \
fi; \
tar zxf $$luafile && \
rm -f $$luafile; \
fi; \
else \
exit 1; \
fi; \
done; \
true )