Date: Fri, 15 Aug 2014 10:11:10 +0000 (UTC) From: John Marino <marino@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r364956 - in head: . archivers/unzip archivers/unzip-iconv archivers/unzip/files chinese/unzip korean/unzip russian/unzip Message-ID: <201408151011.s7FABAI8072191@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: marino Date: Fri Aug 15 10:11:10 2014 New Revision: 364956 URL: http://svnweb.freebsd.org/changeset/ports/364956 QAT: https://qat.redports.org/buildarchive/r364956/ Log: Merge 4 unzip slave ports into archivers/unzip as non-default options It is practically impossible to use any of the unzip slave ports. This is because archivers/unzip is used by the ports infrastruction (via USES=zip, USES=zip:infozip) and each slave port conflicts with it. If you install the slave port first, then the port infrastructure can't install archivers/unzip (although if attempted, the extracts dependency might be satisfied by the slave port so it might actually work). In any case, this change: * Adds "iconv" support as an non-default option * Add a localization group that can have zero or one selection * That group contains Chinese, Korean, or Russian support * WITH_UNZIP_UNREDUCE support was removed (I'm not sure it even worked) * Makefile was simplified (several loops removed) * Removes unzip-iconv, Chinese, Korean, Russian slave ports PR: 190349 Reported by: Mikhail Rokhin Unzip overhaul: marino Approved by: maintainer (ehaupt@) Added: head/archivers/unzip/files/extra-iconv-patch-unix_unix.c (contents, props changed) head/archivers/unzip/files/extra-iconv-patch-unix_unxcfg.h (contents, props changed) head/archivers/unzip/files/extra-iconv-patch-unzip.c (contents, props changed) head/archivers/unzip/files/extra-iconv-patch-unzpriv.h (contents, props changed) head/archivers/unzip/files/extra-iconv-patch-zipinfo.c (contents, props changed) head/archivers/unzip/files/extra-ko-patch-fileio.c (contents, props changed) head/archivers/unzip/files/extra-ko-patch-unzip.c (contents, props changed) head/archivers/unzip/files/extra-ko-patch-unzip.h (contents, props changed) head/archivers/unzip/files/extra-ru-patch-ebcdic.h (contents, props changed) head/archivers/unzip/files/extra-zh-patch-fileio.c (contents, props changed) head/archivers/unzip/files/patch-consts.h (contents, props changed) head/archivers/unzip/files/patch-unix_Makefile (contents, props changed) head/archivers/unzip/files/patch-unix_unix.c (contents, props changed) Deleted: head/archivers/unzip-iconv/ head/archivers/unzip/files/patch-aa head/archivers/unzip/files/patch-ab head/archivers/unzip/files/patch-contsts.h head/chinese/unzip/ head/korean/unzip/ head/russian/unzip/ Modified: head/MOVED head/archivers/unzip/Makefile head/archivers/unzip/distinfo head/archivers/unzip/files/patch-process.c Modified: head/MOVED ============================================================================== --- head/MOVED Fri Aug 15 09:59:13 2014 (r364955) +++ head/MOVED Fri Aug 15 10:11:10 2014 (r364956) @@ -6414,3 +6414,7 @@ devel/glib-java||2014-08-14|Has expired: www/phpgedview|www/webtrees|2014-08-15|Has expired: Superceded by www/webtrees graphics/luxrays||2014-08-15|Has expired: No longer needed as luxrender bundles its own verion now net-mgmt/cflowd||2014-08-15|Has expired: Unmaintained 10 years, requires dozens of patches, unverifiable +archivers/unzip-iconv|archivers/unzip|2014-08-15|Merged with archivers/unzip as a new non-default option +chinese/unzip|archivers/unzip|2014-08-15|Merged with archivers/unzip as a new non-default option +korean/unzip|archivers/unzip|2014-08-15|Merged with archivers/unzip as a new non-default option +russian/unzip|archivers/unzip|2014-08-15|Merged with archivers/unzip as a new non-default option Modified: head/archivers/unzip/Makefile ============================================================================== --- head/archivers/unzip/Makefile Fri Aug 15 09:59:13 2014 (r364955) +++ head/archivers/unzip/Makefile Fri Aug 15 10:11:10 2014 (r364956) @@ -3,23 +3,22 @@ PORTNAME= unzip PORTVERSION= 6.0 -PORTREVISION= 1 -CATEGORIES?= archivers +PORTREVISION= 2 +CATEGORIES= archivers MASTER_SITES= SF/infozip/UnZip%206.x%20%28latest%29/UnZip%20${PORTVERSION}/:main \ SF/infozip/UnZip%205.x%20and%20earlier/5.51/:unreduce DISTNAME= ${PORTNAME}60 DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:main -MAINTAINER?= ehaupt@FreeBSD.org -COMMENT?= List, test, and extract compressed files in a ZIP archive +MAINTAINER= ehaupt@FreeBSD.org +COMMENT= List, test, and extract compressed files from a ZIP archive LICENSE= Info-ZIP LICENSE_NAME= Info-ZIP license LICENSE_FILE= ${WRKSRC}/LICENSE LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept -CONFLICTS?= unzip-iconv-[0-9]* zh-unzip-[0-9]* ko-unzip-[0-9]* ru-unzip-[0-9]* - +ALL_TARGET= bsd MAKEFILE= unix/Makefile MAKE_ARGS= LF2="${STRIP}" .if defined(INSTALL_AS_INFOUNZIP) @@ -27,50 +26,67 @@ UNZIP_NAME= info-unzip .else UNZIP_NAME= unzip .endif -PLIST_FILES= bin/${UNZIP_NAME} bin/funzip bin/unzipsfx bin/zipgrep bin/zipinfo PORTDOCS= README WHERE -MANPAGES= ${UNZIP_NAME}.1 funzip.1 unzipsfx.1 zipgrep.1 zipinfo.1 +MANPAGES= ${UNZIP_NAME}.1 funzip.1 unzipsfx.1 zipgrep.1 zipinfo.1 +PLIST_FILES= bin/${UNZIP_NAME} bin/funzip bin/unzipsfx bin/zipgrep \ + bin/zipinfo +PLIST_FILES+= ${MANPAGES:C|^(.*)\.([1-9])$|man/man\2/\1.\2.gz|} LOCAL_UNZIP= ${CFLAGS} -DACORN_FTYPE_NFS -DWILD_STOP_AT_DIR \ -DUNICODE_SUPPORT -DUTF8_MAYBE_NATIVE -D_MBCS \ -DLARGE_FILE_SUPPORT -.if defined(WITH_UNZIP_UNREDUCE) -DISTFILES+= unreduce_full.zip:unreduce -EXTRACT_ONLY+= ${DISTNAME}${EXTRACT_SUFX} -LOCAL_UNZIP+= -DUSE_SMITH_CODE -.endif - -.if defined(WITH_ICONV) -PATCH_SITES+= ${MASTER_SITE_LOCAL} -PATCH_SITE_SUBDIR= nork -PATCHFILES+= unzip60-alt-iconv-utf8.patch -PATCH_DIST_STRIP+= -p1 -USES= iconv -CFLAGS+= -I${LOCALBASE}/include -DNATIVE -MAKE_ARGS+= LFLAGS1="-L${LOCALBASE}/lib ${ICONV_LIB}" -.endif - MAKE_ENV= LOCAL_UNZIP="${LOCAL_UNZIP}" \ D_USE_BZ2=-DUSE_BZIP2 L_BZ2=-lbz2 .ifdef USE_UNZIP -.error You have `USE_UNZIP' variable defined either in environment or in make(1) arguments. Please undefine and try again. +.error You have "USE_UNZIP" variable defined in environment or in \ + make(1) arguments. Please undefine and try again. .endif -OPTIONS_DEFINE= DOCS +OPTIONS_DEFINE= DOCS ICONV +OPTIONS_RADIO= RG1 +OPTIONS_RADIO_RG1= CHINESE KOREAN RUSSIAN + +RG1_DESC= Localization +CHINESE_DESC= Chinese language support +KOREAN_DESC= Korean language support +RUSSIAN_DESC= CP866 and KOI8-R support -.include <bsd.port.pre.mk> +ICONV_USES= iconv -.if ${ARCH} == "i386" +.include <bsd.port.options.mk> + +.if ${ARCH} == i386 ALL_TARGET= freebsd -.else -ALL_TARGET= bsd .endif -.for m in ${MANPAGES} -PLIST_FILES+= man/man1/${m}.gz -.endfor +.if ${PORT_OPTIONS:MICONV} +CFLAGS+= -I${LOCALBASE}/include -DNATIVE +MAKE_ARGS+= LFLAGS1="-L${LOCALBASE}/lib ${ICONV_LIB}" +EXTRA_PATCHES+= ${FILESDIR}/extra-iconv-patch-unix_unix.c \ + ${FILESDIR}/extra-iconv-patch-unix_unxcfg.h \ + ${FILESDIR}/extra-iconv-patch-unzip.c \ + ${FILESDIR}/extra-iconv-patch-unzpriv.h \ + ${FILESDIR}/extra-iconv-patch-zipinfo.c +.endif + +.if ${PORT_OPTIONS:MCHINESE} +CATEGORES+= chinese +EXTRA_PATCHES+= ${FILESDIR}/extra-zh-patch-fileio.c +.endif + +.if ${PORT_OPTIONS:MKOREAN} +CATEGORIES+= korean +EXTRA_PATCHES+= ${FILESDIR}/extra-ko-patch-fileio.c \ + ${FILESDIR}/extra-ko-patch-unzip.c \ + ${FILESDIR}/extra-ko-patch-unzip.h +.endif + +.if ${PORT_OPTIONS:MRUSSIAN} +CATEGORIES+= russian +EXTRA_PATCHES+= ${FILESDIR}/extra-ru-patch-ebcdic.h +.endif .if !defined(INSTALL_AS_INFOUNZIP) pre-fetch: @@ -79,29 +95,18 @@ pre-fetch: @${ECHO} "" .endif -.if defined(WITH_UNZIP_UNREDUCE) -pre-build: - @(cd ${BUILD_WRKSRC}; ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} CFLAGS="${CFLAGS}" unzip) - @(cd ${WRKSRC}; \ - ./unzip -o ${_DISTDIR}unreduce_full.zip; \ - ${MV} unreduce_full.c unreduce.c) - @(cd ${BUILD_WRKSRC}; ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} clean) -.endif - do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/unzip ${STAGEDIR}${PREFIX}/bin/${UNZIP_NAME} -.for f in funzip unzipsfx - ${INSTALL_PROGRAM} ${WRKSRC}/${f} ${STAGEDIR}${PREFIX}/bin -.endfor + ${INSTALL_PROGRAM} ${WRKSRC}/unzip \ + ${STAGEDIR}${PREFIX}/bin/${UNZIP_NAME} + cd ${WRKSRC} && \ + ${INSTALL_PROGRAM} funzip unzipsfx ${STAGEDIR}${PREFIX}/bin ${LN} -sf ${UNZIP_NAME} ${STAGEDIR}${PREFIX}/bin/zipinfo ${INSTALL_SCRIPT} ${WRKSRC}/unix/zipgrep ${STAGEDIR}${PREFIX}/bin - ${INSTALL_MAN} ${WRKSRC}/man/unzip.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/${UNZIP_NAME}.1 -.for f in ${MANPAGES:Nunzip.1:Ninfo-unzip.1} - ${INSTALL_MAN} ${WRKSRC}/man/${f} ${STAGEDIR}${MAN1PREFIX}/man/man1 -.endfor + ${INSTALL_MAN} ${WRKSRC}/man/unzip.1 \ + ${STAGEDIR}${MAN1PREFIX}/man/man1/${UNZIP_NAME}.1 + cd ${WRKSRC}/man && ${INSTALL_MAN} ${MANPAGES:Nunzip.1:Ninfo-unzip.1} \ + ${STAGEDIR}${MAN1PREFIX}/man/man1 @${MKDIR} ${STAGEDIR}${DOCSDIR} -.for f in ${PORTDOCS} - ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR} -.endfor + cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR} -.include <bsd.port.post.mk> +.include <bsd.port.mk> Modified: head/archivers/unzip/distinfo ============================================================================== --- head/archivers/unzip/distinfo Fri Aug 15 09:59:13 2014 (r364955) +++ head/archivers/unzip/distinfo Fri Aug 15 10:11:10 2014 (r364956) @@ -1,6 +1,2 @@ SHA256 (unzip60.tar.gz) = 036d96991646d0449ed0aa952e4fbe21b476ce994abc276e49d30e686708bd37 SIZE (unzip60.tar.gz) = 1376845 -SHA256 (unreduce_full.zip) = 1f4d93d2250dc1a1d1d2b8aac09d9989d4f9dd2cb0967373bf41fdf5f108cec1 -SIZE (unreduce_full.zip) = 2849 -SHA256 (unzip60-alt-iconv-utf8.patch) = 6abf9d5e538b948ddb43f11000162348ce46ac0fa93826e6c8edae4ffa488f00 -SIZE (unzip60-alt-iconv-utf8.patch) = 13369 Added: head/archivers/unzip/files/extra-iconv-patch-unix_unix.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/archivers/unzip/files/extra-iconv-patch-unix_unix.c Fri Aug 15 10:11:10 2014 (r364956) @@ -0,0 +1,103 @@ +--- unix/unix.c.orig 2009-01-23 23:31:26 UTC ++++ unix/unix.c +@@ -30,6 +30,9 @@ + #define UNZIP_INTERNAL + #include "unzip.h" + ++#include <iconv.h> ++#include <langinfo.h> ++ + #ifdef SCO_XENIX + # define SYSNDIR + #else /* SCO Unix, AIX, DNIX, TI SysV, Coherent 4.x, ... */ +@@ -1874,3 +1877,90 @@ static void qlfix(__G__ ef_ptr, ef_len) + } + } + #endif /* QLZIP */ ++ ++ ++typedef struct { ++ char *local_charset; ++ char *archive_charset; ++} CHARSET_MAP; ++ ++/* A mapping of local <-> archive charsets used by default to convert filenames ++ * of DOS/Windows Zip archives. Currently very basic. */ ++static CHARSET_MAP dos_charset_map[] = { ++ { "ANSI_X3.4-1968", "CP850" }, ++ { "ISO-8859-1", "CP850" }, ++ { "CP1252", "CP850" }, ++ { "UTF-8", "CP866" }, ++ { "KOI8-R", "CP866" }, ++ { "KOI8-U", "CP866" }, ++ { "ISO-8859-5", "CP866" } ++}; ++ ++char OEM_CP[MAX_CP_NAME] = ""; ++char ISO_CP[MAX_CP_NAME] = ""; ++ ++/* Try to guess the default value of OEM_CP based on the current locale. ++ * ISO_CP is left alone for now. */ ++void init_conversion_charsets() ++{ ++ const char *local_charset; ++ int i; ++ ++ /* Make a guess only if OEM_CP not already set. */ ++ if(*OEM_CP == '\0') { ++ local_charset = nl_langinfo(CODESET); ++ for(i = 0; i < sizeof(dos_charset_map)/sizeof(CHARSET_MAP); i++) ++ if(!strcasecmp(local_charset, dos_charset_map[i].local_charset)) { ++ strncpy(OEM_CP, dos_charset_map[i].archive_charset, ++ sizeof(OEM_CP)); ++ break; ++ } ++ } ++} ++ ++/* Convert a string from one encoding to the current locale using iconv(). ++ * Be as non-intrusive as possible. If error is encountered during covertion ++ * just leave the string intact. */ ++static void charset_to_intern(char *string, char *from_charset) ++{ ++ iconv_t cd; ++ char *s,*d, *buf; ++ size_t slen, dlen, buflen; ++ const char *local_charset; ++ ++ if(*from_charset == '\0') ++ return; ++ ++ buf = NULL; ++ local_charset = nl_langinfo(CODESET); ++ ++ if((cd = iconv_open(local_charset, from_charset)) == (iconv_t)-1) ++ return; ++ ++ slen = strlen(string); ++ s = string; ++ dlen = buflen = 2*slen; ++ d = buf = malloc(buflen + 1); ++ if(!d) ++ goto cleanup; ++ bzero(buf,buflen); ++ if(iconv(cd, &s, &slen, &d, &dlen) == (size_t)-1) ++ goto cleanup; ++ strncpy(string, buf, buflen); ++ ++ cleanup: ++ free(buf); ++ iconv_close(cd); ++} ++ ++/* Convert a string from OEM_CP to the current locale charset. */ ++inline void oem_intern(char *string) ++{ ++ charset_to_intern(string, OEM_CP); ++} ++ ++/* Convert a string from ISO_CP to the current locale charset. */ ++inline void iso_intern(char *string) ++{ ++ charset_to_intern(string, ISO_CP); ++} Added: head/archivers/unzip/files/extra-iconv-patch-unix_unxcfg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/archivers/unzip/files/extra-iconv-patch-unix_unxcfg.h Fri Aug 15 10:11:10 2014 (r364956) @@ -0,0 +1,33 @@ +--- unix/unxcfg.h.orig 2009-04-16 18:36:12 UTC ++++ unix/unxcfg.h +@@ -227,4 +227,30 @@ typedef struct stat z_stat; + /* wild_dir, dirname, wildname, matchname[], dirnamelen, have_dirname, */ + /* and notfirstcall are used by do_wild(). */ + ++ ++#define MAX_CP_NAME 25 ++ ++#ifdef SETLOCALE ++# undef SETLOCALE ++#endif ++#define SETLOCALE(category, locale) setlocale(category, locale) ++#include <locale.h> ++ ++#ifdef _ISO_INTERN ++# undef _ISO_INTERN ++#endif ++#define _ISO_INTERN(str1) iso_intern(str1) ++ ++#ifdef _OEM_INTERN ++# undef _OEM_INTERN ++#endif ++#ifndef IZ_OEM2ISO_ARRAY ++# define IZ_OEM2ISO_ARRAY ++#endif ++#define _OEM_INTERN(str1) oem_intern(str1) ++ ++void iso_intern(char *); ++void oem_intern(char *); ++void init_conversion_charsets(void); ++ + #endif /* !__unxcfg_h */ Added: head/archivers/unzip/files/extra-iconv-patch-unzip.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/archivers/unzip/files/extra-iconv-patch-unzip.c Fri Aug 15 10:11:10 2014 (r364956) @@ -0,0 +1,137 @@ +--- unzip.c.orig 2009-04-16 18:26:52 UTC ++++ unzip.c +@@ -327,11 +327,21 @@ static ZCONST char Far ZipInfoUsageLine2 + -2 just filenames but allow -h/-t/-z -l long Unix \"ls -l\" format\n\ + -v verbose, multi-page format\n"; + ++#ifndef UNIX + static ZCONST char Far ZipInfoUsageLine3[] = "miscellaneous options:\n\ + -h print header line -t print totals for listed files or for all\n\ + -z print zipfile comment -T print file times in sortable decimal format\ + \n -C be case-insensitive %s\ + -x exclude filenames that follow from listing\n"; ++#else /* UNIX */ ++static ZCONST char Far ZipInfoUsageLine3[] = "miscellaneous options:\n\ ++ -h print header line -t print totals for listed files or for all\n\ ++ -z print zipfile comment %c-T%c print file times in sortable decimal format\ ++\n %c-C%c be case-insensitive %s\ ++ -x exclude filenames that follow from listing\n\ ++ -O CHARSET specify a character encoding for DOS, Windows and OS/2 archives\n\ ++ -I CHARSET specify a character encoding for UNIX and other archives\n"; ++#endif /* !UNIX */ + #ifdef MORE + static ZCONST char Far ZipInfoUsageLine4[] = + " -M page output through built-in \"more\"\n"; +@@ -665,6 +675,17 @@ modifiers:\n\ + -U use escapes for all non-ASCII Unicode -UU ignore any Unicode fields\n\ + -C match filenames case-insensitively -L make (some) names \ + lowercase\n %-42s -V retain VMS version numbers\n%s"; ++#elif (defined UNIX) ++static ZCONST char Far UnzipUsageLine4[] = "\ ++modifiers:\n\ ++ -n never overwrite existing files -q quiet mode (-qq => quieter)\n\ ++ -o overwrite files WITHOUT prompting -a auto-convert any text files\n\ ++ -j junk paths (do not make directories) -aa treat ALL files as text\n\ ++ -U use escapes for all non-ASCII Unicode -UU ignore any Unicode fields\n\ ++ -C match filenames case-insensitively -L make (some) names \ ++lowercase\n %-42s -V retain VMS version numbers\n%s\ ++ -O CHARSET specify a character encoding for DOS, Windows and OS/2 archives\n\ ++ -I CHARSET specify a character encoding for UNIX and other archives\n\n"; + #else /* !VMS */ + static ZCONST char Far UnzipUsageLine4[] = "\ + modifiers:\n\ +@@ -803,6 +824,10 @@ int unzip(__G__ argc, argv) + #endif /* UNICODE_SUPPORT */ + + ++#ifdef UNIX ++ init_conversion_charsets(); ++#endif ++ + #if (defined(__IBMC__) && defined(__DEBUG_ALLOC__)) + extern void DebugMalloc(void); + +@@ -1336,6 +1361,11 @@ int uz_opts(__G__ pargc, pargv) + argc = *pargc; + argv = *pargv; + ++#ifdef UNIX ++ extern char OEM_CP[MAX_CP_NAME]; ++ extern char ISO_CP[MAX_CP_NAME]; ++#endif ++ + while (++argv, (--argc > 0 && *argv != NULL && **argv == '-')) { + s = *argv + 1; + while ((c = *s++) != 0) { /* "!= 0": prevent Turbo C warning */ +@@ -1517,6 +1547,35 @@ int uz_opts(__G__ pargc, pargv) + } + break; + #endif /* MACOS */ ++#ifdef UNIX ++ case ('I'): ++ if (negative) { ++ Info(slide, 0x401, ((char *)slide, ++ "error: encodings can't be negated")); ++ return(PK_PARAM); ++ } else { ++ if(*s) { /* Handle the -Icharset case */ ++ /* Assume that charsets can't start with a dash to spot arguments misuse */ ++ if(*s == '-') { ++ Info(slide, 0x401, ((char *)slide, ++ "error: a valid character encoding should follow the -I argument")); ++ return(PK_PARAM); ++ } ++ strncpy(ISO_CP, s, sizeof(ISO_CP)); ++ } else { /* -I charset */ ++ ++argv; ++ if(!(--argc > 0 && *argv != NULL && **argv != '-')) { ++ Info(slide, 0x401, ((char *)slide, ++ "error: a valid character encoding should follow the -I argument")); ++ return(PK_PARAM); ++ } ++ s = *argv; ++ strncpy(ISO_CP, s, sizeof(ISO_CP)); ++ } ++ while(*(++s)); /* No params straight after charset name */ ++ } ++ break; ++#endif /* ?UNIX */ + case ('j'): /* junk pathnames/directory structure */ + if (negative) + uO.jflag = FALSE, negative = 0; +@@ -1592,6 +1651,35 @@ int uz_opts(__G__ pargc, pargv) + } else + ++uO.overwrite_all; + break; ++#ifdef UNIX ++ case ('O'): ++ if (negative) { ++ Info(slide, 0x401, ((char *)slide, ++ "error: encodings can't be negated")); ++ return(PK_PARAM); ++ } else { ++ if(*s) { /* Handle the -Ocharset case */ ++ /* Assume that charsets can't start with a dash to spot arguments misuse */ ++ if(*s == '-') { ++ Info(slide, 0x401, ((char *)slide, ++ "error: a valid character encoding should follow the -I argument")); ++ return(PK_PARAM); ++ } ++ strncpy(OEM_CP, s, sizeof(OEM_CP)); ++ } else { /* -O charset */ ++ ++argv; ++ if(!(--argc > 0 && *argv != NULL && **argv != '-')) { ++ Info(slide, 0x401, ((char *)slide, ++ "error: a valid character encoding should follow the -O argument")); ++ return(PK_PARAM); ++ } ++ s = *argv; ++ strncpy(OEM_CP, s, sizeof(OEM_CP)); ++ } ++ while(*(++s)); /* No params straight after charset name */ ++ } ++ break; ++#endif /* ?UNIX */ + case ('p'): /* pipes: extract to stdout, no messages */ + if (negative) { + uO.cflag = FALSE; Added: head/archivers/unzip/files/extra-iconv-patch-unzpriv.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/archivers/unzip/files/extra-iconv-patch-unzpriv.h Fri Aug 15 10:11:10 2014 (r364956) @@ -0,0 +1,11 @@ +--- unzpriv.h.orig 2009-04-19 23:59:26 UTC ++++ unzpriv.h +@@ -3008,7 +3008,7 @@ char *GetLoadPath OF((__GPRO)); + !(((islochdr) || (isuxatt)) && \ + ((hostver) == 25 || (hostver) == 26 || (hostver) == 40))) || \ + (hostnum) == FS_HPFS_ || \ +- ((hostnum) == FS_NTFS_ && (hostver) == 50)) { \ ++ ((hostnum) == FS_NTFS_ /* && (hostver) == 50 */ )) { \ + _OEM_INTERN((string)); \ + } else { \ + _ISO_INTERN((string)); \ Added: head/archivers/unzip/files/extra-iconv-patch-zipinfo.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/archivers/unzip/files/extra-iconv-patch-zipinfo.c Fri Aug 15 10:11:10 2014 (r364956) @@ -0,0 +1,85 @@ +--- zipinfo.c.orig 2009-02-08 17:04:30 UTC ++++ zipinfo.c +@@ -457,6 +457,10 @@ int zi_opts(__G__ pargc, pargv) + int tflag_slm=TRUE, tflag_2v=FALSE; + int explicit_h=FALSE, explicit_t=FALSE; + ++#ifdef UNIX ++ extern char OEM_CP[MAX_CP_NAME]; ++ extern char ISO_CP[MAX_CP_NAME]; ++#endif + + #ifdef MACOS + uO.lflag = LFLAG; /* reset default on each call */ +@@ -501,6 +505,35 @@ int zi_opts(__G__ pargc, pargv) + uO.lflag = 0; + } + break; ++#ifdef UNIX ++ case ('I'): ++ if (negative) { ++ Info(slide, 0x401, ((char *)slide, ++ "error: encodings can't be negated")); ++ return(PK_PARAM); ++ } else { ++ if(*s) { /* Handle the -Icharset case */ ++ /* Assume that charsets can't start with a dash to spot arguments misuse */ ++ if(*s == '-') { ++ Info(slide, 0x401, ((char *)slide, ++ "error: a valid character encoding should follow the -I argument")); ++ return(PK_PARAM); ++ } ++ strncpy(ISO_CP, s, sizeof(ISO_CP)); ++ } else { /* -I charset */ ++ ++argv; ++ if(!(--argc > 0 && *argv != NULL && **argv != '-')) { ++ Info(slide, 0x401, ((char *)slide, ++ "error: a valid character encoding should follow the -I argument")); ++ return(PK_PARAM); ++ } ++ s = *argv; ++ strncpy(ISO_CP, s, sizeof(ISO_CP)); ++ } ++ while(*(++s)); /* No params straight after charset name */ ++ } ++ break; ++#endif /* ?UNIX */ + case 'l': /* longer form of "ls -l" type listing */ + if (negative) + uO.lflag = -2, negative = 0; +@@ -521,6 +554,35 @@ int zi_opts(__G__ pargc, pargv) + G.M_flag = TRUE; + break; + #endif ++#ifdef UNIX ++ case ('O'): ++ if (negative) { ++ Info(slide, 0x401, ((char *)slide, ++ "error: encodings can't be negated")); ++ return(PK_PARAM); ++ } else { ++ if(*s) { /* Handle the -Ocharset case */ ++ /* Assume that charsets can't start with a dash to spot arguments misuse */ ++ if(*s == '-') { ++ Info(slide, 0x401, ((char *)slide, ++ "error: a valid character encoding should follow the -I argument")); ++ return(PK_PARAM); ++ } ++ strncpy(OEM_CP, s, sizeof(OEM_CP)); ++ } else { /* -O charset */ ++ ++argv; ++ if(!(--argc > 0 && *argv != NULL && **argv != '-')) { ++ Info(slide, 0x401, ((char *)slide, ++ "error: a valid character encoding should follow the -O argument")); ++ return(PK_PARAM); ++ } ++ s = *argv; ++ strncpy(OEM_CP, s, sizeof(OEM_CP)); ++ } ++ while(*(++s)); /* No params straight after charset name */ ++ } ++ break; ++#endif /* ?UNIX */ + case 's': /* default: shorter "ls -l" type listing */ + if (negative) + uO.lflag = -2, negative = 0; Added: head/archivers/unzip/files/extra-ko-patch-fileio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/archivers/unzip/files/extra-ko-patch-fileio.c Fri Aug 15 10:11:10 2014 (r364956) @@ -0,0 +1,14 @@ +--- fileio.c.orig 2009-04-20 00:03:44 UTC ++++ fileio.c +@@ -2240,8 +2240,9 @@ int do_string(__G__ length, option) /* + + /* translate the Zip entry filename coded in host-dependent "extended + ASCII" into the compiler's (system's) internal text code page */ +- Ext_ASCII_TO_Native(G.filename, G.pInfo->hostnum, G.pInfo->hostver, +- G.pInfo->HasUxAtt, (option == DS_FN_L)); ++ if (!uO.dotflag) ++ Ext_ASCII_TO_Native(G.filename, G.pInfo->hostnum, G.pInfo->hostver, ++ G.pInfo->HasUxAtt, (option == DS_FN_L)); + + if (G.pInfo->lcflag) /* replace with lowercase filename */ + STRLOWER(G.filename, G.filename); Added: head/archivers/unzip/files/extra-ko-patch-unzip.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/archivers/unzip/files/extra-ko-patch-unzip.c Fri Aug 15 10:11:10 2014 (r364956) @@ -0,0 +1,25 @@ +--- unzip.c.orig 2009-04-16 18:26:52 UTC ++++ unzip.c +@@ -664,7 +664,8 @@ modifiers:\n\ + -j junk paths (do not make directories) -aa treat ALL files as text\n\ + -U use escapes for all non-ASCII Unicode -UU ignore any Unicode fields\n\ + -C match filenames case-insensitively -L make (some) names \ +-lowercase\n %-42s -V retain VMS version numbers\n%s"; ++lowercase\n %-42s -V retain VMS version numbers\n\ ++ -. don't translate filenames\n%s"; + #else /* !VMS */ + static ZCONST char Far UnzipUsageLine4[] = "\ + modifiers:\n\ +@@ -1829,6 +1830,12 @@ int uz_opts(__G__ pargc, pargv) + ++uO.cflxflag; + break; + #endif /* UNIX */ ++ case ('.'): ++ if (negative) ++ uO.dotflag = FALSE, negative = 0; ++ else ++ uO.dotflag = TRUE; ++ break; + default: + error = TRUE; + break; Added: head/archivers/unzip/files/extra-ko-patch-unzip.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/archivers/unzip/files/extra-ko-patch-unzip.h Fri Aug 15 10:11:10 2014 (r364956) @@ -0,0 +1,10 @@ +--- unzip.h.orig 2009-02-15 18:12:54 UTC ++++ unzip.h +@@ -559,6 +559,7 @@ typedef struct _UzpOpts { + #ifdef UNIX + int cflxflag; /* -^: allow control chars in extracted filenames */ + #endif ++ int dotflag; /* -.: don't translate filenames to local charset */ + #endif /* !FUNZIP */ + } UzpOpts; + Added: head/archivers/unzip/files/extra-ru-patch-ebcdic.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/archivers/unzip/files/extra-ru-patch-ebcdic.h Fri Aug 15 10:11:10 2014 (r364956) @@ -0,0 +1,78 @@ +--- ebcdic.h.orig 2008-03-21 12:04:22 UTC ++++ ebcdic.h +@@ -237,43 +237,43 @@ ZCONST uch ascii[] = { + + #ifdef IZ_ISO2OEM_ARRAY + ZCONST uch Far iso2oem_850[] = { +- 0x3F, 0x3F, 0x27, 0x9F, 0x22, 0x2E, 0xC5, 0xCE, /* 80 - 87 */ +- 0x5E, 0x25, 0x53, 0x3C, 0x4F, 0x3F, 0x3F, 0x3F, /* 88 - 8F */ +- 0x3F, 0x27, 0x27, 0x22, 0x22, 0x07, 0x2D, 0x2D, /* 90 - 97 */ +- 0x7E, 0x54, 0x73, 0x3E, 0x6F, 0x3F, 0x3F, 0x59, /* 98 - 9F */ +- 0xFF, 0xAD, 0xBD, 0x9C, 0xCF, 0xBE, 0xDD, 0xF5, /* A0 - A7 */ +- 0xF9, 0xB8, 0xA6, 0xAE, 0xAA, 0xF0, 0xA9, 0xEE, /* A8 - AF */ +- 0xF8, 0xF1, 0xFD, 0xFC, 0xEF, 0xE6, 0xF4, 0xFA, /* B0 - B7 */ +- 0xF7, 0xFB, 0xA7, 0xAF, 0xAC, 0xAB, 0xF3, 0xA8, /* B8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0xE5, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, /* C8 - CF */ ++ 0xAF, 0xEF, 0xE0, 0xE1, 0xE2, 0xE3, 0xA6, 0xA2, /* D0 - D7 */ ++ 0xEC, 0xEB, 0xA7, 0xE8, 0xED, 0xE9, 0xE7, 0xEA, /* D8 - DF */ ++ 0x9E, 0x80, 0x81, 0x96, 0x84, 0x85, 0x94, 0x83, /* E0 - E7 */ ++ 0x95, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, /* E8 - EF */ ++ 0x8F, 0x9F, 0x90, 0x91, 0x92, 0x93, 0x86, 0x82, /* F0 - F7 */ ++ 0x9C, 0x9B, 0x87, 0x98, 0x9D, 0x99, 0x97, 0x9A, /* F8 - FF */ + }; + #endif /* IZ_ISO2OEM_ARRAY */ + + #ifdef IZ_OEM2ISO_ARRAY + ZCONST uch Far oem2iso_850[] = { +- 0xC7, 0xFC, 0xE9, 0xE2, 0xE4, 0xE0, 0xE5, 0xE7, /* 80 - 87 */ +- 0xEA, 0xEB, 0xE8, 0xEF, 0xEE, 0xEC, 0xC4, 0xC5, /* 88 - 8F */ +- 0xC9, 0xE6, 0xC6, 0xF4, 0xF6, 0xF2, 0xFB, 0xF9, /* 90 - 97 */ +- 0xFF, 0xD6, 0xDC, 0xF8, 0xA3, 0xD8, 0xD7, 0x83, /* 98 - 9F */ +- 0xE1, 0xED, 0xF3, 0xFA, 0xF1, 0xD1, 0xAA, 0xBA, /* A0 - A7 */ +- 0xBF, 0xAE, 0xAC, 0xBD, 0xBC, 0xA1, 0xAB, 0xBB, /* A8 - AF */ +- 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xC1, 0xC2, 0xC0, /* B0 - B7 */ +- 0xA9, 0xA6, 0xA6, 0x2B, 0x2B, 0xA2, 0xA5, 0x2B, /* B8 - BF */ +- 0x2B, 0x2D, 0x2D, 0x2B, 0x2D, 0x2B, 0xE3, 0xC3, /* C0 - C7 */ +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*/ ++ 0xBA, 0xB6, 0xB7, 0xAA, 0xA9, 0xA2, 0xA4, 0xBD, /* D0 - D7 */ ++ 0xBC, 0x85, 0x82, 0x8D, 0x8C, 0x8E, 0x8F, 0x8B, /* D8 - DF */ ++ 0xD2, 0xD3, 0xD4, 0xD5, 0xC6, 0xC8, 0xC3, 0xDE, /* E0 - E7 */ ++ 0xDB, 0xDD, 0xDF, 0xD9, 0xD8, 0xDC, 0xC0, 0xD1, /* E8 - EF */ ++ 0xB3, 0xA3, 0x90, 0x91, 0x92, 0x93, 0x86, 0x82, /* F0 - F7 */ ++ 0x9C, 0x95, 0x9E, 0x96, 0x9D, 0x99, 0x94, 0x9A, /* F8 - FF */ + }; + #endif /* IZ_OEM2ISO_ARRAY */ + Added: head/archivers/unzip/files/extra-zh-patch-fileio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/archivers/unzip/files/extra-zh-patch-fileio.c Fri Aug 15 10:11:10 2014 (r364956) @@ -0,0 +1,14 @@ +--- fileio.c.orig 2009-04-20 00:03:44 UTC ++++ fileio.c +@@ -2240,8 +2240,11 @@ int do_string(__G__ length, option) /* + + /* translate the Zip entry filename coded in host-dependent "extended + ASCII" into the compiler's (system's) internal text code page */ ++#if 0 ++/* cnoize is lazy to read it carefully */ + Ext_ASCII_TO_Native(G.filename, G.pInfo->hostnum, G.pInfo->hostver, + G.pInfo->HasUxAtt, (option == DS_FN_L)); ++#endif + + if (G.pInfo->lcflag) /* replace with lowercase filename */ + STRLOWER(G.filename, G.filename); Added: head/archivers/unzip/files/patch-consts.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/archivers/unzip/files/patch-consts.h Fri Aug 15 10:11:10 2014 (r364956) @@ -0,0 +1,14 @@ +--- consts.h.orig 2002-03-23 15:52:48 UTC ++++ consts.h +@@ -34,9 +34,9 @@ ZCONST char Far CentSigMsg[] = + "error: expected central file header signature not found (file #%lu).\n"; + ZCONST char Far SeekMsg[] = + "error [%s]: attempt to seek before beginning of zipfile\n%s"; +-ZCONST char Far FilenameNotMatched[] = "caution: filename not matched: %s\n"; ++ZCONST char Far FilenameNotMatched[] = "caution: filename not matched: %.512s\n"; + ZCONST char Far ExclFilenameNotMatched[] = +- "caution: excluded filename not matched: %s\n"; ++ "caution: excluded filename not matched: %.512s\n"; + + #ifdef VMS + ZCONST char Far ReportMsg[] = "\ Modified: head/archivers/unzip/files/patch-process.c ============================================================================== --- head/archivers/unzip/files/patch-process.c Fri Aug 15 09:59:13 2014 (r364955) +++ head/archivers/unzip/files/patch-process.c Fri Aug 15 10:11:10 2014 (r364956) @@ -1,6 +1,6 @@ ---- process.c.orig 2009-03-06 04:25:10.000000000 +0300 -+++ process.c 2009-10-26 16:08:15.000000000 +0300 -@@ -101,10 +101,10 @@ +--- process.c.orig 2009-03-06 01:25:10 UTC ++++ process.c +@@ -101,10 +101,10 @@ static ZCONST char Far CannotAllocateBuf /* do_seekable() strings */ # ifdef UNIX static ZCONST char Far CannotFindZipfileDirMsg[] = Added: head/archivers/unzip/files/patch-unix_Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/archivers/unzip/files/patch-unix_Makefile Fri Aug 15 10:11:10 2014 (r364956) @@ -0,0 +1,28 @@ +--- unix/Makefile.orig 2009-01-18 22:41:18 UTC ++++ unix/Makefile +@@ -42,12 +42,12 @@ + # such as -DDOSWILD). + + # UnZip flags +-CC = cc# try using "gcc" target rather than changing this (CC and LD ++CC ?= cc# try using "gcc" target rather than changing this (CC and LD + LD = $(CC)# must match, else "unresolved symbol: ___main" is possible) + AS = as + LOC = $(D_USE_BZ2) $(LOCAL_UNZIP) + AF = $(LOC) +-CFLAGS = -O ++#CFLAGS = -O + CF_NOOPT = -I. -I$(IZ_BZIP2) -DUNIX $(LOC) + CF = $(CFLAGS) $(CF_NOOPT) + LFLAGS1 = +@@ -763,8 +763,8 @@ dnix: unix_make + # FreeBSD on Intel: + freebsd: unix_make + @echo 'NOTE: use bsd target for non-Intel FreeBSD compiles (if any).' +- $(MAKE) unzips CC=gcc LD=gcc AS=gcc\ +- CFLAGS="-O3 -Wall -DASM_CRC -DBSD"\ ++ $(MAKE) unzips CC="$(CC)" LD="$(CC)" AS="$(CC)"\ ++ CF="$(CF) -Wall -DASM_CRC -DBSD"\ + AF="-Di386 $(AF)" CRCA_O=crc_gcc$O + + # Generic BSDish Unix gcc. ``The -O3 only works with later versions of gcc; Added: head/archivers/unzip/files/patch-unix_unix.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/archivers/unzip/files/patch-unix_unix.c Fri Aug 15 10:11:10 2014 (r364956) @@ -0,0 +1,11 @@ +--- unix/unix.c.orig 2009-01-23 23:31:26 UTC ++++ unix/unix.c +@@ -610,7 +610,7 @@ int mapname(__G__ renamed) + * else allow 8-bit characters (e.g. UTF-8) in filenames: + */ + if (uO.cflxflag || +- (isprint(workch) || (128 <= workch && workch <= 254))) ++ (isprint(workch) || (128 <= workch && workch <= 255))) + *pp++ = (char)workch; + } /* end switch */ +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408151011.s7FABAI8072191>