Ark has a bug which needs quick fix.

Chandru chandru.in at gmail.com
Wed Jun 6 10:21:38 BST 2007


Hi,

I recently came across this bug and a possible solution for it.


When I open a .tar.gz archive with a complex directory structure within it
using ark and try to extract the contents I get two different behaviors
based on how I perform it.

1. If I do not select any of the files inside the archive and click on
extract button on the toolbar to extract, it does not give any problem.

2. However, if I select the top-most directory and click on extract button
on the toolbar to extract, it gives an error message but the files are
extracted properly.

I've found where the problem lies. The problem is caused due to the fact
that the tar program reports error when both a directory and its
files/subdirs are provided in the list of files to be extracted.

Consider the following directory structure inside the archive (test.tar.gz).

test
|
|-demo
  |
  |-index.html

Now executing the following command,

tar -xzf test.tar.gz test test/demo test/demo/index.html

would generate the following error,

tar: test/demo: Not found in archive
tar: test/demo/index.html: Not found in archive
tar: Error exit delayed from previous errors

This is exactly the problem generated by ark. There is no necessity to
include the children of the directory selected to be included in the list of
files to be extracted, as the contents of the directories specified get
extracted by default.

tar -xzf test.tar.gz test

would be sufficient. However, this is not true for other archive programs
like zip.

The problem at hand:

In the source code of ark, the "FileListView" class (inside filelistview.cpp)
contains the function "selectedFilenames()" which adds the children of the
selected directory also to the list of selected files. This when used by
"TarArch::unarchFileInternal()", causes the problem.

Solution:

This problem can be solved, if a piece of code is incorporated into
"FileListView::selectedFilenames()" to check the mime-type of the currently
opened archive and if it is a tar type, the children of the selected
directories should not be included in the list of selected files.

I hope this understanding would greatly help the developers in fixing the
problem soon. I'm very sorry that I'm not able to solve the problem myself
as I don't have the time to do fix it in the code.

The link to the bug report at launchpad is
https://bugs.launchpad.net/ubuntu/+source/kdeutils/+bug/114784

-- 
Bye Bye,
Chandru.

e-mail: chandru.in at gmail.com
Home Page: http://www.freewebs.com/onlinechandru/
Blog: http://tuxychandru.blogspot.com/

A computer is like air conditioning: it becomes useless when you open
windows.  --Linus Torvalds on Windows
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/kubuntu-devel/attachments/20070606/3c2d5413/attachment.htm 


More information about the kubuntu-devel mailing list