diff options
author | Loïc Hoguin <[email protected]> | 2014-09-12 11:44:43 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2014-09-12 11:48:00 +0200 |
commit | c1fb807f2e687d044175ba00aa4baacb41a30aae (patch) | |
tree | f70df3aa90862f6f1b6f13cb9007b467a81d44fe /core | |
parent | b8b9fffb39537f44c65b6272e268ea2c88a5be56 (diff) | |
parent | 5b30525df75e317db08620f3eccae685fae52b81 (diff) | |
download | erlang.mk-c1fb807f2e687d044175ba00aa4baacb41a30aae.tar.gz erlang.mk-c1fb807f2e687d044175ba00aa4baacb41a30aae.tar.bz2 erlang.mk-c1fb807f2e687d044175ba00aa4baacb41a30aae.zip |
Merge branch 'wget_fallback' of git://github.com/crownedgrouse/erlang.mk
Diffstat (limited to 'core')
-rw-r--r-- | core/core.mk | 6 | ||||
-rw-r--r-- | core/deps.mk | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/core/core.mk b/core/core.mk index d25897b..ec42331 100644 --- a/core/core.mk +++ b/core/core.mk @@ -62,6 +62,12 @@ 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, {{_, 200, _}, _, Body}} -> case file:write_file("$(1)", Body) of ok -> ok; {error, R1} -> halt(R1) end; {error, R2} -> halt(R2) end, halt(0).' +endef +endif diff --git a/core/deps.mk b/core/deps.mk index a7c35f5..490e675 100644 --- a/core/deps.mk +++ b/core/deps.mk @@ -81,7 +81,7 @@ distclean-deps: # Packages related targets. $(PKG_FILE2): - $(call core_http_get,$(PKG_FILE2),$(PKG_FILE_URL)) + @$(call core_http_get,$(PKG_FILE2),$(PKG_FILE_URL)) pkg-list: $(PKG_FILE2) @cat $(PKG_FILE2) | awk 'BEGIN { FS = "\t" }; { print \ |