Skip Menu |

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

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

People
Owner: BINGOS [...] cpan.org
Requestors: lameventanas [...] gmail.com
Cc:
AdminCc:

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



Subject: Archive::Tar removes trailing '/' from directories
Date: Wed, 4 Feb 2015 18:39:04 +0900
To: bug-Archive-Tar [...] rt.cpan.org
From: Alan <lameventanas [...] gmail.com>
Archive::Tar removes the trailing '/' from directories, is there any way to prevent it? cd / mkdir tmp/testdir tar -czf /tmp/test-gnutar.tar.gz tmp/testdir/ perl -MArchive::Tar -e 'Archive::Tar->create_archive("/tmp/test-perl.tar.gz", COMPRESS_GZIP, "tmp/testdir/")' echo "GNU Tar result:" tar -tzf /tmp/test-gnutar.tar.gz echo echo "Archive::Tar result:" tar -tzf /tmp/test-perl.tar.gz The output is: GNU Tar result: tmp/testdir/ Archive::Tar result: tmp/testdir
On Wed Feb 04 04:39:19 2015, lameventanas@gmail.com wrote: Show quoted text
> Archive::Tar removes the trailing '/' from directories, is there any > way to prevent it? > > cd / > mkdir tmp/testdir > tar -czf /tmp/test-gnutar.tar.gz tmp/testdir/ > perl -MArchive::Tar -e > 'Archive::Tar->create_archive("/tmp/test-perl.tar.gz", COMPRESS_GZIP, > "tmp/testdir/")' > > echo "GNU Tar result:" > tar -tzf /tmp/test-gnutar.tar.gz > echo > echo "Archive::Tar result:" > tar -tzf /tmp/test-perl.tar.gz > > The output is: > > GNU Tar result: > tmp/testdir/ > > Archive::Tar result: > tmp/testdir
See also: https://rt.cpan.org/Ticket/Display.html?id=115160
On Thu Sep 29 10:50:48 2016, JKEENAN wrote: Show quoted text
> On Wed Feb 04 04:39:19 2015, lameventanas@gmail.com wrote:
> > Archive::Tar removes the trailing '/' from directories, is there any > > way to prevent it? > > > > cd / > > mkdir tmp/testdir > > tar -czf /tmp/test-gnutar.tar.gz tmp/testdir/ > > perl -MArchive::Tar -e > > 'Archive::Tar->create_archive("/tmp/test-perl.tar.gz", COMPRESS_GZIP, > > "tmp/testdir/")' > > > > echo "GNU Tar result:" > > tar -tzf /tmp/test-gnutar.tar.gz > > echo > > echo "Archive::Tar result:" > > tar -tzf /tmp/test-perl.tar.gz > > > > The output is: > > > > GNU Tar result: > > tmp/testdir/ > > > > Archive::Tar result: > > tmp/testdir
> > See also: https://rt.cpan.org/Ticket/Display.html?id=115160
Archive::Tar::create_archive() internally calls Archive::Tar::write(), which in turn internally calls helper method Archive::Tar::File::_prefix_and_file(), which is where the trailing slash is lopped off. As discussed in RT #115160, this is long-standing behavior, so changing it may break a lot of code in production. That's the Archive::Tar maintainers' call. But even if the behavior is unchanged, this peculiarity should be documented. Thank you very much. Jim Keenan
On Thu Sep 29 10:55:29 2016, JKEENAN wrote: Show quoted text
> On Thu Sep 29 10:50:48 2016, JKEENAN wrote:
> > On Wed Feb 04 04:39:19 2015, lameventanas@gmail.com wrote:
> > > Archive::Tar removes the trailing '/' from directories, is there > > > any > > > way to prevent it? > > > > > > cd / > > > mkdir tmp/testdir > > > tar -czf /tmp/test-gnutar.tar.gz tmp/testdir/ > > > perl -MArchive::Tar -e > > > 'Archive::Tar->create_archive("/tmp/test-perl.tar.gz", > > > COMPRESS_GZIP, > > > "tmp/testdir/")' > > > > > > echo "GNU Tar result:" > > > tar -tzf /tmp/test-gnutar.tar.gz > > > echo > > > echo "Archive::Tar result:" > > > tar -tzf /tmp/test-perl.tar.gz > > > > > > The output is: > > > > > > GNU Tar result: > > > tmp/testdir/ > > > > > > Archive::Tar result: > > > tmp/testdir
> > > > See also: https://rt.cpan.org/Ticket/Display.html?id=115160
> > Archive::Tar::create_archive() internally calls Archive::Tar::write(), > which in turn internally calls helper method > Archive::Tar::File::_prefix_and_file(), which is where the trailing > slash is lopped off. > > As discussed in RT #115160, this is long-standing behavior, so > changing it may break a lot of code in production. That's the > Archive::Tar maintainers' call. But even if the behavior is > unchanged, this peculiarity should be documented. > > Thank you very much. > Jim Keenan
I believe that this has been resolved. Closing.