Skip Menu |

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

Report information
The Basics
Id: 17413
Status: resolved
Priority: 0/
Queue: Archive-Tar

People
Owner: Nobody in particular
Requestors: DAMI [...] cpan.org
Cc:
AdminCc:

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



Subject: No pathnames (prefixes) in tarfile (Windows XP, perl 5.8.7)
On my machine (Windows XP, perl 5.8.7), tarfiles created by Archive::Tar 1.28 have no pathnames (no 'prefixes'). Here is an example code : use Archive::Tar; my $tar = Archive::Tar->new; $tar->add_files('Do/doAll.pl', 'Do/tst1.pl', 'Par/hello.pl'); $tar->write('foo.tar'); The "Do" and "Par" directory names are not in the resulting archive.
On Wed Feb 01 09:23:40 2006, DAMI wrote: Show quoted text
> On my machine (Windows XP, perl 5.8.7), tarfiles created by > Archive::Tar 1.28 have no pathnames (no 'prefixes'). Here is an > example code : > > use Archive::Tar; > my $tar = Archive::Tar->new; > $tar->add_files('Do/doAll.pl', 'Do/tst1.pl', 'Par/hello.pl'); > $tar->write('foo.tar'); > > The "Do" and "Par" directory names are not in the resulting archive.
Using your example, i'm unable to reproduce the problem you've reported. This is on a win 2003 server machine, with AS perl 5.8.6 and archive::tar 1.28: J:\users\kane\tmp>cat x.pl use Archive::Tar; my $tar = Archive::Tar->new; $tar->add_files( @ARGV ); $tar->write('out.tar'); J:\users\kane\tmp>perl -I Archive-Tar-1.28\lib x.pl inc\a inc\b inc2\c J:\users\kane\tmp>tar -tf out.tar tar: Record size = 5 blocks inc\\a inc\\b inc2\\c Am i missing something in your description, or do you do something different than what i'm doing? Might it be the forward slashes instead of backslashes you're using?
Show quoted text
> Using your example, i'm unable to reproduce the problem you've > reported. > This is on a win 2003 server machine, with AS perl 5.8.6 and > archive::tar 1.28: > > Am i missing something in your description, or do you do something > different > than what i'm doing? Might it be the forward slashes instead of > backslashes you're using?
Hi, thanks for the answer. Actually a colleague of mine also says he cannot reproduce the problem. Yet in my environment the problem is still there (I tried both forward and backward slashes). Maybe something with env. variables? I started digging into the debugger to understand what is going on, but no success so far.
On Wed Mar 08 03:15:53 2006, DAMI wrote: Show quoted text
> Hi, thanks for the answer. Actually a colleague of mine also says he > cannot reproduce the problem. Yet in my environment the problem is > still there (I tried both forward and backward slashes). Maybe > something with env. variables? I started digging into the debugger to > understand what is going on, but no success so far.
Archive::Tar doesn't use any environment variables internally, and from here on i'd be stabbing in the dark as well. Maybe a comparison with your colleague of perl versions, OS, and versions of perl modules yields something. Oh, and the obvious comes to mind: you're not using cygwin or mingw (or have any of those tools in your path)? Good luck,
From: DAMI
Le Jeu. Mar. 23 07:19:34 2006, KANE a écrit : Show quoted text
> Oh, and the obvious comes to mind: you're not using cygwin or mingw > (or > have any of those tools in your path)? >
I don't really understand your "obvious". Is there any interaction between Archive::Tar and cygwin ? Didn't find any while looking at the code. Yes, I do use cygwin and have it in my path ... and it works well ! So if I write "perl Build dist tar=c:/cygwin/tar gzip=c:/cygwin/gzip", everything is OK. On the other hand, if I just write "perl Build dist", then Build uses the internal Archive::tar and my distribution has no pathnames.
On Mon Mar 27 07:28:27 2006, DAMI wrote: Show quoted text
> Le Jeu. Mar. 23 07:19:34 2006, KANE a écrit : >
> > Oh, and the obvious comes to mind: you're not using cygwin or mingw > > (or > > have any of those tools in your path)? > >
> > I don't really understand your "obvious". Is there any interaction > between Archive::Tar and cygwin ? Didn't find any while looking at the > code. > > Yes, I do use cygwin and have it in my path ... and it works well ! So > if I write "perl Build dist tar=c:/cygwin/tar gzip=c:/cygwin/gzip", > everything is OK. On the other hand, if I just write "perl Build > dist", then Build uses the internal Archive::tar and my distribution > has no pathnames.
cygwin uses unix style dir seperators (/) while windows uses \.. this might be interacting with eachother in an 'odd' way... same you will find when you use cygwin's make outside of cygwin, and things like that. Try it without cygwin in your path, it might make a difference.
From: steve.kirkup [...] dss.virginia.gov
On Fri Mar 31 02:42:38 2006, KANE wrote: Show quoted text
> On Mon Mar 27 07:28:27 2006, DAMI wrote:
> > Yes, I do use cygwin and have it in my path ... and it works well ! So > > if I write "perl Build dist tar=c:/cygwin/tar gzip=c:/cygwin/gzip", > > everything is OK. On the other hand, if I just write "perl Build > > dist", then Build uses the internal Archive::tar and my distribution > > has no pathnames.
> > cygwin uses unix style dir seperators (/) while windows uses \.. this
might Show quoted text
> be interacting with eachother in an 'odd' way... same you will find
when you Show quoted text
> use cygwin's make outside of cygwin, and things like that. > > Try it without cygwin in your path, it might make a difference.
I also want to confirm this problem. I am using Windows XP, with ActivePerl version 5.8.8 Build 817. Archive::Tar 1.29, no cygwin. When I do a 'perl Build dist' it will create a tarball with no directory paths, This is what is being passed to Archive::Tar->create_archive. Using Archive::Tar ( "SGK-Test-0.01", "SGK-Test-0.01/Build.PL", "SGK-Test-0.01/Changes", "SGK-Test-0.01/MANIFEST", "SGK-Test-0.01/META.yml", "SGK-Test-0.01/README", "SGK-Test-0.01/lib", "SGK-Test-0.01/lib/SGK", "SGK-Test-0.01/lib/SGK/Test.pm", "SGK-Test-0.01/t", "SGK-Test-0.01/t/00-load.t", "SGK-Test-0.01/t/boilerplate.t", "SGK-Test-0.01/t/pod-coverage.t", "SGK-Test-0.01/t/pod.t", ); I also encountered this problem recently on my computer at home as well. So it is not just a one off machine that is a problem.
From: barborak [...] basikgroup.com
I also have seen this problem... perhaps. I say "perhaps" because when I don't see the prefixes is when I am using WinZip or gnuwin32's tar to look at the resultant tar file. If I use Archive::Tar to extract the tar, the paths are there. The fix for me to create more compatible archives was to set the DO_NOT_USE_PREFIX package variable to 1 prior to creating the archive like this: require Archive::Tar; $Archive::Tar::DO_NOT_USE_PREFIX = 1; my $tar = Archive::Tar->new ( ); ... Could this be the problem that people are reporting? Mike
Show quoted text
> require Archive::Tar; > $Archive::Tar::DO_NOT_USE_PREFIX = 1; > my $tar = Archive::Tar->new ( ); > ... > > Could this be the problem that people are reporting?
I think so yes. I've applied an even more extensive doc patch in the FAQ section explaining this behaviour (it's GNU vs POSIX formats of tar), how you can work with/around this and links to external reading in the hope it will clear up this issue. You can find all this in the 1.30 release of Archive::Tar, which is now propagating itself around CPAN.