Bug 365062 - compress to zip does a compress to gzip intead
Summary: compress to zip does a compress to gzip intead
Status: RESOLVED DUPLICATE of bug 340456
Alias: None
Product: ark
Classification: Applications
Component: general (show other bugs)
Version: 2.19
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Elvis Angelaccio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-04 08:34 UTC by Eric Forgeot
Modified: 2016-07-14 06:34 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
kerfuffle_libarchive_readonly.desktop (2.78 KB, application/x-desktop)
2016-07-12 21:53 UTC, Eric Forgeot
Details
kerfuffle_libarchive.desktop (5.55 KB, application/x-desktop)
2016-07-12 21:54 UTC, Eric Forgeot
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Forgeot 2016-07-04 08:34:24 UTC
When I right click a folder to zip it "compress to zip file", it get a folder.zip file.  But some people reported me they couldn't uncompress my file. I've checked with the "file" command and got this:

 gzip compressed data, from Unix, last modified: Mon Jul  4 10:22:21 2016

To uncompress it, we have to "gunzip folder.zip", then "tar xfv folder", which isn't expected behavior.




Reproducible: Always

Steps to Reproduce:
1.right click a folder to zip it "compress to zip file
2. get a "folder.zip" file
3. try to "unzip folder.zip" => "End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.". "file  folder.zip" reveals it's a gzip + tar file instead.



Actual Results:  
the folder.zip file is a gzip file but it's renamed a zip, not gz or tar.gz. It's misleading and not useful because there is already an option to compress to .tar.gz

Expected Results:  
the resulting folder.zip should be a zip compressed file, not a gzip file.


it behaves like this on linux mint 17.3.
Haven't tried on other distributions.
Comment 1 Elvis Angelaccio 2016-07-12 11:08:41 UTC
Moving to Ark.

Please locate the file ark_addtoservicemenu.desktop (which is installed by the Ark package) and post here its content.
Comment 2 Eric Forgeot 2016-07-12 19:03:48 UTC
Thank you for pointing me to the right desktop file.

I have this:

/usr/share/kde4/services/ServiceMenus/ark_addtoservicemenu.desktop

[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=all/all;
Actions=compressHere;compressAsZip;compressAsRar;compressAsTar;compressTo;
X-KDE-Submenu=Compress
/.../
Exec=ark --changetofirstpath --add --autofilename tar.gz %F
/.../
[Desktop Action compressAsZip]
Name=As ZIP Archive
Exec=ark --changetofirstpath --add --autofilename zip %F
/.../
Exec=ark --changetofirstpath --add --autofilename rar %F
Exec=ark --changetofirstpath --add --autofilename tar.gz %F
Exec=ark --add --changetofirstpath --dialog %F

If I try this from the command line:

ark --changetofirstpath --add --autofilename zip test

file test.zip 
test.zip: gzip compressed data, from Unix, last modified: Tue Jul 12 20:57:18 2016

yet zip is working correctly on my system:
zip -r test2.zip test

file test2.zip 
test2.zip: Zip archive data, at least v1.0 to extract

and ark handles well for example the 7z format:

ark --changetofirstpath --add --autofilename 7z test
file test.7z 
test.7z: 7-zip archive data, version 0.3
Comment 3 Eric Forgeot 2016-07-12 19:09:57 UTC
On another computer using the same Linux mint 17.3 I have this problem as well. On PC-BSD, with the same version of ark, it's working correctly, so I assume it's a problem with Linux Mint or Ubuntu or Debian...
Comment 4 Elvis Angelaccio 2016-07-12 19:16:37 UTC
Can you also show the files kerfuffle_libarchive.desktop and kerfuffle_libarchive_readonly.desktop?
Debian used to edit one of them to add zip support, this could explain your problem.
Comment 5 Eric Forgeot 2016-07-12 21:53:17 UTC
Created attachment 100047 [details]
kerfuffle_libarchive_readonly.desktop
Comment 6 Eric Forgeot 2016-07-12 21:54:00 UTC
Created attachment 100048 [details]
kerfuffle_libarchive.desktop

here are they
Comment 7 Rog131 2016-07-13 06:41:03 UTC
This sounds like the Ubuntu bug: Ark fails to produce zip archive instead making gzip with the zip suffix - https://bugs.launchpad.net/ubuntu/+source/ark/+bug/1388532

i.e

back then:
'The Ubuntu package has a patch 'use_libarchive_for_zip_files'. When compiling the Ark without the patch the Ark is compressing to the .zip format.'
Comment 8 Elvis Angelaccio 2016-07-13 09:21:31 UTC
(In reply to Rog131 from comment #7)
> This sounds like the Ubuntu bug: Ark fails to produce zip archive instead
> making gzip with the zip suffix -
> https://bugs.launchpad.net/ubuntu/+source/ark/+bug/1388532

Yes, definitely.

Eric, as a workaround you can manually edit your kerfuffle_libarchive.desktop and remove the string "application/zip;" from the MimeType line. Also, make sure that the line ends with a semicolon.

*** This bug has been marked as a duplicate of bug 340456 ***
Comment 9 Eric Forgeot 2016-07-14 06:34:35 UTC
ah, I hadn't found this bug elsewhere. Thank you for the pointer and the tips. 

It's definitively a Debian/Ubuntu bug. I don't know why they always want so much to "patch" upstream software and add some bugs in them :(