Bug 253059 - Ark doesn't use symlinks anymore, instead copies the file into the archive
Summary: Ark doesn't use symlinks anymore, instead copies the file into the archive
Alias: None
Product: ark
Classification: Applications
Component: general (show other bugs)
Version: 2.15
Platform: Debian unstable Linux
: NOR normal
Target Milestone: ---
Assignee: Harald Hvaal
Depends on:
Reported: 2010-10-02 22:47 UTC by Janet
Modified: 2010-10-16 08:05 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description Janet 2010-10-02 22:47:08 UTC
Version:           2.15 (using KDE 4.5.1) 
OS:                Linux

I just wanted to compress a folder, which contains a lot of symlinks from one subfolder to other subfolders, as tar.gz with ark. But instead of compressing the 3 MiB directory preserving the symlinks it created a 5 MiB tar.gz which containes all former symlinks as files. There doesn't seem to be a way to turn that off. Really, I cannot upload those swollen archives anywhere, so I am forced to use the commandline tool tar/gzip.

I remember it was possible once, ark behaved like tar -cvzf, preserving the symlinks. Alas I don't know since when the change happend, maybe the size growth never was so obvious the last times I created archives.

Please add an option to toggle between preserving symlinks and resolving symlinks. IMHO symlinks always should be preserved when the symlinks point to files in the folder that is to be compressed. When I drag a folder onto ark which contains symlinks maybe ark could ask if I want to preserve them or resolve them? There should also be an according dolphin servicemenu.

Reproducible: Always

Steps to Reproduce:
Create a folder A which contains subfolder B. Put an additional file C into A and symlink C into B. Drag folder A into a new archive in ark. File C gets duplicated in the archive insteadt of staying a space saving symlink.

OS: Linux (i686) release 2.6.35-7.slh.1-aptosid-686
Compiler: cc
Comment 1 Tanja Schulte 2010-10-09 12:33:58 UTC
Same problem here with ark in Kubuntu. It was fine before the KDE 4.5 version, ark treated the symlinks as symlinks thus producing a lot smaller archives. I could accept that way when I pack as zip because a zip archive is more likely to go to a Windows computer. But tar.gz is a native linux format and linux is able to use symlinks so ark should respect that.
Comment 2 Raphael Kubo da Costa 2010-10-12 06:46:26 UTC
Are you sure this used to work fine? This is bug 180538, and the only thing that may have anything to do with this one too is bug 191821.
Comment 3 Raphael Kubo da Costa 2010-10-16 07:05:10 UTC
SVN commit 1186375 by rkcosta:

Manually call lstat() and pass the stat struct to libarchive.

archive_read_disk_entry_from_file() calls lstat() itself if it has
been compiled with HAVE_LSTAT and it is set not to follow
symlinks. These conditions do not always hold, so it is better to call
lstat() ourselves to make sure symlinks are not followed.

BUG: 253059

 M  +9 -1      libarchivehandler.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=1186375
Comment 4 Raphael Kubo da Costa 2010-10-16 08:05:38 UTC
SVN commit 1186377 by rkcosta:

Manually call lstat() and pass the stat struct to libarchive.

This is not a direct backport from r1186375 because the code is a bit
different on the 4.5 (we need to call readlink() and
archive_set_symlink() ourselves).

CCBUG: 253059
FIXED-IN: 4.5.3

 M  +22 -1     libarchivehandler.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=1186377