After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 777814 - xz files extract as original name/data instead of the original name
xz files extract as original name/data instead of the original name
Status: RESOLVED DUPLICATE of bug 777396
Product: nautilus
Classification: Core
Component: File and Folder Operations
3.22.x
Other Linux
: Normal minor
: 3.24
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-01-27 00:07 UTC by cooperedenday
Modified: 2017-04-20 20:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The result of double clicking on the $filename.xz file. (54.68 KB, image/png)
2017-01-27 00:07 UTC, cooperedenday
  Details
uncompression: different implementation for .xz (1.81 KB, patch)
2017-03-04 06:31 UTC, Vyas Giridhar
needs-work Details | Review

Description cooperedenday 2017-01-27 00:07:38 UTC
Created attachment 344370 [details]
The result of double clicking on the $filename.xz file.

Reddit post: https://www.reddit.com/r/gnome/comments/5qc8vf/gnomes_nautilus_untarring_when_it_should_just_be/

Uncompressing a $filename.xz file behaves like uncompressing a $filename.tar.xz file.
Comment 1 Carlos Soriano 2017-01-28 10:16:05 UTC
 I'm not sure I understand the problem. What do you expect? Uncompression of your compressed file no?
Comment 2 cooperedenday 2017-01-28 15:00:47 UTC
It uncompresses and untars, instead of just uncompressing. Did you see the redit post?
Comment 3 Carlos Soriano 2017-01-28 17:35:41 UTC
(In reply to cooperedenday from comment #2)
> It uncompresses and untars, instead of just uncompressing. Did you see the
> redit post?

No I didn't, please post the relevant information if any here in Bugzilla.

The pourpose is to create a folder with the relevant contents, whatever that means, if it means uncompressing and untar, then that's what it does.

Why do you want only uncompress and end up with a tar archive?
Comment 4 Ernestas Kulik 2017-01-28 17:55:20 UTC
I will interject here: what the reporter means by “untarring” is that the decompression behavior is the same for zipped tarballs and compressed files. In this case, it is a single compressed file, but a new directory is being created for it, which is not the desired behavior.
Comment 5 Carlos Soriano 2017-01-28 20:52:56 UTC
Ahh I though we were doing something smarter for that, thanks for the clarification.
Comment 6 cooperedenday 2017-01-29 18:48:23 UTC
(In reply to Ernestas Kulik from comment #4)
> I will interject here: what the reporter means by “untarring” is that the
> decompression behavior is the same for zipped tarballs and compressed files.
> In this case, it is a single compressed file, but a new directory is being
> created for it, which is not the desired behavior.

Yes, you are correct.
Comment 7 Vyas Giridhar 2017-03-04 06:31:24 UTC
Created attachment 347187 [details] [review]
uncompression: different implementation for .xz

Uncompressing a $filename.xz file behaves like uncompressing a
$filename.tar.xz file.

This patch provides a seperate extracting implementation for .xz files.
Comment 8 Vyas Giridhar 2017-03-04 06:33:25 UTC
I couldn't find a way to change the filename of the extracted folder.
Comment 9 Vyas Giridhar 2017-03-06 01:07:57 UTC
Can someone review this?
Comment 10 Carlos Soriano 2017-03-06 08:43:36 UTC
(In reply to Vyas Giridhar from comment #9)
> Can someone review this?

Hey, I'll review today.
Expect at least one/two days delay, even more if it's weekend :)
Comment 11 Carlos Soriano 2017-03-06 13:44:24 UTC
Review of attachment 347187 [details] [review]:

Hey, thanks for your work :)

The patch doesn't actually work, did you test it?

Also the fix should be in gnome-autoar and therefore this issue is gnome-autoar rather than nautilus, but we can move there and we can fix it together, you will understand the code easily.
I'll post some review details so you take it into account for fix.

::: src/nautilus-file-operations.c
@@ +8435,3 @@
     g_autofree guint64 *archive_compressed_sizes = NULL;
     gint i;
+    char* name;

use gchar. Also use g_autofree.

@@ +8480,3 @@
+        name = g_file_get_uri(G_FILE (l->data));
+
+        if (g_str_has_suffix (name,".xz"))

what about other extensions? also an .xz archive can exist with a different suffix. That's why we have the whole g_type_is_a etc (but this is managed by gnome-autoar, not us).

@@ +8490,3 @@
+
+        extractor = autoar_extractor_new (G_FILE (l->data),
+                                        extract_job->destination_directory);

You are overriding the previous extractor. This won't never work...
Comment 12 Vyas Giridhar 2017-03-06 15:17:23 UTC
This did work.

~/rust-dice-0.2.0-x86_64-unknown-linux-musl.xz > ~/data for some reason.

I too thought the problem was in gnome-autoar but the process flow was confusing after sometime.

Will look into it.
Comment 13 Vyas Giridhar 2017-03-08 02:23:00 UTC
(In reply to Carlos Soriano from comment #11)
> Review of attachment 347187 [details] [review] [review]:
> 
> Hey, thanks for your work :)
> 
> The patch doesn't actually work, did you test it?
> 
> Also the fix should be in gnome-autoar and therefore this issue is
> gnome-autoar rather than nautilus, but we can move there and we can fix it
> together, you will understand the code easily.
> I'll post some review details so you take it into account for fix.

I have created a patch at https://bugzilla.gnome.org/show_bug.cgi?id=777396
Comment 14 Carlos Soriano 2017-04-20 20:05:13 UTC

*** This bug has been marked as a duplicate of bug 777396 ***