[Commits] [SCM] claws branch, master, updated. 3.11.1-9-g1f531cb

wwp at claws-mail.org wwp at claws-mail.org
Fri Oct 31 11:17:55 CET 2014


The branch, master has been updated
       via  1f531cb572b3d826995bba47b7cf9a65042d9d78 (commit)
       via  b31596fbc276d86b67fc676e3f859cd513d8b4fe (commit)
      from  64f523e4ab992a1f515294dd906d8aae15277235 (commit)

Summary of changes:
 src/plugins/archive/libarchive_archive.c |   32 ++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)


- Log -----------------------------------------------------------------
commit 1f531cb572b3d826995bba47b7cf9a65042d9d78
Merge: b31596f 64f523e
Author: wwp <wwp at free.fr>
Date:   Fri Oct 31 11:17:29 2014 +0100

    Merge branch 'master' of ssh+git://git.claws-mail.org/home/git/claws


commit b31596fbc276d86b67fc676e3f859cd513d8b4fe
Author: wwp <wwp at free.fr>
Date:   Fri Oct 31 11:04:24 2014 +0100

    Fix compat with libarchive 2.8.x (killed by 3.10.1-85-ga5e54ec).

diff --git a/src/plugins/archive/libarchive_archive.c b/src/plugins/archive/libarchive_archive.c
index 492fea7..acc13be 100644
--- a/src/plugins/archive/libarchive_archive.c
+++ b/src/plugins/archive/libarchive_archive.c
@@ -389,7 +389,11 @@ const gchar* archive_extract(const char* archive_name, int flags) {
 	in = archive_read_new();
 	if ((res = archive_read_support_format_tar(in)) == ARCHIVE_OK) {
 		if ((res = archive_read_support_compression_gzip(in)) == ARCHIVE_OK) {
+#if ARCHIVE_VERSION_NUMBER < 3000000
+			if ((res = archive_read_open_file(
+#else
 			if ((res = archive_read_open_filename(
+#endif
 				in, archive_name, READ_BLOCK_SIZE)) != ARCHIVE_OK) {
 				buf = g_strdup_printf(
 						"%s: %s\n", archive_name, archive_error_string(in));
@@ -444,7 +448,11 @@ const gchar* archive_extract(const char* archive_name, int flags) {
 					result = archive_error_string(out);
 				archive_read_close(in);
 			}
+#if ARCHIVE_VERSION_NUMBER < 3000000
+			archive_read_finish(in);
+#else
 			archive_read_free(in);
+#endif
 		}
 		else
 			result = archive_error_string(in);
@@ -478,21 +486,37 @@ const gchar* archive_create(const char* archive_name, GSList* files,
 	arch = archive_write_new();
 	switch (method) {
 		case ZIP:
+#if ARCHIVE_VERSION_NUMBER < 3000000
+			if (archive_write_set_compression_gzip(arch) != ARCHIVE_OK)
+#else
 			if (archive_write_add_filter_gzip(arch) != ARCHIVE_OK)
+#endif
 				return archive_error_string(arch);
 			break;
 		case BZIP2:
+#if ARCHIVE_VERSION_NUMBER < 3000000
+			if (archive_write_set_compression_bzip2(arch) != ARCHIVE_OK)
+#else
 			if (archive_write_add_filter_bzip2(arch) != ARCHIVE_OK)
+#endif
 				return archive_error_string(arch);
 			break;
 #if NEW_ARCHIVE_API
 		case COMPRESS:
+#if ARCHIVE_VERSION_NUMBER < 3000000
+			if (archive_write_set_compression_compress(arch) != ARCHIVE_OK)
+#else
 			if (archive_write_add_filter_compress(arch) != ARCHIVE_OK)
+#endif
     			        return archive_error_string(arch);
 			break;
 #endif
 		case NO_COMPRESS:
+#if ARCHIVE_VERSION_NUMBER < 3000000
+			if (archive_write_set_compression_none(arch) != ARCHIVE_OK)
+#else
 			if (archive_write_add_filter_none(arch) != ARCHIVE_OK)
+#endif
 				return archive_error_string(arch);
 			break;
 	}
@@ -516,7 +540,11 @@ const gchar* archive_create(const char* archive_name, GSList* files,
 		case NO_FORMAT:
 			return "Missing archive format";
 	}
+#if ARCHIVE_VERSION_NUMBER < 3000000
+	if (archive_write_open_file(arch, archive_name) != ARCHIVE_OK)
+#else
 	if (archive_write_open_filename(arch, archive_name) != ARCHIVE_OK)
+#endif
 		return archive_error_string(arch);
 
 	while (files && ! stop_action) {
@@ -592,7 +620,11 @@ const gchar* archive_create(const char* archive_name, GSList* files,
 	stop_action = FALSE;
 #endif
 	archive_write_close(arch);
+#if ARCHIVE_VERSION_NUMBER < 3000000
+	archive_write_finish(arch);
+#else
 	archive_write_free(arch);
+#endif
 	return NULL;
 }
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list