From cdd42b88a2d6f1add4f5ff5a95cfd96d489df0c9 Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 4 Jun 2026 19:21:26 -0400 Subject: [PATCH] curl was not returning an error to shell on 404 error Add the --fail option to curl to make it do so. --- sys/unix/Makefile.top | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/unix/Makefile.top b/sys/unix/Makefile.top index 136e6997e..239e148d7 100644 --- a/sys/unix/Makefile.top +++ b/sys/unix/Makefile.top @@ -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 )