ports/146533: [patch] convert unzip -a to USE_DOS2UNIX

Alex Kozlov spam at rm-rf.kiev.ua
Thu May 13 02:00:16 UTC 2010


>Number:         146533
>Category:       ports
>Synopsis:       [patch] convert unzip -a to USE_DOS2UNIX
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 13 02:00:16 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Alex Kozlov
>Release:        RELENG_8
>Organization:
private
>Environment:
>Description:
Native unzip can't reliably detect text files(limitation of libarchive), because of that dos2unix line conversion is dangerous. Convert all uses of unzip -a to USE_DOS2UNIX in preparation of use native unzip in ports. Also take maintainership of graphics/fli2gif.

List of ports:
games/darkplaces
games/quake2-ctf
games/quake2-data
games/xevil
graphics/fli2gif
misc/astrolog
misc/projectionlib
print/acrobatviewer
sysutils/megarc
textproc/docbook-420
textproc/iso8879
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: games/darkplaces/Makefile
@@ -18,6 +18,7 @@
 USE_ZIP=	yes
 USE_GMAKE=	yes
 USE_XORG=	xxf86dga xpm
+USE_DOS2UNIX=	darkplaces.txt
 MAKE_ENV=	DP_FS_BASEDIR="${Q1DIR}"
 WRKSRC=		${WRKDIR}/${PORTNAME}
 
@@ -68,8 +69,8 @@
 .endif
 
 post-extract:
-	@${UNZIP_CMD} -aq \
-		-o ${WRKDIR}/${PORTNAME}enginesource${PORTVERSION}.zip \
+	@${UNZIP_CMD} ${EXTRACT_BEFORE_ARGS} \
+		${WRKDIR}/${PORTNAME}enginesource${PORTVERSION}.zip \
 		-d ${WRKDIR}
 
 do-install:
@@ -80,7 +81,7 @@
 	@${TOUCH} ${DATADIR}/dummy
 .if !defined(NOPORTDOCS)
 	${MKDIR} ${DOCSDIR}
