7183526 Update gzip to version 1.5
authorRich Burridge <rich.burridge@oracle.com>
Mon, 17 Sep 2012 15:51:52 -0700
changeset 977 4a6b2f8dca71
parent 976 3e60a8a2dff1
child 978 f7d58c85fe8d
7183526 Update gzip to version 1.5
components/gzip/Makefile
components/gzip/gzip.license
components/gzip/gzip.p5m
components/gzip/patches/gzip.c.patch
components/gzip/patches/zgrep.in.patch
--- a/components/gzip/Makefile	Mon Sep 17 13:33:07 2012 -0700
+++ b/components/gzip/Makefile	Mon Sep 17 15:51:52 2012 -0700
@@ -23,12 +23,12 @@
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		gzip
-COMPONENT_VERSION=	1.4
+COMPONENT_VERSION=	1.5
 COMPONENT_PROJECT_URL=	http://www.gnu.org/software/gzip/
 COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
-    sha256:d166cfd3da380da1bd535633e8890bfb5664f9e68870a611d1dc01a3e9f711ee
+    sha256:b5d56e8ffc9918e8c941fab56e04121194f9870adeeb859e09c09eac264035a3
 COMPONENT_ARCHIVE_URL=	ftp://ftp.gnu.org/gnu/gzip/$(COMPONENT_ARCHIVE)
 
 include ../../make-rules/prep.mk
@@ -41,7 +41,16 @@
 CONFIGURE_OPTIONS +=	--infodir=$(CONFIGURE_INFODIR)
 CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)" 
 
-COMPONENT_TEST_ENV +=	PATH=/usr/gnu/bin:/usr/bin
+# Needed for "gmake test" to work successfully.
+# If SHELLOPTS is exported (as it is by the userland makefiles),
+# then all shell options get exported to child invocations of bash,
+# which results in test failures due to nounset and xtrace being
+# set unexpectedly, and errors such as "$1: unbound variable" and
+# diffs failing due to script tracing in output files.
+unexport SHELLOPTS
+
+# Get the binaries to test from the component build area.
+COMPONENT_TEST_ENV +=	PATH=$(BUILD_DIR_$(BITS)):/usr/xpg4/bin:/usr/bin
 COMPONENT_TEST_TARGETS = check
 
 # Fix references to Solaris renamed programs (z*->gz*) in man pages, info
--- a/components/gzip/gzip.license	Mon Sep 17 13:33:07 2012 -0700
+++ b/components/gzip/gzip.license	Mon Sep 17 15:51:52 2012 -0700
@@ -1,5 +1,5 @@
 ------------
-- gzip 1.4 -
+- gzip 1.5 -
 ------------
 
 Oracle Internal Tracking Number 7913
--- a/components/gzip/gzip.p5m	Mon Sep 17 13:33:07 2012 -0700
+++ b/components/gzip/gzip.p5m	Mon Sep 17 15:51:52 2012 -0700
@@ -71,3 +71,5 @@
     name="The GNU Zip (gzip) compression utility"
 
 license gzip.license license="GPLv3, FDLv1.3"
+# zgrep needs a version of grep that has the -f command line option.
+depend fmri=system/xopen/xcu4 type=require
--- a/components/gzip/patches/gzip.c.patch	Mon Sep 17 13:33:07 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
---- gzip-1.4/gzip.c.orig	2012-04-16 11:27:08.478456051 -0700
-+++ gzip-1.4/gzip.c	2012-04-23 13:06:53.395234301 -0700
[email protected]@ -1699,36 +1699,25 @@
-     int fd;
-     char *dir;
- {
-+    struct dirent **namelist;
-     struct dirent *dp;
--    DIR      *dirp;
-     char     nbuf[MAX_PATH_LEN];
--    int      len;
-+    int      len, n;
- 
--    dirp = fdopendir (fd);
--
--    if (dirp == NULL) {
-+    /* Adjusted to use scandir to prevent compressing files multiple times
-+     * on file systems that use a hash lookup for directory entries (such
-+     * as btrfs and ZFS.
-+     */
-+    if ((n = scandir(dir, &namelist, 0, NULL)) < 0) {
- 	progerror(dir);
- 	close (fd);
- 	return ;
-     }
--    /*
--     ** WARNING: the following algorithm could occasionally cause
--     ** compress to produce error warnings of the form "<filename>.gz
--     ** already has .gz suffix - ignored". This occurs when the
--     ** .gz output file is inserted into the directory below
--     ** readdir's current pointer.
--     ** These warnings are harmless but annoying, so they are suppressed
--     ** with option -r (except when -v is on). An alternative
--     ** to allowing this would be to store the entire directory
--     ** list in memory, then compress the entries in the stored
--     ** list. Given the depth-first recursive algorithm used here,
--     ** this could use up a tremendous amount of memory. I don't
--     ** think it's worth it. -- Dave Mack
--     ** (An other alternative might be two passes to avoid depth-first.)
--     */
--
--    while ((errno = 0, dp = readdir(dirp)) != NULL) {
- 
-+    while (n--) {
-+	if (errno != 0)
-+	    break;
-+	dp = namelist[n];
- 	if (strequ(dp->d_name,".") || strequ(dp->d_name,"..")) {
- 	    continue;
- 	}
[email protected]@ -1747,6 +1736,7 @@
- 	    }
- 	    strcpy(nbuf+len, dp->d_name);
- 	    treat_file(nbuf);
-+	    free(dp);
- 	} else {
- 	    fprintf(stderr,"%s: %s/%s: pathname too long\n",
- 		    program_name, dir, dp->d_name);
[email protected]@ -1755,8 +1745,8 @@
-     }
-     if (errno != 0)
- 	progerror(dir);
--    if (CLOSEDIR(dirp) != 0)
--	progerror(dir);
-+
-+    free(namelist);
- }
- #endif /* ! NO_DIR */
- 
--- a/components/gzip/patches/zgrep.in.patch	Mon Sep 17 13:33:07 2012 -0700
+++ b/components/gzip/patches/zgrep.in.patch	Mon Sep 17 15:51:52 2012 -0700
@@ -1,8 +1,11 @@
---- gzip-1.4/zgrep.in.orig	2012-03-29 11:17:35.341079056 -0700
-+++ gzip-1.4/zgrep.in	2012-03-29 11:18:46.475732896 -0700
[email protected]@ -26,7 +26,11 @@
+--- gzip-1.5/zgrep.in.orig	2012-09-05 15:31:20.730722910 -0700
++++ gzip-1.5/zgrep.in	2012-09-05 15:33:51.300884579 -0700
[email protected]@ -26,9 +26,13 @@
+ case $1 in
+ --__bindir) bindir=${2?}; shift; shift;;
  esac
- PATH=$bindir:$PATH
+-PATH=$bindir:$PATH
++PATH=/usr/xpg4/bin:$bindir:$PATH
  
 -grep='${GREP-grep}'
 +case "$1" in
@@ -12,4 +15,4 @@
 +esac
  
  version='zgrep (gzip) @[email protected]
- Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 2010-2012 Free Software Foundation, Inc.