From nobody@FreeBSD.org  Sun Mar  8 21:47:58 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6A8E0106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  8 Mar 2009 21:47:58 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 3DD5F8FC1A
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  8 Mar 2009 21:47:58 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n28Llv7b006168
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 8 Mar 2009 21:47:57 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n28LlvKv006166;
	Sun, 8 Mar 2009 21:47:57 GMT
	(envelope-from nobody)
Message-Id: <200903082147.n28LlvKv006166@www.freebsd.org>
Date: Sun, 8 Mar 2009 21:47:57 GMT
From: Anonymous <swell.k@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] audio/xmp: add option to use tar(1) instead of unzip(1) to play zip-compressed module files
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         132435
>Category:       ports
>Synopsis:       [patch] audio/xmp: add option to use tar(1) instead of unzip(1) to play zip-compressed module files
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ehaupt
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 08 21:50:01 UTC 2009
>Closed-Date:    Sat Oct 17 11:12:02 CEST 2009
>Last-Modified:  Sat Oct 17 09:20:03 UTC 2009
>Originator:     Anonymous
>Release:        FreeBSD 8.0-CURRENT amd64
>Organization:
>Environment:
>Description:
Usually most module files are compressed into .zip files. So, utilize libarchive(3) ability to read zip archives through tar(1) for this popular format. Because tar(1) is in base no more need to keep archivers/unzip just for audio/xmp sake.

>How-To-Repeat:
1. assure your tar(1) is able to extract zip archives into stdout
2. install audio/xmp with WITHOUT_UNZIP defined
3. delete archivers/unzip package
4. try to play any zip-compressed module file

>Fix:


Patch attached with submission follows:

Index: audio/xmp/Makefile
===================================================================
RCS file: /home/csup/ports/audio/xmp/Makefile,v
retrieving revision 1.38
diff -u -p -r1.38 Makefile
--- audio/xmp/Makefile	18 May 2008 12:16:40 -0000	1.38
+++ audio/xmp/Makefile	8 Mar 2009 21:32:19 -0000
@@ -45,6 +45,11 @@ CONFIGURE_ARGS+=	--enable-xmms-plugin
 CONFIGURE_ARGS+=	--disable-xmms
 .endif
 
+# use zip reader from libarchive through tar(1) command
+.if defined(WITHOUT_UNZIP)
+EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-src-misc-load.c
+.endif
+
 post-patch:
 .for f in docs/xmp.1 etc/xmp.conf etc/xmp-modules.conf
 	@${REINPLACE_CMD} -e "s|/etc/xmp|${PREFIX}/etc/xmp|g" ${WRKSRC}/${f}
