On 22/10/2015 17:00, Reuti wrote:
Am 22.10.2015 um 16:37 schrieb Reuti <[email protected]>:

Tony:

Am 21.10.2015 um 14:30 schrieb Tony Olekshy <[email protected]>:

Tony Olekshy wrote, on 2015-10-20 at 19:20 MDT:
Hello.

I'm having trouble understanding why I can't pipe the output of a
tar -tzf a.tgz ... through to a tar -xzf a.tgz --files=from=- ...
without producing what appear to be spurious messages. In practice
I want to place a filter in that pipeline to select just what to
extract, but the following script simplifies that out to just show
the problem I'm encountering.
Reuti wrote, on 2015-10-21 at 04:32 MDT:
Accessing "." in the archive will move its pointer already to
the end:

$ echo . | tar tf archive.tgz --files-from=-
./
./foo/
./foo/bar
Reuti wrote, on 2015-10-21 at 05:10 MDT:
Ah, although I missed the --no-recursion at the first glance: its
position is important. It must appear before the --files-from=- in
your case.
Perfect, that did it. The attached script with the --no-recursion
placed before the --files-from=- does exactly what I'm looking for,
and I've tested it with a filter between the tar -t and the tar -x
(a simple head -2 works for this testing), and it all works well.

Thank you very much for you assistance with this matter, Reuti. Now
I understand the difference between tar's globally scoped options &
those that only apply to succeeding arguments.
A short question: did you test your script also with 1.28? While it is working 
in 1.26 now, I get the impression that in 1.28:

1) --files-from must be an exact match, hence --no-recursion has no meaning for 
it now

2) Due to 1), plain directories can't be extracted with --files-from any 
longer, only on the command line:
Aha, while you can extract "./" or "./foo/" on the command line, only a plain "." or 
"./foo" is allowed in the --files-from=. Nevertheless will the --list append the / for a directory in the 
output again.

As another tar user, I would consider this a clear bug,
the file list parser should accept the same use of
trailing slashes as all the other parts of the program.



Enjoy

Jakob
--
Jakob Bohm, CIO, Partner, WiseMo A/S.  https://www.wisemo.com
Transformervej 29, 2860 Søborg, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded

Reply via email to