diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-05-29 03:22:00 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-05-29 03:22:00 -0400 |
commit | b0caa8f3eb97ad600bf95f530cdee2e36e0acfdd (patch) | |
tree | 4ed6e854fc6716a56455c60a9a66995193544c5b /Makefile | |
parent | 569402f1ba63a75639a665f2077c3e6eac79510f (diff) |
make git extra info be a combo of ref+subpath
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -44,12 +44,14 @@ build/download/tar/%: .tokens/network extract: PHONY $(foreach package,$(packages),build/extract/$(shell utils/spec2file '$($(package))')) build/extract/git/%: - rm -rf '$@' - mkdir -p '$(@D)' + gitref="$$(file2extra 'git/$*'|cut -d/ -f1)" && \ + gitdir=build/extract/"$$(file2base 'git/$*')/$${gitref}" && \ + rm -rf "$$gitdir" && \ { \ - git clone build/download/"$$(file2base 'git/$*')" '$@' && \ - cd '$@' && git checkout "$$(file2extra 'git/$*')"; \ - } || rm -rf '$@' + mkdir -p "$$(dirname "$$gitdir")" && \ + git clone build/download/"$$(file2base 'git/$*')" "$$gitdir" && \ + ( cd "$$gitdir" && git checkout "$$gitref" ); \ + } || rm -rf "$$gitdir" touch '$@' $(foreach package,$(packages),$(if $(filter git|%,$($(package))),$(eval \ build/extract/$(shell utils/spec2file '$($(package))'): \ |