Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Mar 2009 17:07:27 +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: r189309 - head/lib/libarchive
Message-ID:  <200903031707.n23H7RmL016396@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kientzle
Date: Tue Mar  3 17:07:27 2009
New Revision: 189309
URL: http://svn.freebsd.org/changeset/base/189309

Log:
  Merge r340 from libarchive.googlecode.com: If zlib/bzlib aren't available,
  we can still detect gzip/bzip2 compressed streams, we just can't
  decompress them.

Modified:
  head/lib/libarchive/archive_write_set_compression_bzip2.c
  head/lib/libarchive/archive_write_set_compression_gzip.c

Modified: head/lib/libarchive/archive_write_set_compression_bzip2.c
==============================================================================
--- head/lib/libarchive/archive_write_set_compression_bzip2.c	Tue Mar  3 17:02:51 2009	(r189308)
+++ head/lib/libarchive/archive_write_set_compression_bzip2.c	Tue Mar  3 17:07:27 2009	(r189309)
@@ -25,9 +25,6 @@
 
 #include "archive_platform.h"
 
-/* Don't compile this if we don't have bzlib. */
-#if HAVE_BZLIB_H
-
 __FBSDID("$FreeBSD$");
 
 #ifdef HAVE_ERRNO_H
@@ -48,6 +45,16 @@ __FBSDID("$FreeBSD$");
 #include "archive_private.h"
 #include "archive_write_private.h"
 
+#ifndef HAVE_BZLIB_H
+int
+archive_write_set_compression_bzip2(struct archive *_a)
+{
+	/* Unsupported bzip2 compression, we don't have bzlib */
+	return (ARCHIVE_FATAL);
+}
+#else
+/* Don't compile this if we don't have bzlib. */
+
 struct private_data {
 	bz_stream	 stream;
 	int64_t		 total_in;

Modified: head/lib/libarchive/archive_write_set_compression_gzip.c
==============================================================================
--- head/lib/libarchive/archive_write_set_compression_gzip.c	Tue Mar  3 17:02:51 2009	(r189308)
+++ head/lib/libarchive/archive_write_set_compression_gzip.c	Tue Mar  3 17:07:27 2009	(r189309)
@@ -25,9 +25,6 @@
 
 #include "archive_platform.h"
 
-/* Don't compile this if we don't have zlib. */
-#if HAVE_ZLIB_H
-
 __FBSDID("$FreeBSD$");
 
 #ifdef HAVE_ERRNO_H
@@ -48,6 +45,16 @@ __FBSDID("$FreeBSD$");
 #include "archive_private.h"
 #include "archive_write_private.h"
 
+#ifndef HAVE_ZLIB_H
+int
+archive_write_set_compression_gzip(struct archive *_a)
+{
+	/* Unsupported gzip compression, we don't have zlib */
+	return (ARCHIVE_FATAL);
+}
+#else
+/* Don't compile this if we don't have zlib. */
+
 struct private_data {
 	z_stream	 stream;
 	int64_t		 total_in;



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