Skip to content

Commit

Permalink
Update Archive-Tar to CPAN version 2.40
Browse files Browse the repository at this point in the history
[DELTA]

2.40  27/07/2021 (KHW && ATOOMIC)
- Generalize for EBCDIC
- Update GitHub workflow with deprecated add-path
  • Loading branch information
bingos committed Jul 27, 2021
1 parent 0f43d40 commit fbc4132
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Porting/Maintainers.pl
Expand Up @@ -123,7 +123,7 @@ package Maintainers;
%Modules = (

'Archive::Tar' => {
'DISTRIBUTION' => 'BINGOS/Archive-Tar-2.38.tar.gz',
'DISTRIBUTION' => 'BINGOS/Archive-Tar-2.40.tar.gz',
'FILES' => q[cpan/Archive-Tar],
'BUGS' => 'bug-archive-tar@rt.cpan.org',
'EXCLUDED' => [
Expand Down
2 changes: 1 addition & 1 deletion cpan/Archive-Tar/lib/Archive/Tar.pm
Expand Up @@ -31,7 +31,7 @@ use vars qw[$DEBUG $error $VERSION $WARN $FOLLOW_SYMLINK $CHOWN $CHMOD
$DEBUG = 0;
$WARN = 1;
$FOLLOW_SYMLINK = 0;
$VERSION = "2.38";
$VERSION = "2.40";
$CHOWN = 1;
$CHMOD = 1;
$SAME_PERMISSIONS = $> == 0 ? 1 : 0;
Expand Down
7 changes: 5 additions & 2 deletions cpan/Archive-Tar/lib/Archive/Tar/Constant.pm
Expand Up @@ -8,7 +8,7 @@ use vars qw[$VERSION @ISA @EXPORT];
BEGIN {
require Exporter;

$VERSION = '2.38';
$VERSION = '2.40';
@ISA = qw[Exporter];

require Time::Local if $^O eq "MacOS";
Expand Down Expand Up @@ -88,7 +88,10 @@ use constant XZ => do { !$ENV{'PERL5_AT_NO_XZ'} and
};

use constant GZIP_MAGIC_NUM => qr/^(?:\037\213|\037\235)/;
use constant BZIP_MAGIC_NUM => qr/^BZh\d/;

# ASCII: B Z h 0 9
use constant BZIP_MAGIC_NUM => qr/^\x42\x5A\x68[\x30-\x39]/;

use constant XZ_MAGIC_NUM => qr/^\xFD\x37\x7A\x58\x5A\x00/;

use constant CAN_CHOWN => sub { ($> == 0 and $^O ne "MacOS" and $^O ne "MSWin32") };
Expand Down
2 changes: 1 addition & 1 deletion cpan/Archive-Tar/lib/Archive/Tar/File.pm
Expand Up @@ -11,7 +11,7 @@ use Archive::Tar::Constant;

use vars qw[@ISA $VERSION];
#@ISA = qw[Archive::Tar];
$VERSION = '2.38';
$VERSION = '2.40';

### set value to 1 to oct() it during the unpack ###

Expand Down
41 changes: 33 additions & 8 deletions cpan/Archive-Tar/t/02_methods.t
Expand Up @@ -165,11 +165,21 @@ chmod 0644, $COMPRESS_FILE;
}
}

my $ebcdic_skip_msg = "File contains an alien character set";

### read tests ###
{ my @to_try = ($TAR_FILE);
push @to_try, $TGZ_FILE if $Class->has_zlib_support;
push @to_try, $TBZ_FILE if $Class->has_bzip2_support;
push @to_try, $TXZ_FILE if $Class->has_xz_support;
SKIP: {
my @to_try;

if (ord 'A' == 65) {
push @to_try, $TAR_FILE;
push @to_try, $TGZ_FILE if $Class->has_zlib_support;
push @to_try, $TBZ_FILE if $Class->has_bzip2_support;
push @to_try, $TXZ_FILE if $Class->has_xz_support;
}
else {
skip $ebcdic_skip_msg, 4;
}

for my $type( @to_try ) {

Expand Down Expand Up @@ -352,7 +362,11 @@ chmod 0644, $COMPRESS_FILE;
}

### rename/replace_content tests ###
{ my $tar = $Class->new;

SKIP: {
skip $ebcdic_skip_msg, 9 if ord "A" != 65;

my $tar = $Class->new;
my $from = 'c';
my $to = 'e';

Expand Down Expand Up @@ -383,7 +397,10 @@ chmod 0644, $COMPRESS_FILE;
}

### remove tests ###
{ my $remove = 'c';
SKIP: {
skip $ebcdic_skip_msg, 3 if ord "A" != 65;

my $remove = 'c';
my $tar = $Class->new;

ok( $tar->read( $TAR_FILE ), "Read in '$TAR_FILE'" );
Expand All @@ -399,6 +416,8 @@ chmod 0644, $COMPRESS_FILE;

### write + read + extract tests ###
SKIP: { ### pesky warnings
skip $ebcdic_skip_msg, 326 if ord "A" != 65;

skip('no IO::String', 326) if !$Archive::Tar::HAS_PERLIO &&
!$Archive::Tar::HAS_PERLIO &&
!$Archive::Tar::HAS_IO_STRING &&
Expand Down Expand Up @@ -508,7 +527,10 @@ SKIP: { ### pesky warnings


### limited read + extract tests ###
{ my $tar = $Class->new;
SKIP: { ### pesky warnings
skip $ebcdic_skip_msg, 8 if ord "A" != 65;

my $tar = $Class->new;
my @files = $tar->read( $TAR_FILE, 0, { limit => 1 } );
my $obj = $files[0];

Expand Down Expand Up @@ -549,7 +571,10 @@ SKIP: { ### pesky warnings


### clear tests ###
{ my $tar = $Class->new;
SKIP: { ### pesky warnings
skip $ebcdic_skip_msg, 3 if ord "A" != 65;

my $tar = $Class->new;
my @files = $tar->read( $TAR_FILE );

my $cnt = $tar->list_files();
Expand Down
5 changes: 4 additions & 1 deletion cpan/Archive-Tar/t/04_resolved_issues.t
Expand Up @@ -157,7 +157,10 @@ use_ok( $FileClass );
### bug #43513: [PATCH] Accept wrong checksums from SunOS and HP-UX tar
### like GNU tar does. See here for details:
### http://www.gnu.org/software/tar/manual/tar.html#SEC139
{ ok( 1, "Testing bug 43513" );
SKIP: {
skip "File contains an alien character set", 5 if ord "A" != 65;

ok( 1, "Testing bug 43513" );

my $src = File::Spec->catfile( qw[src header signed.tar] );
my $tar = $Class->new;
Expand Down
6 changes: 5 additions & 1 deletion cpan/Archive-Tar/t/05_iter.t
@@ -1,9 +1,11 @@
BEGIN { chdir 't' if -d 't' }

use Test::More 'no_plan';
use Test::More;
use strict;
use lib '../lib';

plan skip_all => "File contains an alien character set" if ord "A" != 65;

my $Class = 'Archive::Tar';
my $FClass = 'Archive::Tar::File';
my $File = 'src/long/bar.tar';
Expand Down Expand Up @@ -63,3 +65,5 @@ for my $index ( \0, 0 .. $#Expect ) {
$dotest->("all");
}
}

done_testing;
2 changes: 2 additions & 0 deletions cpan/Archive-Tar/t/09_roundtrip.t
Expand Up @@ -4,6 +4,8 @@ use Test::More;
use strict;
use lib '../lib';

plan skip_all => "Files contain an alien character set" if ord "A" != 65;

use File::Spec ();
use File::Temp qw( tempfile );

Expand Down

0 comments on commit fbc4132

Please sign in to comment.