Skip Menu |

This queue is for tickets about the Archive-Tar CPAN distribution.

Report information
The Basics
Id: 72219
Status: new
Priority: 0/
Queue: Archive-Tar

Owner: Nobody in particular
Requestors: ONEGRAY [...]
oneingray [...]

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)

CC: Ivan Shmakov <oneingray [...]>
Subject: a ptarfilter (ptarmap, ptarsplit) application, please?
Date: Mon, 07 Nov 2011 01:43:28 +0700
To: bug-Archive-Tar [...]
From: Ivan Shmakov <oneingray [...]>
Download (untitled) / with headers
text/plain 1.6k
Occasionally, it's necessary to process each of the files in the archive with an arbitrary filter program. It'd be nice if Archive::Tar could contain a program allowing one to do just that. (Without unpacking the whole archive first, of course.) Possible usage example (assuming no archive member has a vertical line character as part of its filename): $ tar -C /bin/ -c -- bash dash \ | ptarmap -v -- bash -c 'sha1sum | sed -e "s|-|${FILE}|"' bash add19e504c254758f2ea8dcda3821c77fafb4923 bash dash 7f123974c1814d026a26e79981453881efb49916 dash $ I've posted a possible implementation to news:alt.sources recently [1], but I believe it requires some more polishing. (Check the Bugs list in its README.) BTW, given that a Tar archive could be viewed as a sequence of “sub-archives”, I see a lot of similarity between the command suggested and split(1) (especially its GNU incarnation.) Therefore, one might try to implement more sophisticated usage patterns, like: $ ptarsplit --member-bytes=1M -- my.tar my.x (no more than 1 MiB of data per each of the resulting Tar archives; unless there're individual members of larger size); $ ptarsplit --members=16 -- my.tar my.x (no more than 16 archive members per each of the resulting Tar archives; may be combined with --member-bytes=); $ ptarsplit --exec --members=1 --no-header --no-trailer \ -- bash -c 'sha1sum | sed -e "s|-|${FILE}|"' \ < my.tar (like [1]; perhaps a ptarmap wrapper, or a --map option, for this mode.) TIA. [1] -- FSF associate member #7257
Download (untitled)
application/pgp-signature 835b

Message body not shown because it is not plain text.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to