1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

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@)
This commit is contained in:
John Marino 2014-08-15 10:11:10 +00:00
parent 9332906e4d
commit 69f43aff5e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=364956
22 changed files with 466 additions and 150 deletions

4
MOVED
View File

@ -6414,3 +6414,7 @@ devel/glib-java||2014-08-14|Has expired: Unmaintained, outdated not depend on
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

View File

@ -1,15 +0,0 @@
# Created by: KOMATSU Shinichiro <koma2@lovepeers.org>
# $FreeBSD$
PKGNAMESUFFIX= -iconv
MAINTAINER= koma2@lovepeers.org
COMMENT= Unzip with iconv patches
MASTERDIR= ${.CURDIR}/../unzip
CONFLICTS= unzip-[0-9]* ko-unzip-[0-9]* ru-unzip-[0-9]* zh-unzip-[0-9]*
WITH_ICONV= yes
.include "${MASTERDIR}/Makefile"

View File

@ -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
.include <bsd.port.pre.mk>
RG1_DESC= Localization
CHINESE_DESC= Chinese language support
KOREAN_DESC= Korean language support
RUSSIAN_DESC= CP866 and KOI8-R support
.if ${ARCH} == "i386"
ICONV_USES= iconv
.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>

View File

@ -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

View File

@ -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);
+}

View File

@ -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 */

View File

@ -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;

View File

@ -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)); \

View File

@ -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;

View File

@ -1,6 +1,6 @@
--- fileio.c.orig Sun Feb 17 14:43:28 2002
+++ fileio.c Wed May 21 03:40:24 2003
@@ -2135,8 +2135,9 @@
--- 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 */

View File

@ -1,6 +1,6 @@
--- unzip.c.orig 2009-04-17 03:26:52.000000000 +0900
+++ unzip.c 2011-02-15 11:25:36.000000000 +0900
@@ -664,7 +664,8 @@
--- 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 \
@ -10,7 +10,7 @@
#else /* !VMS */
static ZCONST char Far UnzipUsageLine4[] = "\
modifiers:\n\
@@ -1829,6 +1830,12 @@
@@ -1829,6 +1830,12 @@ int uz_opts(__G__ pargc, pargv)
++uO.cflxflag;
break;
#endif /* UNIX */

View File

@ -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;

View File

@ -1,6 +1,6 @@
--- ebcdic.h.orig Wed May 4 12:30:10 2005
+++ ebcdic.h Wed May 4 12:30:18 2005
@@ -237,43 +237,43 @@
--- 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[] = {

View File

@ -1,6 +1,6 @@
--- fileio.c.orig Wed Jun 5 03:41:04 2002
+++ fileio.c Wed Jun 5 03:44:33 2002
@@ -2135,8 +2135,11 @@
--- 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 */

View File

@ -1,6 +1,6 @@
--- unzip-5.52.orig/consts.h
--- consts.h.orig 2002-03-23 15:52:48 UTC
+++ consts.h
@@ -34,9 +34,9 @@
@@ -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";

View File

@ -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[] =

View File

@ -1,5 +1,5 @@
--- unix/Makefile.orig 2009-01-19 01:41:18.000000000 +0300
+++ unix/Makefile 2009-10-26 13:15:47.000000000 +0300
--- unix/Makefile.orig 2009-01-18 22:41:18 UTC
+++ unix/Makefile
@@ -42,12 +42,12 @@
# such as -DDOSWILD).
@ -15,7 +15,7 @@
CF_NOOPT = -I. -I$(IZ_BZIP2) -DUNIX $(LOC)
CF = $(CFLAGS) $(CF_NOOPT)
LFLAGS1 =
@@ -763,8 +763,8 @@
@@ -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).'

View File

@ -1,6 +1,6 @@
--- unix/unix.c.orig 2009-01-24 02:31:26.000000000 +0300
+++ unix/unix.c 2009-10-26 13:22:08.000000000 +0300
@@ -610,7 +610,7 @@
--- 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 ||

View File

@ -1,14 +0,0 @@
# Created by: Shen Chuan-Hsing <statue@freebsd.sinica.edu.tw>
# $FreeBSD$
CATEGORIES= chinese
MAINTAINER= ports@FreeBSD.org
CONFLICTS= unzip-[0-9]* unzip-iconv-[0-9]* ko-unzip-[0-9]* ru-unzip-[0-9]*
MASTERDIR= ${.CURDIR}/../../archivers/unzip
EXTRA_PATCHES= ${.CURDIR}/files/patch-fileio.c
.include "${MASTERDIR}/Makefile"

View File

@ -1,14 +0,0 @@
# Created by: Hye-Shik Chang
# $FreeBSD$
CATEGORIES= korean archivers
MAINTAINER= ports@FreeBSD.org
COMMENT= ZIP archive extractor with localized patches
CONFLICTS= unzip-[0-9]* unzip-iconv-[0-9]* ru-unzip-[0-9]* zh-unzip-[0-9]*
EXTRA_PATCHES= ${.CURDIR}/files/patch-*
MASTERDIR= ${.CURDIR}/../../archivers/unzip
.include "${MASTERDIR}/Makefile"

View File

@ -1,10 +0,0 @@
--- unzip.h.orig Sun Jan 27 11:29:40 2002
+++ unzip.h Wed May 21 03:43:56 2003
@@ -459,6 +459,7 @@
#if (!defined(RISCOS) && !defined(CMS_MVS) && !defined(TANDEM))
int ddotflag; /* -:: don't skip over "../" path elements */
#endif
+ int dotflag; /* -.: don't translate filenames to local charset */
#endif /* !FUNZIP */
} UzpOpts;

View File

@ -1,15 +0,0 @@
# Created by: den
# $FreeBSD$
CATEGORIES= russian archivers
MAINTAINER= ports@FreeBSD.org
COMMENT= Unzip with CP866 and KOI8-R support
CONFLICTS= unzip-[0-9]* unzip-iconv-[0-9]* zh-unzip-[0-9]* ko-unzip-[0-9]*
EXTRA_PATCHES= ${.CURDIR}/files/patch-ebcdic.h
MASTERDIR= ${.CURDIR}/../../archivers/unzip
.include "${MASTERDIR}/Makefile"