Index: audio/xmp/files/extra-patch-src-misc-load.c
===================================================================
RCS file: audio/xmp/files/extra-patch-src-misc-load.c
diff -N audio/xmp/files/extra-patch-src-misc-load.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ audio/xmp/files/extra-patch-src-misc-load.c	1 Jul 2008 23:41:54 -0000
@@ -0,0 +1,13 @@
+--- src/misc/load.c~	2007-12-07 00:38:08.000000000 +0300
++++ src/misc/load.c	2008-06-30 21:36:08.000000000 +0400
+@@ -91,8 +91,8 @@
+ #endif
+     if (b[0] == 'P' && b[1] == 'K') {
+ 	packer = "Zip";
+-	cmd = "unzip -pqqC \"%s\" -x readme '*.diz' '*.nfo' '*.txt' "
+-		"'*.exe' '*.com' " REDIR_STDERR;
++	cmd = "tar -xOf \"%s\" --exclude readme --exclude '*.diz' --exclude '*.nfo' --exclude '*.txt' "
++		"--exclude '*.exe' --exclude '*.com' " REDIR_STDERR;
+     } else if (b[2] == '-' && b[3] == 'l' && b[4] == 'h') {
+ 	packer = "LHa";
+ #if defined __EMX__


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->anders 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun Mar 8 21:50:11 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=132435 

From: Anonymous <swell.k@gmail.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/132435: [patch] audio/xmp: add option to use tar(1) instead of unzip(1) to play zip-compressed module files
Date: Sun, 26 Jul 2009 12:10:41 +0400

 Here is an updated one for xmp-2.7.1
 --- xmp-no-unzip-2.7.1.diff begins here ---
 Index: audio/xmp/Makefile
 ===================================================================
 RCS file: /home/csup/ports/audio/xmp/Makefile,v
 retrieving revision 1.38
 diff -u -p -r1.38 Makefile
 --- audio/xmp/Makefile	18 May 2008 12:16:40 -0000	1.38
 +++ audio/xmp/Makefile	26 Jul 2009 08:07:30 -0000
 @@ -26,7 +26,8 @@ MAN1=		xmp.1
  MLINKS=		xmp.1 xxmp.1
  
  OPTIONS=	XMMS	"Build XMMS plugin" off \
 -		ESOUND	"EsounD support" off
 +		ESOUND	"EsounD support" off \
 +		UNZIP	"Use unzip(1) for .zip-compressed files" on
  
  CFLAGS+=	-fPIC
  
 @@ -45,6 +46,13 @@ CONFIGURE_ARGS+=	--enable-xmms-plugin
  CONFIGURE_ARGS+=	--disable-xmms
  .endif
  
 +# use unzip(1) or fall back to libarchive(3) reader
 +.if defined(WITH_UNZIP)
 +RUN_DEPENDS+=	${LOCALBASE}/bin/unzip:${PORTSDIR}/archivers/unzip
 +.else
 +EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-src-misc-load.c
 +.endif
 +
  post-patch:
  .for f in docs/xmp.1 etc/xmp.conf etc/xmp-modules.conf
  	@${REINPLACE_CMD} -e "s|/etc/xmp|${PREFIX}/etc/xmp|g" ${WRKSRC}/${f}
 Index: audio/xmp/files/extra-patch-src-misc-load.c
 ===================================================================
 RCS file: audio/xmp/files/extra-patch-src-misc-load.c
 diff -N audio/xmp/files/extra-patch-src-misc-load.c
 --- /dev/null	1 Jan 1970 00:00:00 -0000
 +++ audio/xmp/files/extra-patch-src-misc-load.c	26 Jul 2009 08:06:18 -0000
 @@ -0,0 +1,16 @@
 +--- src/misc/load.c~
 ++++ src/misc/load.c
 +@@ -99,8 +99,11 @@ static int decrunch(struct xmp_context *
 + 	cmd = "unzip -pqqC \"%s\" -x readme *.diz *.nfo *.txt *.exe *.com "
 + 		"README *.DIZ *.NFO *.TXT *.EXE *.COM " REDIR_STDERR;
 + #else
 +-	cmd = "unzip -pqqC \"%s\" -x readme '*.diz' '*.nfo' '*.txt' '*.exe' "
 +-		"'*.com' README '*.DIZ' '*.NFO' '*.TXT' '*.EXE' '*.COM' "
 ++	cmd = "tar xOf \"%s\" --exclude readme --exclude '*.diz' "
 ++		"--exclude '*.nfo' --exclude '*.txt' --exclude '*.exe' "
 ++		"--exclude '*.com' --exclude  README --exclude '*.DIZ' "
 ++		"--exclude '*.NFO' --exclude '*.TXT' --exclude '*.EXE' "
 ++		"--exclude '*.COM' "
 + 		REDIR_STDERR;
 + #endif
 +     } else if (b[2] == '-' && b[3] == 'l' && b[4] == 'h') {
 --- xmp-no-unzip-2.7.1.diff ends here ---

From: Anders Nordby <anders@FreeBSD.org>
To: bug-followup@FreeBSD.org, swell.k@gmail.com
Cc:  
Subject: Re: ports/132435: [patch] audio/xmp: add option to use tar(1) instead of unzip(1) to play zip-compressed module files
Date: Wed, 5 Aug 2009 01:24:49 +0200

 Hi,
 
 Did you try to talk to the xmp developers about this change? It would be
 better to get the configure scripts to discover this feature in FreeBSD
 I think. But in any case the change does look OK.
 
 Are you ok to take over maintainership over xmp? You seem to have more
 interest in this port than me, I just reset MAINTAINERSHIP in Makefile.
 I'll help you get through the two PRs that have been assigned to me
 though.
 
 Bye,
 
 -- 
 Anders.
Responsible-Changed-From-To: anders->ehaupt 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Oct 16 10:09:06 UTC 2009 
Responsible-Changed-Why:  
over to new maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=132435 
State-Changed-From-To: open->closed 
State-Changed-By: ehaupt 
State-Changed-When: Fri Oct 16 12:46:11 CEST 2009 
State-Changed-Why:  
Port was updated a while ago, as far as I can tell some of your additions are now available in the current version, thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=132435 

From: swell.k@gmail.com
To: ehaupt@FreeBSD.org
Cc: bug-followup@freebsd.org
Subject: Re: ports/132435: [patch] audio/xmp: add option to use tar(1) instead of unzip(1) to play zip-compressed module files
Date: Sat, 17 Oct 2009 08:37:43 +0400

 ehaupt@FreeBSD.org writes:
 
 > Synopsis: [patch] audio/xmp: add option to use tar(1) instead of unzip(1) to play zip-compressed module files
 >
 > State-Changed-From-To: open->closed
 > State-Changed-By: ehaupt
 > State-Changed-When: Fri Oct 16 12:46:11 CEST 2009
 > State-Changed-Why: 
 > Port was updated a while ago, as far as I can tell some of your
 > additions are now available in the current version, thanks.
 
 I've seen your commit and updated my snapshot[1]. I believe -fPIC can be
 removed entirely because distfile already has it. It doesn't break build/run
 if I remove it on amd64 from port's Makefile.
 
 However, this PR is about unzip(1) but update to 2.7.1 and -fPIC was
 part of ports/137148.
 
 [1] ftp://ftp.lissyara.su/users/Guest/xmp.diff
 
 >
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=132435
State-Changed-From-To: closed->open 
State-Changed-By: ehaupt 
State-Changed-When: Sat Oct 17 10:29:18 CEST 2009 
State-Changed-Why:  
Reopen, new patches have been submitted. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=132435 
State-Changed-From-To: open->closed 
State-Changed-By: ehaupt 
State-Changed-When: Sat Oct 17 11:11:45 CEST 2009 
State-Changed-Why:  
Committed, thanks for the great work. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=132435 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/132435: commit references a PR
Date: Sat, 17 Oct 2009 09:11:31 +0000 (UTC)

 ehaupt      2009-10-17 09:11:17 UTC
 
   FreeBSD ports repository
 
   Modified files:
     audio/xmp            Makefile distinfo pkg-plist 
   Added files:
     audio/xmp/files      extra-patch-src-misc-load.c 
   Removed files:
     audio/xmp/files      patch-src-drivers-oss_seq.c 
   Log:
   Update to 3.0.0.20090929
   
   PR:             132435
   Submitted by:   swell.k@gmail.com
   
   Revision  Changes    Path
   1.43      +91 -12    ports/audio/xmp/Makefile
   1.11      +3 -3      ports/audio/xmp/distinfo
   1.1       +16 -0     ports/audio/xmp/files/extra-patch-src-misc-load.c (new)
   1.3       +0 -26     ports/audio/xmp/files/patch-src-drivers-oss_seq.c (dead)
   1.6       +9 -3      ports/audio/xmp/pkg-plist
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
