fetch-lua bits
Add a local copy of the lua source file. Re-organize the sh code to avoid duplication and add (a little) clarity.
This commit is contained in:
+18
-20
@@ -322,6 +322,7 @@ dofiles-nodlb:
|
|||||||
|
|
||||||
LUA_URL :=www.lua.org/ftp
|
LUA_URL :=www.lua.org/ftp
|
||||||
LUA_URL_MIRROR :=www.tecgraf.puc-rio.br/lua/mirror/ftp
|
LUA_URL_MIRROR :=www.tecgraf.puc-rio.br/lua/mirror/ftp
|
||||||
|
LUA_URL_NHD :=www.nethack.org/download/thirdparty
|
||||||
|
|
||||||
fetch-lua-mirror: LUA_URL :=$(LUA_URL_MIRROR)
|
fetch-lua-mirror: LUA_URL :=$(LUA_URL_MIRROR)
|
||||||
fetch-lua-mirror: fetch-Lua
|
fetch-lua-mirror: fetch-Lua
|
||||||
@@ -331,36 +332,33 @@ fetch-lua: fetch-Lua
|
|||||||
@true
|
@true
|
||||||
|
|
||||||
fetch-Lua:
|
fetch-Lua:
|
||||||
@( mkdir -p lib && cd lib && \
|
@( \
|
||||||
n=0; \
|
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; \
|
||||||
|
set -- DUMMY $(LUA_URL) $(LUA_URL_MIRROR) $(LUA_URL_NHD); \
|
||||||
|
luafile=lua-$(LUA_VERSION).tar.gz; \
|
||||||
export curlstatus=1; \
|
export curlstatus=1; \
|
||||||
while [ $${n} -lt 2 ]; do \
|
mkdir -p lib && cd lib && \
|
||||||
|
while [ $$# -gt 0 ]; do \
|
||||||
|
shift; \
|
||||||
if [ $$curlstatus -ne 0 ]; then \
|
if [ $$curlstatus -ne 0 ]; then \
|
||||||
if [ $${n} -eq 0 ]; then \
|
luaurl=https://$$1/$$luafile; \
|
||||||
luaurl=https://$(LUA_URL)/lua-$(LUA_VERSION).tar.gz; \
|
|
||||||
fi; \
|
|
||||||
if [ $${n} -eq 1 ]; then \
|
|
||||||
luaurl=https://$(LUA_URL_MIRROR)/lua-$(LUA_VERSION).tar.gz; \
|
|
||||||
fi; \
|
|
||||||
echo trying $$luaurl; \
|
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; \
|
curl -R -O $$luaurl; \
|
||||||
export curlstatus=$$?; \
|
curlstatus=$$?; \
|
||||||
if [ $$curlstatus -eq 0 ]; then \
|
if [ $$curlstatus -eq 0 ]; then \
|
||||||
if [ ! -z "$$shac" ]; then \
|
if [ ! -z "$$shac" ]; then \
|
||||||
echo Checking integrity with $$shac; \
|
echo Checking integrity with $$shac; \
|
||||||
$$shac -w -c ../submodules/CHKSUMS < lua-$(LUA_VERSION).tar.gz; \
|
$$shac -w -c ../submodules/CHKSUMS < $$luafile; \
|
||||||
fi; \
|
fi; \
|
||||||
tar zxf lua-$(LUA_VERSION).tar.gz && \
|
tar zxf $$luafile && \
|
||||||
rm -f lua-$(LUA_VERSION).tar.gz; \
|
rm -f $$luafile; \
|
||||||
fi; \
|
fi; \
|
||||||
fi; \
|
fi; \
|
||||||
n=`expr $$n + 1`; \
|
|
||||||
done; \
|
done; \
|
||||||
true )
|
true )
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user