add macro MXE_GET_GITHUB_TAGS

Source: https://github.com/mxe/mxe/pull/649#issuecomment-143390677
This commit is contained in:
Timothy Gu 2015-09-26 10:23:39 +03:00 committed by Boris Nagaev
parent b76e14d777
commit 252128a30b
1 changed files with 7 additions and 0 deletions

View File

@ -129,6 +129,13 @@ define MXE_GET_GITHUB_SHA
| head -1
endef
define MXE_GET_GITHUB_TAGS
$(WGET) -q -O- 'https://api.github.com/repos/$(strip $(1))/git/refs/tags/' \
| $(SED) -n 's#.*"ref": "refs/tags/\([^"]*\).*#\1#p' \
| $(SORT) -V \
| tail -1
endef
# use a minimal whitelist of safe environment variables
ENV_WHITELIST := PATH LANG MAKE% MXE% %PROXY %proxy LD_LIBRARY_PATH ACLOCAL_PATH
unexport $(filter-out $(ENV_WHITELIST),$(shell env | cut -d '=' -f1))