-	${INSTALL_DATA} ${WRKDIR}/darkplaces.txt ${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/darkplaces.txt ${DOCSDIR}
 .endif
 
 .include <bsd.port.post.mk>
Index: games/quake2-ctf/Makefile
@@ -20,6 +20,7 @@
 COMMENT=	Quake II CTF (Capture The Flag) modification
 
 USE_ZIP=	yes
+USE_DOS2UNIX=	../../../ctf/readme.txt ../../../ctf/server.cfg
 WRKSRC=		${WRKDIR}/${CTF_SRC:S/.tar.gz//}/src/ctf
 
 LATEST_LINK=	${PKGNAMEPREFIX}${PORTNAME}
@@ -36,7 +37,7 @@
 	@${MKDIR} ${WRKDIR}
 	@${TAR} zxf ${DISTDIR}/${DIST_SUBDIR}/${CTF_SRC} -C ${WRKDIR} \
 		--include "${CTF_SRC:S/.tar.gz//}/src/ctf/*"
-	@${UNZIP_CMD} -aq -d ${WRKDIR}/ctf \
+	@${UNZIP_CMD} ${EXTRACT_BEFORE_ARGS} -d ${WRKDIR}/ctf \
 		${DISTDIR}/${DIST_SUBDIR}/${CTF_DATA} -x *.dll *.ico
 
 post-extract:
Index: games/quake2-data/Makefile
@@ -19,6 +19,7 @@
 MAINTAINER=	alepulver at FreeBSD.org
 COMMENT=	Quake II data files
 
+#XXX need info-unzip for q2-314-demo-x86.exe
 USE_ZIP=	yes
 NO_WRKSUBDIR=	yes
 
Index: games/xevil/Makefile
@@ -17,6 +17,7 @@
 
 USE_ZIP=	yes
 USE_XORG=	xpm
+USE_DOS2UNIX= makefile config.mk cmn/makefile cmn/*.cpp cmn/*.h x11/makefile x11/*.cpp
 MAKEFILE=	makefile
 ALL_TARGET=	freebsd
 MAKE_JOBS_UNSAFE=	yes
@@ -32,7 +33,7 @@
 	@${MKDIR} ${WRKDIR}/${DISTNAME}
 
 do-extract:
-	@unzip -aqo ${DISTDIR}/${DISTFILES} -d ${WRKSRC}
+	@${UNZIP_CMD} ${EXTRACT_BEFORE_ARGS} ${DISTDIR}/${DISTFILES} -d ${WRKSRC}
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/x11/FREEBSD/xevil ${PREFIX}/bin/xevil
Index: graphics/fli2gif/Makefile
@@ -12,17 +12,16 @@
 MASTER_SITES=	http://jeff.bovine.net/download/fli2gif/
 DISTNAME=	${PORTNAME}b
 
-MAINTAINER=	ports at FreeBSD.org
+MAINTAINER=	spam at rm-rf.kiev.ua
 COMMENT=	Automatic Flic to animated GIF convertor
 
 NO_WRKSUBDIR=	yes
 
 USE_ZIP=	yes
+USE_DOS2UNIX=	fli2gif.cpp FLI2GIF.TXT
 
 post-extract:
-	@cd ${WRKSRC} && unzip -q -aa source.zip \
-		&& ${LN} -sf GIF.CPP gif.cpp \
-		&& ${LN} -sf FLIPLAY.CPP fliplay.cpp
+	@cd ${WRKSRC} && ${UNZIP_CMD} -qL source.zip
 
 do-build:
 	@cd ${WRKSRC} && ${CXX} ${CXXFLAGS} -o ${PORTNAME} *.cpp
@@ -31,7 +30,7 @@
 	${INSTALL_PROGRAM} ${WRKSRC}/fli2gif ${PREFIX}/bin
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${DOCSDIR}
-	${INSTALL_DATA}	${WRKSRC}/*.TXT ${DOCSDIR}
+	${INSTALL_DATA}	${WRKSRC}/FLI2GIF.TXT ${DOCSDIR}
 .endif
 
 .include <bsd.port.mk>
Index: graphics/fli2gif/files/patch-ab
@@ -1,40 +0,0 @@
---- fli2gif.cpp.orig	Fri Sep  6 00:10:14 1996
-+++ fli2gif.cpp	Fri Nov  1 06:18:18 2002
-@@ -43,7 +43,9 @@
- // ******************
- #include <stdio.h>
- #include <stdlib.h>
--#include <malloc.h>
-+#ifndef __STDC__
-+# include <malloc.h>
-+#endif
- #include <string.h>
- #if defined(__TURBOC__) || defined(_MSC_VER)
-     #include <conio.h>
-@@ -95,7 +97,7 @@
- //############################################################################
- //############################################################################
- //############################################################################
--void main(int argc, char *argv[])
-+int main(int argc, char *argv[])
- {
-     FILE *fp;
-     int i, j;
-@@ -104,7 +106,7 @@
-     // []----------------[]
-     // |  Initialization  |
-     // []----------------[]
--    printf("FLI2GIF.EXE -- Automatic Flic to Animated GIF convertor, v1.1\n");
-+    printf("FLI2GIF -- Automatic Flic to Animated GIF convertor, v1.1\n");
-     printf("   by JL Enterprises, 1996.  (Compiled with "
-         #if defined(__TURBOC__)
-             "Borland"
-@@ -117,6 +119,8 @@
-             " for Windows"
-         #elif defined(__MSDOS__) || defined(_DOS)
-             " for MS-DOS"
-+        #elif defined(__FreeBSD__)
-+            " for FreeBSD"
-         #endif    
-         ")\n\n");
-     {
Index: graphics/fli2gif/files/patch-fli2gif.c
@@ -0,0 +1,57 @@
+Index: fli2gif.cpp
+@@ -43,7 +43,9 @@
+ // ******************
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <malloc.h>
++#ifndef __STDC__
++# include <malloc.h>
++#endif
+ #include <string.h>
+ #if defined(__TURBOC__) || defined(_MSC_VER)
+     #include <conio.h>
+@@ -81,7 +83,7 @@
+ // ***  Function prototypes  ***
+ // *****************************
+ void handle_error(int errorcode);
+-char *add_extension(char *filename, char *extension, BOOL enforce);
++char *add_extension(char *filename, const char *extension, BOOL enforce);
+ 
+ 
+ // **************************
+@@ -95,7 +97,7 @@
+ //############################################################################
+ //############################################################################
+ //############################################################################
+-void main(int argc, char *argv[])
++int main(int argc, char *argv[])
+ {
+     FILE *fp;
+     int i, j;
+@@ -104,7 +106,7 @@
+     // []----------------[]
+     // |  Initialization  |
+     // []----------------[]
+-    printf("FLI2GIF.EXE -- Automatic Flic to Animated GIF convertor, v1.1\n");
++    printf("FLI2GIF -- Automatic Flic to Animated GIF convertor, v1.1\n");
+     printf("   by JL Enterprises, 1996.  (Compiled with "
+         #if defined(__TURBOC__)
+             "Borland"
+@@ -117,6 +119,8 @@
+             " for Windows"
+         #elif defined(__MSDOS__) || defined(_DOS)
+             " for MS-DOS"
++        #elif defined(__FreeBSD__)
++            " for FreeBSD"
+         #endif    
+         ")\n\n");
+     {
+@@ -389,7 +393,7 @@
+ // Takes a user-entered filename and adds the specified extension if an
+ // entension is not explicitly stated in the passed filename.  A pointer
+ // to a static buffer is returned.
+-char *add_extension(char *filename, char *extension, BOOL enforce)
++char *add_extension(char *filename, const char *extension, BOOL enforce)
+ {
+     static char Path[_MAX_PATH];
+ 
Index: misc/astrolog/Makefile
@@ -22,6 +22,7 @@
 COMMENT=	An astrology program for X11 and alpha-numeric terminals
 
 USE_ZIP=	yes
+USE_DOS2UNIX=	ephem/EPHINDEX.TXT
 .if !defined(WITHOUT_X11)
 USE_XORG=	x11
 MAKE_ARGS=	-DX11
@@ -35,7 +36,7 @@
 
 post-extract:
 	-@${MKDIR} ${WRKDIR}/ephem
-	${UNZIP_CMD} -qao ${_DISTDIR}/${EPHEM} -d ${WRKDIR}/ephem
+	${UNZIP_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/${EPHEM} -d ${WRKDIR}/ephem
 
 post-patch:
 	@${REINPLACE_CMD} -e "s at malloc.h@stdlib.h at g" \
Index: misc/projectionlib/Makefile
@@ -16,11 +16,10 @@
 
 LIB_DEPENDS=	gctpc.1:${PORTSDIR}/misc/gctpc
 
-EXTRACT_CMD=	unzip -a
-
 WRKSRC=		${WRKDIR}/dlgv32/ProjectionLib
 
 USE_ZIP=	yes
+USE_DOS2UNIX=	*.cpp *.h
 USE_LDCONFIG=	yes
 MAKEFILE=	${FILESDIR}/Makefile
 
Index: print/acrobatviewer/Makefile
@@ -16,6 +16,7 @@
 MAINTAINER=	ports at FreeBSD.org
 COMMENT=	Viewer for the PDF files written in Java(TM)
 
+#XXX need info-unzip for archive.zip
 USE_ZIP=	yes
 USE_JAVA=	yes
 JAVA_VERSION=	1.3+
Index: sysutils/megarc/Makefile
@@ -15,6 +15,7 @@
 COMMENT=	LSI Logic's MegaRAID controlling software
 
 USE_ZIP=	yes
+USE_DOS2UNIX=	Release\ History.txt
 NO_BUILD=	yes
 NO_WRKSUBDIR=	yes
 
@@ -25,7 +26,7 @@
 PORTDOCS=	*
 
 post-extract:
-	@cd ${WRKSRC} && ${UNZIP_CMD} -aqo 'MegaRC 1.04.zip'
+	@cd ${WRKSRC} && ${UNZIP_CMD} ${EXTRACT_BEFORE_ARGS} 'MegaRC 1.04.zip'
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/megarc ${PREFIX}/sbin
Index: textproc/docbook-420/Makefile
@@ -20,7 +20,6 @@
 RUN_DEPENDS=	${ISOCAT}:${PORTSDIR}/textproc/iso8879 \
 		${XMLCATMGR}:${PORTSDIR}/textproc/xmlcatmgr
 
-BUILD_DEPENDS=	unzip:${PORTSDIR}/archivers/unzip
 USE_ZIP=	yes
 NO_MTREE=	yes
 NO_BUILD=	yes
@@ -41,7 +40,7 @@
 	@[ -d ${INSTDIR}/${PORTVERSION} ] || ${MKDIR} ${INSTDIR}/${PORTVERSION}
 
 do-install:
-	@unzip -a -q -o ${DISTDIR}/${DISTFILES} -d ${INSTDIR}/${PORTVERSION}
+	@${UNZIP_CMD} ${EXTRACT_BEFORE_ARGS} ${DISTDIR}/${DISTFILES} -d ${INSTDIR}/${PORTVERSION}
 	@${INSTALL_DATA} ${FILESDIR}/catalog ${INSTDIR}/${PORTVERSION}/catalog
 	@${ECHO_CMD} "CATALOG \"${ISOCAT}\"" >> ${INSTDIR}/${PORTVERSION}/catalog
 	@${CHMOD} ${SHAREMODE} ${INSTDIR}/${PORTVERSION}/*
Index: textproc/iso8879/Makefile
@@ -12,15 +12,14 @@
 MASTER_SITES=	${MASTER_SITE_LOCAL}
 MASTER_SITE_SUBDIR=	kuriyama
 DISTNAME=	isoENTS
-EXTRACT_SUFX=	.zip
 
 MAINTAINER=	kuriyama at FreeBSD.org
 COMMENT=	Character entity sets from ISO 8879:1986 (SGML)
 
-BUILD_DEPENDS=	unzip:${PORTSDIR}/archivers/unzip
 RUN_DEPENDS=	${XMLCATMGR}:${PORTSDIR}/textproc/xmlcatmgr
 
 EXTRACT_ONLY=	# empty
+USE_ZIP=	yes
 NO_BUILD=	yes
 NO_WRKSUBDIR=	yes
 PLIST_SUB=	DTD_NAME=${PORTNAME} XMLCATMGR=${XMLCATMGR}
@@ -34,7 +33,7 @@
 	@[ -d ${INSTDIR} ] || ${MKDIR} ${INSTDIR}
 
 do-install:
-	@unzip -a -q -o ${DISTDIR}/${DISTFILES} -d ${INSTDIR}
+	@${UNZIP_CMD} ${EXTRACT_BEFORE_ARGS} ${DISTDIR}/${DISTFILES} -d ${INSTDIR}
 	@${INSTALL_DATA} ${FILESDIR}/catalog ${INSTDIR}/catalog
 	@${CHMOD} ${SHAREMODE} ${INSTDIR}/*
 	@${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${INSTDIR}


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list