[gnome-autoar] uncompressing-.xz: use archive name for .xz files



commit 1c4fb9f566936087800f9ccb69301b6522fe6bed
Author: vyasgiridhar <vyasgiridhar27 gmail com>
Date:   Tue Mar 7 22:48:46 2017 +0530

    uncompressing-.xz: use archive name for .xz files
    
    .xz files extract as original name/data instead of the original name
    libarchive returns a single entry called 'data' when raw format is used.
    This causes AutoarExtractor to create an unnecessary directory and put
    the decompressed file in it.
    
    This patch checks the entry and sets the resulting filename to the
    source file.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=777396

 gnome-autoar/autoar-extractor.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/gnome-autoar/autoar-extractor.c b/gnome-autoar/autoar-extractor.c
index 043054f..97dd75d 100644
--- a/gnome-autoar/autoar-extractor.c
+++ b/gnome-autoar/autoar-extractor.c
@@ -1592,10 +1592,15 @@ autoar_extractor_step_scan_toplevel (AutoarExtractor *self)
       break;
     }
 
-    pathname = archive_entry_pathname (entry);
-    g_debug ("autoar_extractor_step_scan_toplevel: %d: pathname = %s",
-             self->total_files, pathname);
-
+    if (self->use_raw_format) {
+      pathname = autoar_common_get_basename_remove_extension (g_file_get_path(self->source_file));
+      g_debug ("autoar_extractor_step_scan_toplevel: %d: raw pathname = %s",
+               self->total_files, pathname);
+    } else {
+      pathname = archive_entry_pathname (entry);
+      g_debug ("autoar_extractor_step_scan_toplevel: %d: pathname = %s",
+               self->total_files, pathname);
+    }
     self->files_list =
       g_list_prepend (self->files_list,
                       g_file_get_child (self->output_file, pathname));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]