From b0caa8f3eb97ad600bf95f530cdee2e36e0acfdd Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 May 2014 03:22:00 -0400 Subject: make git extra info be a combo of ref+subpath --- Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Makefile') 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))'): \ -- cgit v1.2.3-54-g00ecf