From e4ac1f99edb89c4dfe171917256f23a9e1a15d1c Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Mon, 12 Jan 2015 10:34:16 -0500 Subject: [PATCH] tool/ports: run unzip with UNZIP_OPT The patch supports both, a download-specific UNZIP_OPT(download) and a general UNZIP_OPT that can be defined across downloads. UNZIP_OPT(download) overrides UNZIP_OPT. Note, the `--strip-components=1` argument is not required for unzip. Issue #1357 --- tool/ports/mk/install.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tool/ports/mk/install.mk b/tool/ports/mk/install.mk index e3ca6a265..8e4287059 100644 --- a/tool/ports/mk/install.mk +++ b/tool/ports/mk/install.mk @@ -211,7 +211,8 @@ _file_name = $(call _prefer,$(NAME($1)),$(notdir $(URL($1)))) _archive_name = $(call _prefer,$(NAME($1)),$(notdir $(URL($1)))) _archive_dir = $(call _assert,$(DIR($1)),Missing definition of DIR($*) in $(PORT)) -_tar_opt = $(call _prefer,$(TAR_OPT($1)),--strip-components=1) +_tar_opt = $(call _prefer,$(TAR_OPT($1)),--strip-components=1) +_unzip_opt = $(call _prefer,$(UNZIP_OPT($1)),$(UNZIP_OPT)) # # Archive extraction functions for various archive types @@ -220,7 +221,7 @@ _extract_function(tgz) = tar xfz $(ARCHIVE) -C $(DIR) $(call _tar_opt,$1) _extract_function(tar.gz) = tar xfz $(ARCHIVE) -C $(DIR) $(call _tar_opt,$1) _extract_function(tar.xz) = tar xfJ $(ARCHIVE) -C $(DIR) $(call _tar_opt,$1) _extract_function(tar.bz2) = tar xfj $(ARCHIVE) -C $(DIR) $(call _tar_opt,$1) -_extract_function(zip) = unzip -o -q -d $(DIR) $(ARCHIVE) +_extract_function(zip) = unzip -o -q -d $(DIR) $(call _unzip_opt,$1) $(ARCHIVE) _ARCHIVE_EXTS := tar.gz tar.xz tgz tar.bz2 zip @@ -244,4 +245,3 @@ _extract_function = $(call _assert,\ $(VERBOSE)\ mkdir -p $(DIR);\ $(call _extract_function,$*) -