Bug 345795 - GNU tar --occurrence not supported
Summary: GNU tar --occurrence not supported
Status: CONFIRMED
Alias: None
Product: ark
Classification: Applications
Component: plugins (other bugs)
Version First Reported In: 2.18
Platform: Other Linux
: LO wishlist
Target Milestone: ---
Assignee: Ragnar Thomsen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-02 10:05 UTC by Germano Massullo (Thetra)
Modified: 2016-10-23 10:11 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Germano Massullo (Thetra) 2015-04-02 10:05:21 UTC
+++ This bug was initially created as a clone of Bug https://bugzilla.redhat.com/show_bug.cgi?id=1208210 +++

Description of problem:
file-roller extracts the first occurrence when there are more files with the same name, even if the user selects the second one.

Version-Release number of selected component (if applicable):
$ rpm -q file-roller
file-roller-3.14.2-1.fc21.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. $ (for t in {1..2}; do date +%s.%N > timestamp.txt; tar --append --file=timestamps.tar timestamp.txt; done; rm timestamp.txt)
2. $ file-roller timestamps.tar
3. Open the first timestamp.txt
4. Open the second timestamp.txt

Actual results:
The same file is extracted (the first occurrence, the oldest one).

Expected results:
Different files should be extracted.

Additional info:
GNU tar supports selecting different files with the same filename using --occurrence[=N]:
$ tar --extract --occurrence=1 --file timestamps.tar timestamp.txt --to-stdout
1427904999.696609031
$ tar --extract --occurrence=2 --file timestamps.tar timestamp.txt --to-stdout

--- Additional comment from Francesco Frassinelli on 2015-04-01 14:48:51 EDT ---

There are many problems related:
1. I'm unable to delete multiple files with the same name (it always remove just the first occurrence)
2. It can delete the wrong file (it doesn't matter what I've selected)

Reproducible: Always
Comment 1 Germano Massullo (Thetra) 2015-04-02 10:05:53 UTC
Fedora Ark's bugreport
https://bugzilla.redhat.com/show_bug.cgi?id=1208450
Comment 2 Elvis Angelaccio 2015-10-27 12:00:08 UTC
Hi Germano, is this the report you mentioned me? :)

Btw, please note that Ark does not use tar directly, but relies on libarchive for tar archives.
I will investigate whether libarchive has something equivalent to the --occurrence switch of tar.
Comment 3 Germano Massullo (Thetra) 2015-10-27 12:58:27 UTC
(In reply to Elvis Angelaccio from comment #2)
> Hi Germano, is this the report you mentioned me? :)
Yes exactly :-)
> Btw, please note that Ark does not use tar directly, but relies on
> libarchive for tar archives.
> I will investigate whether libarchive has something equivalent to the
> --occurrence switch of tar.
Thank you very much
Comment 4 Germano Massullo (Thetra) 2016-10-08 10:28:41 UTC
Hi, are there any news?