fetch-lua update
Try the mirror if the primary fails
This commit is contained in:
@@ -322,20 +322,32 @@ fetch-lua: fetch-Lua
|
|||||||
@true
|
@true
|
||||||
|
|
||||||
fetch-Lua:
|
fetch-Lua:
|
||||||
( mkdir -p lib && cd lib && \
|
@( mkdir -p lib && cd lib && \
|
||||||
shac1=`command -v shasum`; \
|
n=0; \
|
||||||
shac2=`command -v sha256sum`; \
|
luaurl=https://$(LUA_URL)/lua-$(LUA_VERSION).tar.gz; \
|
||||||
if [ ! -z $$shac1 ]; then \
|
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="$$shac1 -a 256"; elif [ ! -z $$shac2 ]; then \
|
||||||
shac=$$shac2; else echo "CAUTION: no way to check integrity"; \
|
shac=$$shac2; else echo "CAUTION: no way to check integrity"; \
|
||||||
fi; \
|
fi; \
|
||||||
curl -R -O https://$(LUA_URL)/lua-$(LUA_VERSION).tar.gz && \
|
curl -R -O $$luaurl; \
|
||||||
if [ ! -z "$$shac" ]; then \
|
export curlstatus=$$?; \
|
||||||
echo Checking integrity with $$shac; \
|
if [ $$curlstatus -eq 0 ]; then \
|
||||||
$$shac -w -c ../submodules/CHKSUMS < lua-$(LUA_VERSION).tar.gz; \
|
if [ ! -z "$$shac" ]; then \
|
||||||
fi; \
|
echo Checking integrity with $$shac; \
|
||||||
tar zxf lua-$(LUA_VERSION).tar.gz && \
|
$$shac -w -c ../submodules/CHKSUMS < lua-$(LUA_VERSION).tar.gz; \
|
||||||
rm -f 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; \
|
||||||
|
n=`expr $$n + 1`; \
|
||||||
|
done; \
|
||||||
|
true )
|
||||||
|
|
||||||
# remove include/nhlua.h in case it was created for some other Lua version
|
# remove include/nhlua.h in case it was created for some other Lua version
|
||||||
@( if test -f include/nhlua.h ; then \
|
@( if test -f include/nhlua.h ; then \
|
||||||
rm -f include/nhlua.h && echo 'rm include/nhlua.h' ; fi )
|
rm -f include/nhlua.h && echo 'rm include/nhlua.h' ; fi )
|
||||||
|
|||||||
Reference in New Issue
Block a user