diff options
author | crownedgrouse <[email protected]> | 2014-08-05 23:38:17 +0200 |
---|---|---|
committer | crownedgrouse <[email protected]> | 2014-09-11 21:57:22 +0200 |
commit | 5c89ea7f6b13bdf1124b4d95909e1932356595ae (patch) | |
tree | 13827a8d82592eadfa6d98407292c6530959a8ad /erlang.mk | |
parent | 4283f9d3fd13f21bcfa9463e8e43d33fe54e8b70 (diff) | |
download | erlang.mk-5c89ea7f6b13bdf1124b4d95909e1932356595ae.tar.gz erlang.mk-5c89ea7f6b13bdf1124b4d95909e1932356595ae.tar.bz2 erlang.mk-5c89ea7f6b13bdf1124b4d95909e1932356595ae.zip |
Add wget fallback
Diffstat (limited to 'erlang.mk')
-rw-r--r-- | erlang.mk | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -62,9 +62,15 @@ help:: # Core functions. +ifeq ($(shell which wget 2>/dev/null | wc -l), 1) define core_http_get wget --no-check-certificate -O $(1) $(2)|| rm $(1) endef +else +define core_http_get + erl -noshell -eval ' ssl:start(), inets:start(), case httpc:request(get, {"$(2)", []}, [{autoredirect, true}], []) of {ok, {{_V, 200, _R}, _H, Body}} -> case file:write_file("$(1)", Body) of ok -> ok ; {error, R1} -> halt(R1) end ; {error, R2} -> halt(R2) end, halt(0). ' +endef +endif # Copyright (c) 2013-2014, Loïc Hoguin <[email protected]> # This file is part of erlang.mk and subject to the terms of the ISC License. |