summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--package/pkg-generic.mk8
-rw-r--r--package/pkg-utils.mk7
-rw-r--r--support/dependencies/check-host-xzcat.mk1
3 files changed, 9 insertions, 7 deletions
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 3ca71b03b..e8a8021e3 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -926,13 +926,7 @@ else ifeq ($$($(2)_SITE_METHOD),cvs)
DL_TOOLS_DEPENDENCIES += cvs
endif # SITE_METHOD
-# $(firstword) is used here because the extractor can have arguments, like
-# ZCAT="gzip -d -c", and to check for the dependency we only want 'gzip'.
-# Do not add xzcat to the list of required dependencies, as it gets built
-# automatically if it isn't found.
-ifneq ($$(call suitable-extractor,$$($(2)_SOURCE)),$$(XZCAT))
-DL_TOOLS_DEPENDENCIES += $$(firstword $$(call suitable-extractor,$$($(2)_SOURCE)))
-endif
+DL_TOOLS_DEPENDENCIES += $$(call extractor-dependency,$$($(2)_SOURCE))
# Ensure all virtual targets are PHONY. Listed alphabetically.
.PHONY: $(1) \
diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
index c5d4080c7..38d00dbbf 100644
--- a/package/pkg-utils.mk
+++ b/package/pkg-utils.mk
@@ -45,6 +45,13 @@ INFLATE.tar = cat
# suitable-extractor(filename): returns extractor based on suffix
suitable-extractor = $(INFLATE$(suffix $(1)))
+# extractor-dependency(filename): returns extractor for 'filename' if the
+# extractor is a dependency. If we build the extractor return nothing.
+# $(firstword) is used here because the extractor can have arguments, like
+# ZCAT="gzip -d -c", and to check for the dependency we only want 'gzip'.
+extractor-dependency = $(firstword $(INFLATE$(filter-out \
+ $(EXTRACTOR_DEPENDENCY_PRECHECKED_EXTENSIONS),$(suffix $(1)))))
+
# check-deprecated-variable -- throw an error on deprecated variables
# example:
# $(eval $(call check-deprecated-variable,FOO_MAKE_OPT,FOO_MAKE_OPTS))
diff --git a/support/dependencies/check-host-xzcat.mk b/support/dependencies/check-host-xzcat.mk
index 5e08b6e88..c6d9eebe4 100644
--- a/support/dependencies/check-host-xzcat.mk
+++ b/support/dependencies/check-host-xzcat.mk
@@ -3,5 +3,6 @@
ifeq (,$(call suitable-host-package,xzcat,$(XZCAT)))
DEPENDENCIES_HOST_PREREQ += host-xz
+EXTRACTOR_DEPENDENCY_PRECHECKED_EXTENSIONS += .xz .lzma
XZCAT = $(HOST_DIR)/usr/bin/xzcat
endif