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 771018 - batch rename not acting right with extensions like tar.xz
batch rename not acting right with extensions like tar.xz
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: File and Folder Operations
3.21.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-09-07 16:54 UTC by Mohammed Sadiq
Modified: 2016-09-08 18:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
eel-vfs-extensions: Update filename extensions (1.15 KB, patch)
2016-09-08 07:52 UTC, Alexandru Pandelea
committed Details | Review

Description Mohammed Sadiq 2016-09-07 16:54:44 UTC
When the file extension have more than one period (Eg: .tar.bz, .tar.xz), batch rename fails to work the right way:

How to reproduce:
1. Create some files
   touch test.tar.xz test.tar.bz
2. Select the files -> rename
4. Select "[Original file name][1, 2, 3]" (or something)
5. The file get renamed to test.tar1.xz and test.tar2.bz
   It should be test1.tar.xz and test2.tar.bz.
(test.tar.gz and test.tar.bz2 works right)
Comment 1 Carlos Soriano 2016-09-08 07:42:12 UTC
A extension cannot have more than one period. The extension of those archives are .bz and .xz respectively. The .tar part is meaningless until uncompressed the first extension.

We could special case those, but where are we going to stop? :/ I guess .tar.whatever is known enough in Linux to special case...
Comment 2 Alexandru Pandelea 2016-09-08 07:52:05 UTC
Created attachment 335068 [details] [review]
eel-vfs-extensions: Update filename extensions

If a file had the extensions .tar.bz or .tar.xz, the function
eel_filename_get_extension_offset would identify only .bz or .xz as
an extension.

To fix this, .xz and .bz were added among the other special cases.
Comment 3 Carlos Soriano 2016-09-08 08:02:50 UTC
Review of attachment 335068 [details] [review]:

oh so we were special casing some :) looks good, thanks Alex!! You are on a strike
Comment 4 Alexandru Pandelea 2016-09-08 18:54:40 UTC
Attachment 335068 [details] pushed as 0b6a058 - eel-vfs-extensions: Update filename extensions