NetBSD's (and bootstrap's) pax-as-tar is GNUish enough to extract most

GNU tar archives.  Create a new EXTRACT_USING value "nbtar" that causes
tar/ustar archives to be extracted using pax-as-tar, which understands
most GNU tar extensions.  Default to EXTRACT_USING=nbtar, as quite a
few packages are distributed in GNU tar archives.
This commit is contained in:
jlam 2005-05-16 18:43:20 +00:00
parent a77257ee11
commit 482689cdaa
2 changed files with 14 additions and 8 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: bsd.pkg.extract.mk,v 1.5 2005/05/16 04:22:40 jlam Exp $ # $NetBSD: bsd.pkg.extract.mk,v 1.6 2005/05/16 18:43:20 jlam Exp $
# #
# This Makefile fragment is included to bsd.pkg.mk and defines the # This Makefile fragment is included to bsd.pkg.mk and defines the
# relevant variables and targets for the "extract" phase. # relevant variables and targets for the "extract" phase.
@ -22,8 +22,8 @@
# that ends in <sufx>. # that ends in <sufx>.
# #
# EXTRACT_USING specifies the tool used to extract tar/ustar-format # EXTRACT_USING specifies the tool used to extract tar/ustar-format
# archives. The possible values are "pax" and "gtar". By # archives. The possible values are "gtar", "nbtar", and "pax".
# default, we use the "pax" tool. # By default, we use the "nbtar" tool (NetBSD's pax-as-tar).
# #
# EXTRACT_ELEMENTS is a list of files within the distfile to extract. # EXTRACT_ELEMENTS is a list of files within the distfile to extract.
# This variable only takes effect for distfiles that are tarballs. # This variable only takes effect for distfiles that are tarballs.
@ -38,7 +38,7 @@
EXTRACT_ONLY?= ${DISTFILES} EXTRACT_ONLY?= ${DISTFILES}
EXTRACT_SUFX?= .tar.gz EXTRACT_SUFX?= .tar.gz
EXTRACT_USING?= pax EXTRACT_USING?= nbtar
_EXTRACT_SUFFIXES= .tar.gz .tgz .tar.bz2 .tbz .tar.Z .tar _tar.gz _EXTRACT_SUFFIXES= .tar.gz .tgz .tar.bz2 .tbz .tar.Z .tar _tar.gz
_EXTRACT_SUFFIXES+= .shar.gz .shar.bz2 .shar.Z .shar _EXTRACT_SUFFIXES+= .shar.gz .shar.bz2 .shar.Z .shar
@ -55,6 +55,8 @@ _EXTRACT_SUFFIXES+= .rar
!empty(EXTRACT_SUFX:M*.tbz) || !empty(EXTRACT_SUFX:M*.tgz) !empty(EXTRACT_SUFX:M*.tbz) || !empty(EXTRACT_SUFX:M*.tgz)
. if !empty(EXTRACT_USING:Mgtar) . if !empty(EXTRACT_USING:Mgtar)
PKGSRC_USE_TOOLS+= gtar PKGSRC_USE_TOOLS+= gtar
. elif !empty(EXTRACT_USING:Mnbtar)
PKGSRC_USE_TOOLS+= tar
. else . else
PKGSRC_USE_TOOLS+= pax PKGSRC_USE_TOOLS+= pax
. endif . endif
@ -165,6 +167,8 @@ EXTRACT_CMD${__suffix__}?= ${DECOMPRESS_CMD${__suffix__}} $${extract_file} | ${S
.if !empty(EXTRACT_USING:Mgtar) .if !empty(EXTRACT_USING:Mgtar)
_DFLT_EXTRACT_CMD?= ${DECOMPRESS_CMD} $${extract_file} | ${GTAR} -xf - ${EXTRACT_ELEMENTS} _DFLT_EXTRACT_CMD?= ${DECOMPRESS_CMD} $${extract_file} | ${GTAR} -xf - ${EXTRACT_ELEMENTS}
.elif !empty(EXTRACT_USING:Mnbtar)
_DFLT_EXTRACT_CMD?= ${DECOMPRESS_CMD} $${extract_file} | ${TAR} -xf - ${EXTRACT_ELEMENTS}
.else .else
_DFLT_EXTRACT_CMD?= ${DECOMPRESS_CMD} $${extract_file} | ${PAX} -O -r ${EXTRACT_ELEMENTS} _DFLT_EXTRACT_CMD?= ${DECOMPRESS_CMD} $${extract_file} | ${PAX} -O -r ${EXTRACT_ELEMENTS}
.endif .endif
@ -173,6 +177,8 @@ _DFLT_EXTRACT_CMD?= ${DECOMPRESS_CMD} $${extract_file} | ${PAX} -O -r ${EXTRACT_
. if !defined(EXTRACT_CMD${__suffix__}) . if !defined(EXTRACT_CMD${__suffix__})
. if !empty(EXTRACT_USING:Mgtar) . if !empty(EXTRACT_USING:Mgtar)
EXTRACT_CMD${__suffix__}?= ${DECOMPRESS_CMD${__suffix__}} $${extract_file} | ${GTAR} -xf - ${EXTRACT_ELEMENTS} EXTRACT_CMD${__suffix__}?= ${DECOMPRESS_CMD${__suffix__}} $${extract_file} | ${GTAR} -xf - ${EXTRACT_ELEMENTS}
. elif !empty(EXTRACT_USING:Mnbtar)
EXTRACT_CMD${__suffix__}?= ${DECOMPRESS_CMD${__suffix__}} $${extract_file} | ${TAR} -xf - ${EXTRACT_ELEMENTS}
. else . else
EXTRACT_CMD${__suffix__}?= ${DECOMPRESS_CMD${__suffix__}} $${extract_file} | ${PAX} -O -r ${EXTRACT_ELEMENTS} EXTRACT_CMD${__suffix__}?= ${DECOMPRESS_CMD${__suffix__}} $${extract_file} | ${PAX} -O -r ${EXTRACT_ELEMENTS}
. endif . endif

View file

@ -1,4 +1,4 @@
# $NetBSD: mk.conf,v 1.41 2005/05/16 03:07:38 jlam Exp $ # $NetBSD: mk.conf,v 1.42 2005/05/16 18:43:20 jlam Exp $
# #
# A file providing defaults for pkgsrc and the packages collection. # A file providing defaults for pkgsrc and the packages collection.
@ -507,10 +507,10 @@ PATCH_FUZZ_FACTOR?= -F0
# Possible: any combination of packages # Possible: any combination of packages
# Default: not set # Default: not set
EXTRACT_USING?= pax EXTRACT_USING?= nbtar
# Use the specified tool to extract tar/ustar archives. # Use the specified tool to extract tar/ustar archives.
# Possible: pax, gtar # Possible: gtar, nbtar, pax
# Default: pax # Default: nbtar
#FAILOVER_FETCH= #FAILOVER_FETCH=
# Perform a checksum at "make fetch" time. If the checksum doesn't # Perform a checksum at "make fetch" time. If the checksum doesn't