summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorschwarz <schwarz@pkgsrc.org>2006-08-19 20:32:28 +0000
committerschwarz <schwarz@pkgsrc.org>2006-08-19 20:32:28 +0000
commitf6e10581667fe0945002e5311c33be355062d08b (patch)
tree4e0bfc009fac6c2ff6fe3e4d26a5f03f9ddb5a4f /mk
parent7729fc9cb2d6642c4b999ee732d1ba706d3be1c9 (diff)
downloadpkgsrc-f6e10581667fe0945002e5311c33be355062d08b.tar.gz
it is not necessary to have a variable _EXTRACT_PATTERNS that contains
${EXTRACT_SUFX}, so one can directly use EXTRACT_ONLY instead. EXTRACT_ONLY defaults to ${DISTFILES} which in turn defaults to ${DISTNAME}${EXTRACT_SUFX}. So if EXTRACT_SUFX is relevant for determining which tools are needed this can only happen if neither DISTFILES nor EXTRACT_ONLY have been set by the package, in which case the relevant variable EXTRACT_ONLY would contain EXTRACT_SUFX.
Diffstat (limited to 'mk')
-rw-r--r--mk/extract/bsd.extract-vars.mk63
1 files changed, 29 insertions, 34 deletions
diff --git a/mk/extract/bsd.extract-vars.mk b/mk/extract/bsd.extract-vars.mk
index ba1e61eb475..d181fb14223 100644
--- a/mk/extract/bsd.extract-vars.mk
+++ b/mk/extract/bsd.extract-vars.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.extract-vars.mk,v 1.3 2006/08/19 20:06:57 schwarz Exp $
+# $NetBSD: bsd.extract-vars.mk,v 1.4 2006/08/19 20:32:28 schwarz Exp $
#
# This Makefile fragment is included separately by bsd.pkg.mk and
# defines some variables which must be defined earlier than where
@@ -18,50 +18,45 @@
EXTRACT_ONLY?= ${DISTFILES}
EXTRACT_SUFX?= .tar.gz
-.if !empty(EXTRACT_ONLY)
-
###
### Discover which tools we need based on the file extensions of the
### distfiles.
###
-_EXTRACT_PATTERNS= ${EXTRACT_ONLY} ${EXTRACT_SUFX}
-
-. if !empty(_EXTRACT_PATTERNS:M*.tar) || \
- !empty(_EXTRACT_PATTERNS:M*.tar.*) || \
- !empty(_EXTRACT_PATTERNS:M*.tbz) || \
- !empty(_EXTRACT_PATTERNS:M*.tbz2) || \
- !empty(_EXTRACT_PATTERNS:M*.tgz) || \
- !empty(_EXTRACT_PATTERNS:M*-tar.gz) || \
- !empty(_EXTRACT_PATTERNS:M*_tar.gz)
-. if !empty(EXTRACT_USING:Mgtar)
+.if !empty(EXTRACT_ONLY:M*.tar) || \
+ !empty(EXTRACT_ONLY:M*.tar.*) || \
+ !empty(EXTRACT_ONLY:M*.tbz) || \
+ !empty(EXTRACT_ONLY:M*.tbz2) || \
+ !empty(EXTRACT_ONLY:M*.tgz) || \
+ !empty(EXTRACT_ONLY:M*-tar.gz) || \
+ !empty(EXTRACT_ONLY:M*_tar.gz)
+. if !empty(EXTRACT_USING:Mgtar)
USE_TOOLS+= gtar
-. elif !empty(EXTRACT_USING:Mnbtar)
+. elif !empty(EXTRACT_USING:Mnbtar)
USE_TOOLS+= tar
-. else
+. else
USE_TOOLS+= pax
-. endif
-. endif
-. if !empty(_EXTRACT_PATTERNS:M*.bz2) || \
- !empty(_EXTRACT_PATTERNS:M*.tbz) || \
- !empty(_EXTRACT_PATTERNS:M*.tbz2)
+. endif
+.endif
+.if !empty(EXTRACT_ONLY:M*.bz2) || \
+ !empty(EXTRACT_ONLY:M*.tbz) || \
+ !empty(EXTRACT_ONLY:M*.tbz2)
USE_TOOLS+= bzcat
-. endif
-. if !empty(_EXTRACT_PATTERNS:M*.zip)
+.endif
+.if !empty(EXTRACT_ONLY:M*.zip)
USE_TOOLS+= unzip
-. endif
-. if !empty(_EXTRACT_PATTERNS:M*.lzh) || \
- !empty(_EXTRACT_PATTERNS:M*.lha)
+.endif
+.if !empty(EXTRACT_ONLY:M*.lzh) || \
+ !empty(EXTRACT_ONLY:M*.lha)
USE_TOOLS+= lha
-. endif
-. if !empty(_EXTRACT_PATTERNS:M*.gz) || \
- !empty(_EXTRACT_PATTERNS:M*.tgz) || \
- !empty(_EXTRACT_PATTERNS:M*.Z)
+.endif
+.if !empty(EXTRACT_ONLY:M*.gz) || \
+ !empty(EXTRACT_ONLY:M*.tgz) || \
+ !empty(EXTRACT_ONLY:M*.Z)
USE_TOOLS+= gzcat
-. endif
-. if !empty(_EXTRACT_PATTERNS:M*.zoo)
+.endif
+.if !empty(EXTRACT_ONLY:M*.zoo)
USE_TOOLS+= unzoo
-. endif
-. if !empty(_EXTRACT_PATTERNS:M*.rar)
+.endif
+.if !empty(EXTRACT_ONLY:M*.rar)
USE_TOOLS+= unrar
-. endif
.endif