7036934 Move unzip to userland.
authorJiri Sasek <jurasek@opensolaris.org>
Wed, 20 Apr 2011 01:53:37 +0200
changeset 188 64b262c9d53f
parent 187 80d8cb349fea
child 189 824c82e11871
7036934 Move unzip to userland. 6862438 Incorporate unzip 6.0 into Solaris 10, for 256k encryption 7008244 zipinfo -h failed to report the total number of files when zip file contain more than 65535 files
components/meta-packages/history/SUNWunzip.p5m
components/unzip/Makefile
components/unzip/info-zip.license
components/unzip/patches/6719511-i18.patch
components/unzip/unzip.p5m
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/meta-packages/history/SUNWunzip.p5m	Wed Apr 20 01:53:37 2011 +0200
@@ -0,0 +1,33 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# Legacy package information for renamed SUNWunzip package
+#
+
+set name=pkg.fmri value=pkg:/[email protected],5.11-0.133
+set name=pkg.renamed value=true
+
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+
+depend fmri=compress/[email protected] type=require
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/unzip/Makefile	Wed Apr 20 01:53:37 2011 +0200
@@ -0,0 +1,63 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+
+#
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+#
+
+include ../../make-rules/shared-macros.mk
+
+COMPONENT_NAME=		unzip
+COMPONENT_VERSION=	6.0
+COMPONENT_SRC=		$(COMPONENT_NAME)60
+COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tgz
+COMPONENT_ARCHIVE_HASH=	sha1:abf7de8a4018a983590ed6f5cbd990d4740f8a22
+COMPONENT_ARCHIVE_URL=	ftp://ftp.info-zip.org/pub/infozip/src/$(COMPONENT_ARCHIVE)
+COMPONENT_PROJECT_URL=http://www.info-zip.org/UnZip.html
+
+include ../../make-rules/prep.mk
+include ../../make-rules/justmake.mk
+include ../../make-rules/ips.mk
+
+# remove the unwanted file.
+COMPONENT_PREP_ACTION = $(RM) $(SOURCE_DIR)/crc_i386.S
+
+TARGET_ENV +=   "LOCAL_UNZIP=-DUNICODE_SUPPORT"
+
+# The Makefile we want is under unix/Makefile
+COMPONENT_BUILD_ARGS += -f unix/Makefile
+COMPONENT_BUILD_TARGETS += generic
+COMPONENT_INSTALL_ARGS += -f unix/Makefile
+
+# This doesn't respect DESTDIR, so overload BINDIR and MANDIR when we install.
+COMPONENT_INSTALL_ARGS += BINDIR=$(PROTOUSRBINDIR)
+COMPONENT_INSTALL_ARGS += MANDIR=$(PROTOUSRSHAREMAN1DIR)
+
+# common targets
+
+build:		$(BUILD_32)
+
+install:	$(INSTALL_32)
+
+test:		$(NO_TESTS)
+
+BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)
+
+include ../../make-rules/depend.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/unzip/info-zip.license	Wed Apr 20 01:53:37 2011 +0200
@@ -0,0 +1,62 @@
+This is version 2009-Jan-02 of the Info-ZIP license.
+The definitive version of this document should be available at
+ftp://ftp.info-zip.org/pub/infozip/license.html indefinitely and
+a copy at http://www.info-zip.org/pub/infozip/license.html.
+
+
+Copyright (c) 1990-2009 Info-ZIP.  All rights reserved.
+
+For the purposes of this copyright and license, "Info-ZIP" is defined as
+the following set of individuals:
+
+   Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois,
+   Jean-loup Gailly, Hunter Goatley, Ed Gordon, Ian Gorman, Chris Herborth,
+   Dirk Haase, Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz,
+   David Kirschbaum, Johnny Lee, Onno van der Linden, Igor Mandrichenko,
+   Steve P. Miller, Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs,
+   Kai Uwe Rommel, Steve Salisbury, Dave Smith, Steven M. Schweda,
+   Christian Spieler, Cosmin Truta, Antoine Verheijen, Paul von Behren,
+   Rich Wales, Mike White.
+
+This software is provided "as is," without warranty of any kind, express
+or implied.  In no event shall Info-ZIP or its contributors be held liable
+for any direct, indirect, incidental, special or consequential damages
+arising out of the use of or inability to use this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the above disclaimer and the following restrictions:
+
+    1. Redistributions of source code (in whole or in part) must retain
+       the above copyright notice, definition, disclaimer, and this list
+       of conditions.
+
+    2. Redistributions in binary form (compiled executables and libraries)
+       must reproduce the above copyright notice, definition, disclaimer,
+       and this list of conditions in documentation and/or other materials
+       provided with the distribution.  Additional documentation is not needed
+       for executables where a command line license option provides these and
+       a note regarding this option is in the executable's startup banner.  The
+       sole exception to this condition is redistribution of a standard
+       UnZipSFX binary (including SFXWiz) as part of a self-extracting archive;
+       that is permitted without inclusion of this license, as long as the
+       normal SFX banner has not been removed from the binary or disabled.
+
+    3. Altered versions--including, but not limited to, ports to new operating
+       systems, existing ports with new graphical interfaces, versions with
+       modified or added functionality, and dynamic, shared, or static library
+       versions not from Info-ZIP--must be plainly marked as such and must not
+       be misrepresented as being the original source or, if binaries,
+       compiled from the original source.  Such altered versions also must not
+       be misrepresented as being Info-ZIP releases--including, but not
+       limited to, labeling of the altered versions with the names "Info-ZIP"
+       (or any variation thereof, including, but not limited to, different
+       capitalizations), "Pocket UnZip," "WiZ" or "MacZip" without the
+       explicit permission of Info-ZIP.  Such altered versions are further
+       prohibited from misrepresentative use of the Zip-Bugs or Info-ZIP
+       e-mail addresses or the Info-ZIP URL(s), such as to imply Info-ZIP
+       will provide support for the altered versions.
+
+    4. Info-ZIP retains the right to use the names "Info-ZIP," "Zip," "UnZip,"
+       "UnZipSFX," "WiZ," "Pocket UnZip," "Pocket Zip," and "MacZip" for its
+       own source and binary releases.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/unzip/patches/6719511-i18.patch	Wed Apr 20 01:53:37 2011 +0200
@@ -0,0 +1,512 @@
+diff -ur unzip60-orig/fileio.c unzip60/fileio.c
+--- unzip60-orig/fileio.c	2009-04-20 02:03:44.000000000 +0200
++++ unzip60/fileio.c	2011-02-25 11:57:38.242056429 +0100
[email protected]@ -2126,9 +2126,16 @@
+                 /* translate the text coded in the entry's host-dependent
+                    "extended ASCII" charset into the compiler's (system's)
+                    internal text code page */
++#ifdef UNIX
++                Ext_ASCII_TO_Native((char *)G.outbuf, G.pInfo->hostnum,
++                                    G.pInfo->hostver, G.pInfo->HasUxAtt,
++                                    FALSE, OUTBUFSIZ);
++#else /* !UNIX */
+                 Ext_ASCII_TO_Native((char *)G.outbuf, G.pInfo->hostnum,
+                                     G.pInfo->hostver, G.pInfo->HasUxAtt,
+                                     FALSE);
++#endif /* UNIX */
++
+ #ifdef WINDLL
+                 /* translate to ANSI (RTL internal codepage may be OEM) */
+                 INTERN_TO_ISO((char *)G.outbuf, (char *)G.outbuf);
[email protected]@ -2240,8 +2247,13 @@
+ 
+         /* translate the Zip entry filename coded in host-dependent "extended
+            ASCII" into the compiler's (system's) internal text code page */
++#ifdef UNIX
++        Ext_ASCII_TO_Native(G.filename, G.pInfo->hostnum, G.pInfo->hostver,
++                            G.pInfo->HasUxAtt, (option == DS_FN_L), FILNAMSIZ);
++#else /* !UNIX */
+         Ext_ASCII_TO_Native(G.filename, G.pInfo->hostnum, G.pInfo->hostver,
+                             G.pInfo->HasUxAtt, (option == DS_FN_L));
++#endif /* UNIX */
+ 
+         if (G.pInfo->lcflag)      /* replace with lowercase filename */
+             STRLOWER(G.filename, G.filename);
+Only in unzip60: fileio.c.orig
+diff -ur unzip60-orig/unix/unix.c unzip60/unix/unix.c
+--- unzip60-orig/unix/unix.c	2009-01-24 00:31:26.000000000 +0100
++++ unzip60/unix/unix.c	2011-02-25 11:57:38.259028876 +0100
[email protected]@ -30,6 +30,10 @@
+ #define UNZIP_INTERNAL
+ #include "unzip.h"
+ 
++#include <iconv.h>
++#include <langinfo.h>
++#include <strings.h>
++
+ #ifdef SCO_XENIX
+ #  define SYSNDIR
+ #else  /* SCO Unix, AIX, DNIX, TI SysV, Coherent 4.x, ... */
[email protected]@ -1874,3 +1878,128 @@
+     }
+ }
+ #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. */
++const static CHARSET_MAP dos_charset_map[] = {
++    { "ANSI_X3.4-1968", "CP850" },
++    { "ISO-8859-1", "CP850" },
++    { "CP1252", "CP850" },
++    { "KOI8-R", "CP866" },
++    { "KOI8-U", "CP866" },
++    { "ISO-8859-5", "CP866" }
++};
++
++typedef struct {
++    char *locale;
++    char *archive_charset;
++} UTF8_CHARSET_MAP;
++
++/* In case local charset is UTF-8, lookup archive_charset
++   by locale.  Currently very basic. */
++#define	UTF8_CHARSET_MAP_DEFAULT	"CP866"
++const static UTF8_CHARSET_MAP utf8_charset_map[] = {
++    { "ja_JP", "CP932" },
++    { "zh_CN", "GBK" },
++    { "zh_TW", "BIG5" },
++    { "ko_KR", "CP949" },
++};
++
++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 *loc)
++{
++    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);
++	if (!strcasecmp(local_charset, "UTF-8") || !strcasecmp(local_charset,
++"UTF8") )
++	{
++	    strcpy(OEM_CP, UTF8_CHARSET_MAP_DEFAULT);
++	    for(i = 0; i < sizeof(utf8_charset_map)/sizeof(UTF8_CHARSET_MAP);
++		i++)
++	    {
++		if (!strncmp(loc, utf8_charset_map[i].locale, 5))
++		{
++		    strncpy(OEM_CP, utf8_charset_map[i].archive_charset,
++			sizeof(OEM_CP) - 1);
++		    OEM_CP[sizeof(OEM_CP) - 1] = '\0';
++		    break;
++		}
++	    }
++	}
++	else
++	{
++	    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) - 1);
++		    OEM_CP[sizeof(OEM_CP) - 1] = '\0';
++		    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, size_t sbuflen, char *from_charset)
++{
++    iconv_t cd;
++    char *s,*d, *buf;
++    size_t slen, dlen;
++    const char *local_charset;
++
++    if(*from_charset == '\0')
++    	return;
++
++    local_charset = nl_langinfo(CODESET);
++
++    if((cd = iconv_open(local_charset, from_charset)) == (iconv_t)-1)
++        return;
++
++    slen = strlen(string);
++    s = string;
++    dlen = sbuflen - 1;
++    d = buf = malloc(sbuflen);
++    if(!d)
++    	goto cleanup;
++    if(iconv(cd, (const char **)&s, &slen, &d, &dlen) != (size_t)-1) {
++	*d = '\0';
++	strcpy(string, buf);
++    }
++    
++    free(buf);
++    cleanup:
++    iconv_close(cd);
++}
++
++/* Convert a string from OEM_CP to the current locale charset. */
++void oem_intern(char *string, size_t sbuflen)
++{
++    charset_to_intern(string, sbuflen, OEM_CP);
++}
++
++/* Convert a string from ISO_CP to the current locale charset. */
++void iso_intern(char *string, size_t sbuflen)
++{
++    charset_to_intern(string, sbuflen, ISO_CP);
++}
+Only in unzip60/unix: unix.c.orig
+diff -ur unzip60-orig/unix/unxcfg.h unzip60/unix/unxcfg.h
+--- unzip60-orig/unix/unxcfg.h	2009-04-16 20:36:12.000000000 +0200
++++ unzip60/unix/unxcfg.h	2011-02-25 11:57:38.262941301 +0100
[email protected]@ -52,6 +52,7 @@
+ 
+ #include <sys/types.h>          /* off_t, time_t, dev_t, ... */
+ #include <sys/stat.h>
++#include <unistd.h>
+ 
+ #ifdef NO_OFF_T
+   typedef long zoff_t;
[email protected]@ -227,4 +228,30 @@
+ /* 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, ssize) iso_intern(str1, ssize)
++
++#ifdef _OEM_INTERN
++#  undef _OEM_INTERN
++#endif
++#ifndef IZ_OEM2ISO_ARRAY
++#  define IZ_OEM2ISO_ARRAY
++#endif
++#define _OEM_INTERN(str1, ssize) oem_intern(str1, ssize)
++
++void iso_intern(char *, size_t);
++void oem_intern(char *, size_t);
++void init_conversion_charsets(const char *);
++   
+ #endif /* !__unxcfg_h */
+Only in unzip60/unix: unxcfg.h.orig
+diff -ur unzip60-orig/unzip.c unzip60/unzip.c
+--- unzip60-orig/unzip.c	2009-04-16 20:26:52.000000000 +0200
++++ unzip60/unzip.c	2011-02-26 00:03:41.011389301 +0100
[email protected]@ -327,11 +327,21 @@
+   -2  just filenames but allow -h/-t/-z  -l  long Unix \"ls -l\" format\n\
+                                          -v  verbose, multi-page format\n";
+ 
++#ifdef 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\
++  -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";
++#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   -T  print file times in sortable decimal format\
+ \n  -C  be case-insensitive   %s\
+   -x  exclude filenames that follow from listing\n";
++#endif /* UNIX */
+ #ifdef MORE
+    static ZCONST char Far ZipInfoUsageLine4[] =
+      "  -M  page output through built-in \"more\"\n";
[email protected]@ -666,6 +676,18 @@
+   -C  match filenames case-insensitively     -L  make (some) names \
+ lowercase\n %-42s  -V  retain VMS version numbers\n%s";
+ #else /* !VMS */
++#ifdef 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\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\n";
++#else /* !UNIX */
+ static ZCONST char Far UnzipUsageLine4[] = "\
+ modifiers:\n\
+   -n  never overwrite existing files         -q  quiet mode (-qq => quieter)\n\
[email protected]@ -674,6 +696,7 @@
+   -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";
++#endif /* UNIX */
+ #endif /* ?VMS */
+ #else /* !UNICODE_SUPPORT */
+ #ifdef VMS
[email protected]@ -742,6 +765,9 @@
+     int i;
+ #endif
+     int retcode, error=FALSE;
++#ifdef UNIX
++    const char *loc;
++#endif
+ #ifndef NO_EXCEPT_SIGNALS
+ #ifdef REENTRANT
+     savsigs_info *oldsighandlers = NULL;
[email protected]@ -756,7 +782,12 @@
+ #endif /* NO_EXCEPT_SIGNALS */
+ 
+     /* initialize international char support to the current environment */
++#ifdef UNIX
++    loc = SETLOCALE(LC_CTYPE,"");
++    init_conversion_charsets(loc);
++#else /* !UNIX */
+     SETLOCALE(LC_CTYPE, "");
++#endif /* UNIX */
+ 
+ #ifdef UNICODE_SUPPORT
+     /* see if can use UTF-8 Unicode locale */
[email protected]@ -1336,6 +1367,11 @@
+     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 */
[email protected]@ -1517,6 +1553,37 @@
+                     }
+                     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) - 1);
++                            ISO_CP[sizeof(ISO_CP) - 1] = '\0';
++                        } 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) - 1);
++                            ISO_CP[sizeof(ISO_CP) - 1] = '\0';
++                        }
++                        while(*(++s)); /* No params straight after charset name */
++                    }
++                    break;
++#endif /* ?UNIX */
+                 case ('j'):    /* junk pathnames/directory structure */
+                     if (negative)
+                         uO.jflag = FALSE, negative = 0;
[email protected]@ -1592,6 +1659,37 @@
+                     } 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) - 1);
++                            OEM_CP[sizeof(OEM_CP) - 1] = '\0';
++                        } 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) - 1);
++                            OEM_CP[sizeof(OEM_CP) - 1] = '\0';
++                        }
++                        while(*(++s)); /* No params straight after charset name */
++                    }
++                    break;
++#endif /* ?UNIX */
+                 case ('p'):    /* pipes:  extract to stdout, no messages */
+                     if (negative) {
+                         uO.cflag = FALSE;
+Only in unzip60: unzip.c.orig
+diff -ur unzip60-orig/unzpriv.h unzip60/unzpriv.h
+--- unzip60-orig/unzpriv.h	2009-04-20 01:59:26.000000000 +0200
++++ unzip60/unzpriv.h	2011-02-25 11:57:38.275212165 +0100
[email protected]@ -3003,6 +3003,18 @@
+  * All other ports are assumed to code zip entry filenames in ISO 8859-1.
+  */
+ #ifndef Ext_ASCII_TO_Native
++#ifdef UNIX
++#  define Ext_ASCII_TO_Native(string, hostnum, hostver, isuxatt, islochdr, ssize) \
++    if (((hostnum) == FS_FAT_ && \
++         !(((islochdr) || (isuxatt)) && \
++           ((hostver) == 25 || (hostver) == 26 || (hostver) == 40))) || \
++        (hostnum) == FS_HPFS_ || \
++        ((hostnum) == FS_NTFS_/* && (hostver) == 50*/)) { \
++        _OEM_INTERN((string), (ssize)); \
++    } else { \
++        _ISO_INTERN((string), (ssize)); \
++    }
++#else /* !UNIX */
+ #  define Ext_ASCII_TO_Native(string, hostnum, hostver, isuxatt, islochdr) \
+     if (((hostnum) == FS_FAT_ && \
+          !(((islochdr) || (isuxatt)) && \
[email protected]@ -3013,10 +3025,10 @@
+     } else { \
+         _ISO_INTERN((string)); \
+     }
++#endif /* UNIX */
+ #endif
+ 
+ 
+-
+ /**********************/
+ /*  Global constants  */
+ /**********************/
+Only in unzip60: unzpriv.h.orig
+diff -ur unzip60-orig/zipinfo.c unzip60/zipinfo.c
+--- unzip60-orig/zipinfo.c	2009-02-08 18:04:30.000000000 +0100
++++ unzip60/zipinfo.c	2011-02-25 11:57:38.281586457 +0100
[email protected]@ -457,6 +457,10 @@
+     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 */
[email protected]@ -501,6 +505,37 @@
+                             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) - 1);
++                            ISO_CP[sizeof(ISO_CP) - 1] = '\0';
++                        } 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) - 1);
++                            ISO_CP[sizeof(ISO_CP) - 1] = '\0';
++                        }
++                        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;
[email protected]@ -521,6 +556,37 @@
+                         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) - 1);
++                            OEM_CP[sizeof(OEM_CP) - 1] = '\0';
++                        } 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) - 1);
++                            OEM_CP[sizeof(OEM_CP) - 1] = '\0';
++                        }
++                        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;
+Only in unzip60: zipinfo.c.orig
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/unzip/unzip.p5m	Wed Apr 20 01:53:37 2011 +0200
@@ -0,0 +1,58 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+#
+
+<transform file path=usr.*/man/.+ -> default mangler.man.stability volatile>
+
+set name=pkg.fmri \
+    value=pkg:/compress/[email protected]$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
+set name=pkg.description value="The Info-Zip (unzip) decompression utility"
+set name=pkg.summary value="Info-Zip (unzip)"
+set name=info.classification \
+    value="org.opensolaris.category.2008:Applications/System Utilities "
+set name=info.source_url value=$(COMPONENT_ARCHIVE_URL)
+set name=info.upstream_url value=$(COMPONENT_PROJECT_URL)
+set name=opensolaris.arc_url \
+    value=http://arc.opensolaris.org/caselog/PSARC/1999/555
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+
+license info-zip.license license="Info-ZIP"
+
+dir path=usr
+dir path=usr/bin
+dir path=usr/share
+dir path=usr/share/man
+dir path=usr/share/man/man1
+file path=usr/bin/funzip
+file path=usr/bin/unzip
+file path=usr/bin/unzipsfx
+file path=usr/bin/zipgrep
+link path=usr/bin/zipinfo target=unzip
+file path=usr/share/man/man1/funzip.1
+file path=usr/share/man/man1/unzip.1
+file path=usr/share/man/man1/unzipsfx.1
+file path=usr/share/man/man1/zipinfo.1
+file path=usr/share/man/man1/zipgrep.1
+
+legacy	pkg=SUNWunzip \
+	name="The Info-Zip (unzip) decompression utility" \
+	desc="The Info-Zip (unzip) decompression utility"