Merge pull request #888 from LuaAndC/get-github-tags

add macro MXE_GET_GITHUB_TAGS
This commit is contained in:
Tony Theodore 2015-09-26 19:41:39 +10:00
commit 21630887e1
1 changed files with 10 additions and 3 deletions

View File

@ -124,9 +124,16 @@ MAKE_SHARED_FROM_STATIC = \
--bindir '$(PREFIX)/$(TARGET)/bin'
define MXE_GET_GITHUB_SHA
$(WGET) -q -O- 'https://api.github.com/repos/$(strip $(1))/git/refs/heads/$(strip $(2))' | \
$(SED) -n 's#.*"sha": "\([^"]\{10\}\).*#\1#p' | \
head -1
$(WGET) -q -O- 'https://api.github.com/repos/$(strip $(1))/git/refs/heads/$(strip $(2))' \
| $(SED) -n 's#.*"sha": "\([^"]\{10\}\).*#\1#p' \
| 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