@@ -515,12 +515,26 @@ $(2)_TARGET_SOURCE = $$($(2)_DIR)/.stamp_downloaded
$(2)_TARGET_DIRCLEAN = $$($(2)_DIR)/.stamp_dircleaned
# default extract command
+ifdef $(2)_SOURCE
+ifeq ($$(filter %.git.tar.gz,$$($(2)_SOURCE)),)
$(2)_EXTRACT_CMDS ?= \
- $$(if $$($(2)_SOURCE),$$(INFLATE$$(suffix $$($(2)_SOURCE))) $$(DL_DIR)/$$($(2)_SOURCE) | \
+ $$(INFLATE$$(suffix $$($(2)_SOURCE))) $$(DL_DIR)/$$($(2)_SOURCE) | \
$$(TAR) --strip-components=$$($(2)_STRIP_COMPONENTS) \
-C $$($(2)_DIR) \
$$(foreach x,$$($(2)_EXCLUDES),--exclude='$$(x)' ) \
- $$(TAR_OPTIONS) -)
+ $$(TAR_OPTIONS) -
+else
+# $(2)_STRIP_COMPONENTS != 1 and $(2)_EXCLUDES are not supported
+$(2)_EXTRACT_CMDS ?= \
+ mkdir -p $$($(2)_DIR)/.git && \
+ $$(INFLATE$$(suffix $$($(2)_SOURCE))) $$(DL_DIR)/$$($(2)_SOURCE) | \
+ $$(TAR) --strip-components=1 \
+ -C $$($(2)_DIR)/.git \
+ $$(TAR_OPTIONS) - && \
+ $(GIT) -C $$($(2)_DIR) config --local --bool core.bare false && \
+ $(GIT) -C $$($(2)_DIR) reset --hard
+endif
+endif
# pre/post-steps hooks
$(2)_PRE_DOWNLOAD_HOOKS ?=
Signed-off-by: Jérôme Pouiller <jezz@sysmic.org> --- package/pkg-generic.mk | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)