summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-05-29 03:22:00 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-05-29 03:22:00 -0400
commitb0caa8f3eb97ad600bf95f530cdee2e36e0acfdd (patch)
tree4ed6e854fc6716a56455c60a9a66995193544c5b /Makefile
parent569402f1ba63a75639a665f2077c3e6eac79510f (diff)
make git extra info be a combo of ref+subpath
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 7 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 577b1c1..3bfeb69 100644
--- a/Makefile
+++ b/Makefile
@@ -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))'): \