Skip Menu |

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

Report information
The Basics
Id: 66048
Status: resolved
Priority: 0/
Queue: Archive-Builder

People
Owner: Nobody in particular
Requestors: tskrainar [...] gmail.com
Cc:
AdminCc:

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



Subject: Executable bit on files not propagated when creating Archives
When adding files to an Archive::Tar (or ::Zip) object in Archive::Builder::Archive::_tar (or ::_zip), the 'executable' property of the Archive::Builder::File object is not propagated to the underlying Archive::Tar::File (or Archive::Zip::Member) object. This can be fixed by modifying the _tar() method as such: -------------------------------------------------------- use constant UNIX_EXECUTABLE_MODE => 0755; # [...] sub _tar { # [...] # Add each file to it foreach my $path ( $self->sorted_files ) { my $file = $self->{files}->{$path}; my $file_object = $Archive->add_data( $path, ${ $file->contents } ); if( $file->{executable} ) { $file_object->mode( UNIX_EXECUTABLE_MODE ); } } -------------------------------------------------------- The _zip() method also suffers from this issue, and is fixed similarly: -------------------------------------------------------- sub _zip { # [...] # Add each file to it foreach my $path ( keys %{ $self->{files} } ) { my $file = $self->{files}->{$path}; my $member = $Archive->addString( ${ $file->contents }, $path ); $member->desiredCompressionMethod( Archive::Zip::COMPRESSION_DEFLATED() ); if( $file->{executable} ) { $member->unixFileAttributes( UNIX_EXECUTABLE_MODE ); } } --------------------------------------------------------
Files added to tarballs and zips have been changed to use 0644 mode by default (instead of writing world-writable files) or 0755 in the case of files with the executable flag on. Released as 1.16