Hi Cees,
On Oct 21, 2009, at 2:23 AM, Cees Hek via RT wrote:
Show quoted text> I kept getting reports from users that they could not open my tarballs
> on sun boxes that didn't have a gnu version of tar running on it
> (
https://rt.cpan.org/Ticket/Display.html?id=23705). So I tried to tar
> up the file using an older method, in this case with the --posix
> flag to
> tar.
>
> I am not at the same computer right now so I can't look at my command
> history but I believe I ran it like this:
>
> tar czvf CGI-Application-Plugin-Authentication-0.14.tar.gz --posix
> CGI-Application-Plugin-Authentication-0.14
>
> This was on a Ubuntu 9.04 box
>
> tar --version
> tar (GNU tar) 1.20
>
> gzip --version
> gzip 1.3.12
>
>
> If you know of a better way to tar up the disto so that it is
> compatible
> with older non-Gnu unixes I would really appreciate some help with
> that.
Take a look at the archive::tar faq here, particularly the one about
winzip
or other non-posix clients and the use of the PREFIX header:
http://search.cpan.org/~bingos/Archive-Tar-1.54/lib/Archive/Tar.pm#
$Archive::Tar::DO_NOT_USE_PREFIX
http://search.cpan.org/~bingos/Archive-Tar-1.54/lib/Archive/
Tar.pm#FAQ
Basically, there's 3 different implementations of supporting file names
greater than 100 characters:
1) Posix' PREFIX header (supports paths up to 255)
2) GNU's Extended Header feature (a @LongLink entry in the archive)
3) Pax' use of the pax header (a PaxHeader entry in the archive)
From what we've gathered in the wild and on documentations, some
support
eachothers formats and all in varying degrees of backwards
compatibility:
Posix seems to support 1 & 3
Gnu seems to support 1 & 2
The safe way is the use of 1), which is archive tar's default, but it
does limit
support for older gnu tars (1.13 and before wont work).
In practice this means you're best of writing archives in Posix
compatible format
(which with the --posix flag for gnutar seems to be format 3, not 1).
The perl tar
program that comes with Archive::Tar however will do exactly that
(it's built for
portability), so you could use that instead:
* Install the latest Archive::Tar from CPAN
* And then create the tar file like you normally would, but with
ptar instead:
$ ptar -czvf CGI-Application-Plugin-Authentication-0.14.tar.gz
CGI-Application-Plugin-Authentication-0.14
* You can then verify that both gnu tar & posix tar extract this
archive correctly
I know it's a hassle, but it's one of the only ways we've found to
support archives
which contains files with paths > 100 characters. It's a mess out
there :(
Let me know how it goes,
--
Jos Boumans
'Real programmers use "cat > a.out"'