Bug 362690 - compress folder to tar.gz is not correct
Summary: compress folder to tar.gz is not correct
Status: RESOLVED FIXED
Alias: None
Product: ark
Classification: Applications
Component: general (other bugs)
Version First Reported In: 16.04.0
Platform: PCLinuxOS Linux
: NOR normal
Target Milestone: ---
Assignee: Elvis Angelaccio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-05 08:48 UTC by Texstar
Modified: 2016-05-05 21:10 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 16.04.1
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Texstar 2016-05-05 08:48:40 UTC
When selecting compress folder to tar.gz from dolphin using the ark_addtoservicemenu, the name of the tarball drops the last digit. As an example:

kid3-3.4.0 folder becomes kid3-3.4.tar.gz instead of kid3-3.4.0.tar.gz


Reproducible: Always
Comment 1 Elvis Angelaccio 2016-05-05 16:54:56 UTC
Confirming, thanks for the report.
Comment 2 Elvis Angelaccio 2016-05-05 17:16:35 UTC
The problem is in AddToArchive::detectBaseName().

We use QFileInfo::completeSuffix() on a path like "foo/test-3.4.0", which is why the last digit is dropped.
Comment 3 Elvis Angelaccio 2016-05-05 21:10:37 UTC
Git commit 846febf951f8a6d31a325ca4b3956afece68be01 by Elvis Angelaccio.
Committed on 05/05/2016 at 20:33.
Pushed by elvisangelaccio into branch 'Applications/16.04'.

addtoarchive: drop extension only when present

AddToArchive currently tries to drop the extension from any filename,
even if there is no extension in it. We now exploit the mimetype
detected-by-extension: if it's the default mimetype,
then the filename is just a string with some dots but no valid extension.
Otherwise the filename has an actual extension, which we discard.

A testcase is added to reproduce the issue.
FIXED-IN: 16.04.1

Differential Revision: D1541

M  +6    -0    autotests/kerfuffle/addtoarchivetest.cpp
A  +1    -0    autotests/kerfuffle/data/test-3.4.0/testfile1.txt
M  +7    -2    kerfuffle/addtoarchive.cpp

http://commits.kde.org/ark/846febf951f8a6d31a325ca4b3956afece68be01