diff --git a/file-roller-extract-sparse-file.patch b/file-roller-extract-sparse-file.patch new file mode 100644 index 0000000..ab944d5 --- /dev/null +++ b/file-roller-extract-sparse-file.patch @@ -0,0 +1,40 @@ +diff --git a/src/fr-archive-libarchive.c b/src/fr-archive-libarchive.c +index 9a11e45..83b9ade 100644 +--- a/src/fr-archive-libarchive.c ++++ b/src/fr-archive-libarchive.c +@@ -582,7 +582,7 @@ extract_archive_thread (GSimpleAsyncResult *result, + const char *relative_path; + GFile *file; + GFile *parent; +- GOutputStream *ostream; ++ struct archive *ext; + const void *buffer; + size_t buffer_size; + int64_t offset; +@@ -777,16 +777,21 @@ extract_archive_thread (GSimpleAsyncResult *result, + break; + + case AE_IFREG: +- ostream = (GOutputStream *) g_file_replace (file, NULL, FALSE, G_FILE_CREATE_REPLACE_DESTINATION, cancellable, &load_data->error); +- if (ostream == NULL) ++ ext = archive_write_disk_new(); ++ if (ext == NULL) + break; ++ archive_write_disk_set_options(ext, ARCHIVE_EXTRACT_TIME|ARCHIVE_EXTRACT_PERM|ARCHIVE_EXTRACT_ACL|ARCHIVE_EXTRACT_FFLAGS); ++ archive_write_disk_set_standard_lookup(ext); ++ archive_entry_set_pathname(entry, g_file_get_path(file)); ++ archive_write_header(ext, entry); + + while ((r = archive_read_data_block (a, &buffer, &buffer_size, &offset)) == ARCHIVE_OK) { +- if (g_output_stream_write (ostream, buffer, buffer_size, cancellable, &load_data->error) == -1) ++ if ((r = archive_write_data_block(ext, buffer, buffer_size, offset)) < ARCHIVE_OK) + break; + fr_archive_progress_inc_completed_bytes (load_data->archive, buffer_size); + } +- _g_object_unref (ostream); ++ archive_write_close(ext); ++ archive_write_free (ext); + + if (r != ARCHIVE_EOF) + load_data->error = _g_error_new_from_archive_error (archive_error_string (a)); + diff --git a/file-roller.changes b/file-roller.changes index 37d1a0e..82bd089 100644 --- a/file-roller.changes +++ b/file-roller.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Oct 24 12:06:25 UTC 2015 - zaitor@opensuse.org + +- Add patch: file-roller-extract-sparse-file.patch: Fix extraction + of sparse file (bsc#923449, bgo#747091). + ------------------------------------------------------------------- Tue Sep 1 11:12:54 UTC 2015 - zaitor@opensuse.org diff --git a/file-roller.spec b/file-roller.spec index 1c81e55..0914803 100644 --- a/file-roller.spec +++ b/file-roller.spec @@ -28,6 +28,8 @@ Source: http://download.gnome.org/sources/file-roller/3.16/%{name}-%{ver Patch0: file-roller-3.4-change-archiver-priority.patch # PATCH-FEATURE-OPENSUSE file-roller-pkg-match.patch bnc#696530 dimstar@opensuse.org -- List package match names for automatic installation using PK. Patch1: file-roller-pkg-match.patch +# PATCH-FIX-UPSTREAM file-roller-extract-sparse-file.patch bsc#923449 bgo#747091 tyang@suse.com -- file-roller does not extract file correctly +Patch2: file-roller-extract-sparse-file.patch # Needed for directory ownership BuildRequires: dbus-1 BuildRequires: fdupes @@ -98,6 +100,7 @@ This package contains a plugin to integrate File Roller into Nautilus. %setup -q %patch0 %patch1 -p1 +%patch2 -p1 translation-update-upstream %build