Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Mar 2009 21:47:57 GMT
From:      Anonymous <swell.k@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/132435: [patch] audio/xmp: add option to use tar(1) instead of unzip(1) to play zip-compressed module files
Message-ID:  <200903082147.n28LlvKv006166@www.freebsd.org>
Resent-Message-ID: <200903082150.n28Lo1gI087033@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 08 21:50:01 UTC 2009
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903082147.n28LlvKv006166>