curl was not returning an error to shell on 404 error

Add the --fail option to curl to make it do so.
This commit is contained in:
nhmall
2026-06-04 19:21:26 -04:00
parent 19f0ae07cc
commit cdd42b88a2
+6 -2
View File
@@ -345,6 +345,10 @@ 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)
#
#CURL := curl
#ask curl to return a failure code if error 404 is encountered
CURL := curl --fail
fetch-lua-mirror: LUA_URL_list:=$(LUA_URL_MIRROR)
fetch-lua-mirror: fetch-Lua
@@ -374,7 +378,7 @@ fetch-Lua:
if [ $$curlstatus -ne 0 ]; then \
luaurl=https://$$1/$$luafile; \
echo Trying $$luaurl; \
curl -R -O $$luaurl; \
$(CURL) -R -O $$luaurl; \
curlstatus=$$?; \
if [ $$curlstatus -eq 0 ]; then \
if [ ! -z "$$shac" ]; then \
@@ -401,7 +405,7 @@ fetch-Lua:
fetch-lua-http:
( mkdir -p lib && cd lib && \
curl -R -O http://$(LUA_URL)/lua-$(LUA_VERSION).tar.gz && \
$(CURL) -R -O http://$(LUA_URL)/lua-$(LUA_VERSION).tar.gz && \
tar zxf lua-$(LUA_VERSION).tar.gz && \
rm -f lua-$(LUA_VERSION).tar.gz )