Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Mar 2009 02:51:19 +0000 (UTC)
From:      Tim Kientzle <kientzle@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r189477 - head/lib/libarchive
Message-ID:  <200903070251.n272pJLq036283@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kientzle
Date: Sat Mar  7 02:51:18 2009
New Revision: 189477
URL: http://svn.freebsd.org/changeset/base/189477

Log:
  Merge r585,r669 from libarchive.googlecode.com:  If zlib is unavailable,
  use external "gunzip" instead.  With this in place, we can unconditionally
  enable gzip read support.

Modified:
  head/lib/libarchive/archive_read_support_compression_all.c
  head/lib/libarchive/archive_read_support_compression_gzip.c

Modified: head/lib/libarchive/archive_read_support_compression_all.c
==============================================================================
--- head/lib/libarchive/archive_read_support_compression_all.c	Sat Mar  7 02:47:04 2009	(r189476)
+++ head/lib/libarchive/archive_read_support_compression_all.c	Sat Mar  7 02:51:18 2009	(r189477)
@@ -36,9 +36,8 @@ archive_read_support_compression_all(str
 #endif
 	/* The decompress code doesn't use an outside library. */
 	archive_read_support_compression_compress(a);
-#if HAVE_ZLIB_H
+	/* Gzip decompress falls back to "gunzip" command-line. */
 	archive_read_support_compression_gzip(a);
-#endif
 #if HAVE_LZMADEC_H
 	/* LZMA bidding is subject to false positives because
 	 * the LZMA file format has a very weak signature.  It

Modified: head/lib/libarchive/archive_read_support_compression_gzip.c
==============================================================================
--- head/lib/libarchive/archive_read_support_compression_gzip.c	Sat Mar  7 02:47:04 2009	(r189476)
+++ head/lib/libarchive/archive_read_support_compression_gzip.c	Sat Mar  7 02:51:18 2009	(r189477)
@@ -91,7 +91,7 @@ archive_read_support_compression_gzip(st
 	bidder->bid = gzip_bidder_bid;
 	bidder->init = gzip_bidder_init;
 	bidder->options = NULL;
-	bidder->free = NULL;
+	bidder->free = NULL; /* No data, so no cleanup necessary. */
 	return (ARCHIVE_OK);
 }
 
@@ -212,12 +212,14 @@ gzip_bidder_bid(struct archive_read_filt
  * and emit a useful message.
  */
 static int
-gzip_bidder_init(struct archive_read_filter *filter)
+gzip_bidder_init(struct archive_read_filter *self)
 {
+	int r;
 
-	archive_set_error(&filter->archive->archive, -1,
-	    "This version of libarchive was compiled without gzip support");
-	return (ARCHIVE_FATAL);
+	r = __archive_read_program(self, "gunzip");
+	self->code = ARCHIVE_COMPRESSION_GZIP;
+	self->name = "gzip";
+	return (r);
 }
 
 #else



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903070251.n272pJLq036283>