Subject: pkg/33571: extraction doesn't know about distfiles with -tar.gz suffix
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <dieter.NetBSD@pandora.be>
List: pkgsrc-bugs
Date: 05/27/2006 15:10:00
>Number:         33571
>Category:       pkg
>Synopsis:       extraction doesn't know about distfiles with -tar.gz suffix
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat May 27 15:10:00 +0000 2006
>Originator:     Dieter Roelants
>Release:        NetBSD 3.99.20
>Organization:
>Environment:
System: NetBSD origin.amelgem.be 3.99.20 NetBSD 3.99.20 (ORIGIN) #63: Thu May 18 07:00:58 CEST 2006  dieter@origin.amelgem.be:/usr/build/obj/sys/arch/i386/compile/ORIGIN i386
Architecture: i386
Machine: i386
>Description:
	Some tarballs, notably from the OpenH323 Project have a
	suffix of -tar.gz, instead of more common ones.
	mk/bsd.pkg.extract.mk and the mk/scripts/extract don't
	recognise this suffix as being gzipped tar (they already
	have _tar.gz though).

	devel/pwlib and net/openh323 currently work around this
	with a post-extract target, I'd rather not repeat it for
	wip/opal.
>How-To-Repeat:
>Fix:

Index: bsd.pkg.extract.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.extract.mk,v
retrieving revision 1.21
diff -u -r1.21 bsd.pkg.extract.mk
--- bsd.pkg.extract.mk	23 Jan 2006 14:43:50 -0000	1.21
+++ bsd.pkg.extract.mk	27 May 2006 13:48:54 -0000
@@ -72,7 +72,8 @@
     !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) || \
+    !empty(_EXTRACT_PATTERNS:M*-tar.gz)
 .  if !empty(EXTRACT_USING:Mgtar)
 USE_TOOLS+=	gtar
 .  elif !empty(EXTRACT_USING:Mnbtar)
Index: scripts/extract
===================================================================
RCS file: /cvsroot/pkgsrc/mk/scripts/extract,v
retrieving revision 1.20
diff -u -r1.20 extract
--- scripts/extract	19 Feb 2006 15:38:23 -0000	1.20
+++ scripts/extract	27 May 2006 13:48:59 -0000
@@ -178,7 +178,7 @@
 
 # Derive the format of the archive based on the file extension.
 case "$distfile" in
-*.tar.gz|*.tgz|*_tar.gz|*.tar.bz2|*.tbz|*.tbz2|*.tar.Z|*.tar.z|*.tar|*.tar.bz)
+*.tar.gz|*.tgz|*_tar.gz|*-tar.gz|*.tar.bz2|*.tbz|*.tbz2|*.tar.Z|*.tar.z|*.tar|*.tar.bz)
 		_format=tar ;;
 *.shar.gz|*.shar.bz2|*.shar.Z|*.shar|*.shr.gz|*.shr.bz2|*.shr.Z|*.shr)
 		_format=shar ;;