[SCM] ark packaging branch, master, updated. debian/4.13.1-1-2-g078f4ba
Maximiliano Curia
maxy at moszumanska.debian.org
Tue Jul 8 19:05:43 UTC 2014
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-sc/ark.git;a=commitdiff;h=078f4ba
The following commit has been merged in the master branch:
commit 078f4ba36615a9d8d65d5a46dbbb2cd100e7b8ce
Author: Maximiliano Curia <maxy at debian.org>
Date: Tue Jul 8 20:31:21 2014 +0200
Update patch: use_libarchive_for_zip_files
Also, migrates the libarchive plugin to v3.
---
debian/changelog | 1 +
debian/patches/use_libarchive_for_zip_files | 233 ++++++++++++++++++++++++++--
2 files changed, 225 insertions(+), 9 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 98aad5d..189e60c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
ark (4:4.13.2-1) UNRELEASED; urgency=medium
* New upstream release.
+ * Update patch: use_libarchive_for_zip_files (Closes: #749916)
-- Maximiliano Curia <maxy at debian.org> Tue, 01 Jul 2014 17:12:49 +0200
diff --git a/debian/patches/use_libarchive_for_zip_files b/debian/patches/use_libarchive_for_zip_files
index 4717972..264a77f 100644
--- a/debian/patches/use_libarchive_for_zip_files
+++ b/debian/patches/use_libarchive_for_zip_files
@@ -4,10 +4,10 @@ Date: Thu Feb 27 11:25:38 2014 +0100
Use libarchive for zip files.
-diff --git a/plugins/clizipplugin/CMakeLists.txt b/plugins/clizipplugin/CMakeLists.txt
-index 5e180fb..cb80301 100644
---- a/plugins/clizipplugin/CMakeLists.txt
-+++ b/plugins/clizipplugin/CMakeLists.txt
+Index: ark/plugins/clizipplugin/CMakeLists.txt
+===================================================================
+--- ark.orig/plugins/clizipplugin/CMakeLists.txt 2014-07-08 20:53:00.738303670 +0200
++++ ark/plugins/clizipplugin/CMakeLists.txt 2014-07-08 20:53:00.734303843 +0200
@@ -1,6 +1,6 @@
########### next target ###############
@@ -16,11 +16,11 @@ index 5e180fb..cb80301 100644
set(kerfuffle_clizip_SRCS cliplugin.cpp)
-diff --git a/plugins/libarchive/CMakeLists.txt b/plugins/libarchive/CMakeLists.txt
-index 5d6d009..14a1b22 100644
---- a/plugins/libarchive/CMakeLists.txt
-+++ b/plugins/libarchive/CMakeLists.txt
-@@ -2,7 +2,7 @@ include_directories(${LIBARCHIVE_INCLUDE_DIR})
+Index: ark/plugins/libarchive/CMakeLists.txt
+===================================================================
+--- ark.orig/plugins/libarchive/CMakeLists.txt 2014-07-08 20:53:00.738303670 +0200
++++ ark/plugins/libarchive/CMakeLists.txt 2014-07-08 20:53:00.734303843 +0200
+@@ -2,7 +2,7 @@
########### next target ###############
set(SUPPORTED_LIBARCHIVE_READONLY_MIMETYPES "application/x-deb;application/x-cd-image;application/x-bcpio;application/x-cpio;application/x-cpio-compressed;application/x-sv4cpio;application/x-sv4crc;")
@@ -29,3 +29,218 @@ index 5d6d009..14a1b22 100644
if(HAVE_LIBARCHIVE_RPM_SUPPORT)
set(SUPPORTED_LIBARCHIVE_READONLY_MIMETYPES "${SUPPORTED_LIBARCHIVE_READONLY_MIMETYPES}application/x-rpm;application/x-source-rpm;")
endif(HAVE_LIBARCHIVE_RPM_SUPPORT)
+Index: ark/plugins/libarchive/libarchivehandler.cpp
+===================================================================
+--- ark.orig/plugins/libarchive/libarchivehandler.cpp 2014-07-08 20:53:00.738303670 +0200
++++ ark/plugins/libarchive/libarchivehandler.cpp 2014-07-08 20:53:39.836599226 +0200
+@@ -50,7 +50,7 @@
+ static inline void cleanup(struct archive *a)
+ {
+ if (a) {
+- archive_read_finish(a);
++ archive_read_free(a);
+ }
+ }
+ };
+@@ -60,7 +60,7 @@
+ static inline void cleanup(struct archive *a)
+ {
+ if (a) {
+- archive_write_finish(a);
++ archive_write_free(a);
+ }
+ }
+ };
+@@ -91,7 +91,7 @@
+ return false;
+ }
+
+- if (archive_read_support_compression_all(arch_reader.data()) != ARCHIVE_OK) {
++ if (archive_read_support_filter_all(arch_reader.data()) != ARCHIVE_OK) {
+ return false;
+ }
+
+@@ -109,7 +109,7 @@
+ m_extractedFilesSize = 0;
+
+ struct archive_entry *aentry;
+- int result;
++ int result = ARCHIVE_OK;
+
+ while (!m_abortOperation && (result = archive_read_next_header(arch_reader.data(), &aentry)) == ARCHIVE_OK) {
+ if (!m_emitNoEntries) {
+@@ -157,7 +157,7 @@
+ return false;
+ }
+
+- if (archive_read_support_compression_all(arch.data()) != ARCHIVE_OK) {
++ if (archive_read_support_filter_all(arch.data()) != ARCHIVE_OK) {
+ return false;
+ }
+
+@@ -210,7 +210,7 @@
+ // retry with renamed entry, fire an overwrite query again
+ // if the new entry also exists
+ retry:
+- const bool entryIsDir = S_ISDIR(archive_entry_mode(entry));
++ const bool entryIsDir = (archive_entry_filetype(entry) == AE_IFDIR);
+
+ //we skip directories if not preserving paths
+ if (!preservePaths && entryIsDir) {
+@@ -356,7 +356,7 @@
+ return false;
+ }
+
+- if (archive_read_support_compression_all(arch_reader.data()) != ARCHIVE_OK) {
++ if (archive_read_support_filter_all(arch_reader.data()) != ARCHIVE_OK) {
+ return false;
+ }
+
+@@ -376,33 +376,39 @@
+ return false;
+ }
+
+- //pax_restricted is the libarchive default, let's go with that.
+- archive_write_set_format_pax_restricted(arch_writer.data());
+-
+- int ret;
++ int ret = ARCHIVE_OK;
+ if (creatingNewFile) {
+ if (filename().right(2).toUpper() == QLatin1String( "GZ" )) {
+ kDebug() << "Detected gzip compression for new file";
+- ret = archive_write_set_compression_gzip(arch_writer.data());
++ //pax_restricted is the libarchive default, let's go with that.
++ archive_write_set_format_pax_restricted(arch_writer.data());
++ ret = archive_write_add_filter_gzip(arch_writer.data());
+ } else if (filename().right(3).toUpper() == QLatin1String( "BZ2" )) {
+ kDebug() << "Detected bzip2 compression for new file";
+- ret = archive_write_set_compression_bzip2(arch_writer.data());
++ archive_write_set_format_pax_restricted(arch_writer.data());
++ ret = archive_write_add_filter_bzip2(arch_writer.data());
+ #ifdef HAVE_LIBARCHIVE_XZ_SUPPORT
+ } else if (filename().right(2).toUpper() == QLatin1String( "XZ" )) {
+ kDebug() << "Detected xz compression for new file";
+- ret = archive_write_set_compression_xz(arch_writer.data());
++ archive_write_set_format_pax_restricted(arch_writer.data());
++ ret = archive_write_add_filter_xz(arch_writer.data());
+ #endif
+ #ifdef HAVE_LIBARCHIVE_LZMA_SUPPORT
+ } else if (filename().right(4).toUpper() == QLatin1String( "LZMA" )) {
+ kDebug() << "Detected lzma compression for new file";
+- ret = archive_write_set_compression_lzma(arch_writer.data());
++ archive_write_set_format_pax_restricted(arch_writer.data());
++ ret = archive_write_add_filter_lzma(arch_writer.data());
+ #endif
+ } else if (filename().right(3).toUpper() == QLatin1String( "TAR" )) {
+ kDebug() << "Detected no compression for new file (pure tar)";
+- ret = archive_write_set_compression_none(arch_writer.data());
++ ret = archive_write_set_format_pax_restricted(arch_writer.data());
++ } else if (filename().right(3).toUpper() == QLatin1String( "ZIP" )) {
++ kDebug() << "Detected zip format for new file";
++ ret = archive_write_set_format_zip(arch_writer.data());
+ } else {
+ kDebug() << "Falling back to gzip";
+- ret = archive_write_set_compression_gzip(arch_writer.data());
++ archive_write_set_format_pax_restricted(arch_writer.data());
++ ret = archive_write_add_filter_gzip(arch_writer.data());
+ }
+
+ if (ret != ARCHIVE_OK) {
+@@ -412,31 +418,14 @@
+ return false;
+ }
+ } else {
+- switch (archive_compression(arch_reader.data())) {
+- case ARCHIVE_COMPRESSION_GZIP:
+- ret = archive_write_set_compression_gzip(arch_writer.data());
+- break;
+- case ARCHIVE_COMPRESSION_BZIP2:
+- ret = archive_write_set_compression_bzip2(arch_writer.data());
+- break;
+-#ifdef HAVE_LIBARCHIVE_XZ_SUPPORT
+- case ARCHIVE_COMPRESSION_XZ:
+- ret = archive_write_set_compression_xz(arch_writer.data());
+- break;
+-#endif
+-#ifdef HAVE_LIBARCHIVE_LZMA_SUPPORT
+- case ARCHIVE_COMPRESSION_LZMA:
+- ret = archive_write_set_compression_lzma(arch_writer.data());
+- break;
+-#endif
+- case ARCHIVE_COMPRESSION_NONE:
+- ret = archive_write_set_compression_none(arch_writer.data());
+- break;
+- default:
+- emit error(i18n("The compression type '%1' is not supported by Ark.", QLatin1String(archive_compression_name(arch_reader.data()))));
++ int format_code = archive_format(arch_reader.data());
++ ret = archive_write_set_format(arch_writer.data(), format_code);
++ if (ret != ARCHIVE_OK) {
++ emit error(i18nc("@info", "Setting the format failed with the following error: <message>%1</message>", QLatin1String(archive_error_string(arch_writer.data()))));
+ return false;
+ }
+-
++ int filter_code = archive_filter_code(arch_reader.data(), 0);
++ ret = archive_write_add_filter(arch_writer.data(), filter_code);
+ if (ret != ARCHIVE_OK) {
+ emit error(i18nc("@info", "Setting the compression method failed with the following error: <message>%1</message>", QLatin1String(archive_error_string(arch_writer.data()))));
+ return false;
+@@ -534,7 +523,7 @@
+ return false;
+ }
+
+- if (archive_read_support_compression_all(arch_reader.data()) != ARCHIVE_OK) {
++ if (archive_read_support_filter_all(arch_reader.data()) != ARCHIVE_OK) {
+ return false;
+ }
+
+@@ -553,35 +542,15 @@
+ return false;
+ }
+
+- //pax_restricted is the libarchive default, let's go with that.
+- archive_write_set_format_pax_restricted(arch_writer.data());
+-
+ int ret;
+- switch (archive_compression(arch_reader.data())) {
+- case ARCHIVE_COMPRESSION_GZIP:
+- ret = archive_write_set_compression_gzip(arch_writer.data());
+- break;
+- case ARCHIVE_COMPRESSION_BZIP2:
+- ret = archive_write_set_compression_bzip2(arch_writer.data());
+- break;
+-#ifdef HAVE_LIBARCHIVE_XZ_SUPPORT
+- case ARCHIVE_COMPRESSION_XZ:
+- ret = archive_write_set_compression_xz(arch_writer.data());
+- break;
+-#endif
+-#ifdef HAVE_LIBARCHIVE_LZMA_SUPPORT
+- case ARCHIVE_COMPRESSION_LZMA:
+- ret = archive_write_set_compression_lzma(arch_writer.data());
+- break;
+-#endif
+- case ARCHIVE_COMPRESSION_NONE:
+- ret = archive_write_set_compression_none(arch_writer.data());
+- break;
+- default:
+- emit error(i18n("The compression type '%1' is not supported by Ark.", QLatin1String(archive_compression_name(arch_reader.data()))));
++ int format_code = archive_format(arch_reader.data());
++ ret = archive_write_set_format(arch_writer.data(), format_code);
++ if (ret != ARCHIVE_OK) {
++ emit error(i18nc("@info", "Setting the format failed with the following error: <message>%1</message>", QLatin1String(archive_error_string(arch_writer.data()))));
+ return false;
+ }
+-
++ int filter_code = archive_filter_code(arch_reader.data(), 0);
++ ret = archive_write_add_filter(arch_writer.data(), filter_code);
+ if (ret != ARCHIVE_OK) {
+ emit error(i18nc("@info", "Setting the compression method failed with the following error: <message>%1</message>", QLatin1String(archive_error_string(arch_writer.data()))));
+ return false;
+@@ -648,7 +617,7 @@
+ }
+
+ e[Size] = (qlonglong)archive_entry_size(aentry);
+- e[IsDirectory] = S_ISDIR(archive_entry_mode(aentry));
++ e[IsDirectory] = (archive_entry_filetype(aentry) == AE_IFDIR);
+
+ if (archive_entry_symlink(aentry)) {
+ e[Link] = QLatin1String( archive_entry_symlink(aentry) );
--
ark packaging
More information about the pkg-kde-commits
mailing list