Hello community,

here is the log from the commit of package perl-Archive-Tar-Wrapper for 
openSUSE:Factory checked in at 2019-04-14 12:23:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Archive-Tar-Wrapper (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Archive-Tar-Wrapper.new.27019 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Archive-Tar-Wrapper"

Sun Apr 14 12:23:11 2019 rev:6 rq:693746 version:0.36

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/perl-Archive-Tar-Wrapper/perl-Archive-Tar-Wrapper.changes
        2019-04-08 10:40:27.795297286 +0200
+++ 
/work/SRC/openSUSE:Factory/.perl-Archive-Tar-Wrapper.new.27019/perl-Archive-Tar-Wrapper.changes
     2019-04-14 12:23:13.543818959 +0200
@@ -1,0 +2,13 @@
+Fri Apr 12 05:03:51 UTC 2019 - Stephan Kulow <[email protected]>
+
+- updated to 0.36
+   see /usr/share/doc/packages/perl-Archive-Tar-Wrapper/Changes
+
+  0.36 (2019/04/11):
+      Bug fixes since tests on Windows were failing after latests changes.
+      Refactored code due unexpected way bsdtar on Windows and tar on OpenBSD 
behave.
+      Refactored the tests due the bugs found.
+      Small fixes on Pod, specially the section for MS Windows users.
+      Added the missing tests to the MANIFEST.
+
+-------------------------------------------------------------------

Old:
----
  Archive-Tar-Wrapper-0.35.tar.gz

New:
----
  Archive-Tar-Wrapper-0.36.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Archive-Tar-Wrapper.spec ++++++
--- /var/tmp/diff_new_pack.HThZ8d/_old  2019-04-14 12:23:14.079819602 +0200
+++ /var/tmp/diff_new_pack.HThZ8d/_new  2019-04-14 12:23:14.083819606 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           perl-Archive-Tar-Wrapper
-Version:        0.35
+Version:        0.36
 Release:        0
 #Upstream: GPL-1.0-or-later
 %define cpan_name Archive-Tar-Wrapper

++++++ Archive-Tar-Wrapper-0.35.tar.gz -> Archive-Tar-Wrapper-0.36.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Archive-Tar-Wrapper-0.35/Changes 
new/Archive-Tar-Wrapper-0.36/Changes
--- old/Archive-Tar-Wrapper-0.35/Changes        2019-04-06 03:09:37.000000000 
+0200
+++ new/Archive-Tar-Wrapper-0.36/Changes        2019-04-12 00:29:52.000000000 
+0200
@@ -1,6 +1,13 @@
 ######################################################################
 Revision history for Perl extension Archive::Tar::Wrapper
 
+0.36 (2019/04/11):
+    Bug fixes since tests on Windows were failing after latests changes.
+    Refactored code due unexpected way bsdtar on Windows and tar on OpenBSD 
behave.
+    Refactored the tests due the bugs found.
+    Small fixes on Pod, specially the section for MS Windows users.
+    Added the missing tests to the MANIFEST.
+
 0.35 (2019/04/05):
     Added _rem_dots method, a improved way to remove '.' and '..' from 
readdir(), supposed to be faster than previous implementation with sort() and 
shift().
     Added two more tests to increase testing coverage.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Archive-Tar-Wrapper-0.35/MANIFEST 
new/Archive-Tar-Wrapper-0.36/MANIFEST
--- old/Archive-Tar-Wrapper-0.35/MANIFEST       2019-04-06 03:18:00.000000000 
+0200
+++ new/Archive-Tar-Wrapper-0.36/MANIFEST       2019-04-12 01:07:21.000000000 
+0200
@@ -5,7 +5,6 @@
 Makefile.PL
 MANIFEST                       This list of files
 MANIFEST.SKIP
-META.yml                       Module meta-data (added by MakeMaker)
 t/001Basic.t
 t/002Mult.t
 t/003Dirs.t
@@ -16,6 +15,8 @@
 t/008performance.t
 t/009compressed.t
 t/010openbsd.t
+t/011remdots.t
+t/012tarinfo.t
 t/data/bar.tar
 t/data/foo.tar.bz2
 t/data/foo.tgz
@@ -23,4 +24,5 @@
 xt/performance-small.t
 README.md
 CONTRIBUTING.md
+META.yml                                 Module YAML meta-data (added by 
MakeMaker)
 META.json                                Module JSON meta-data (added by 
MakeMaker)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Archive-Tar-Wrapper-0.35/META.json 
new/Archive-Tar-Wrapper-0.36/META.json
--- old/Archive-Tar-Wrapper-0.35/META.json      2019-04-06 03:18:00.000000000 
+0200
+++ new/Archive-Tar-Wrapper-0.36/META.json      2019-04-12 01:07:21.000000000 
+0200
@@ -11,7 +11,7 @@
    ],
    "meta-spec" : {
       "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec";,
-      "version" : "2"
+      "version" : 2
    },
    "name" : "Archive-Tar-Wrapper",
    "no_index" : {
@@ -52,7 +52,7 @@
    "provides" : {
       "Archive::Tar::Wrapper" : {
          "file" : "lib/Archive/Tar/Wrapper.pm",
-         "version" : "0.35"
+         "version" : "0.36"
       }
    },
    "release_status" : "stable",
@@ -66,6 +66,7 @@
          "web" : "https://github.com/glasswalk3r/archive-tar-wrapper-perl";
       }
    },
-   "version" : "0.35",
-   "x_serialization_backend" : "JSON::PP version 2.27400_02"
+   "version" : "0.36",
+   "x_NO_MYMETA" : 1,
+   "x_serialization_backend" : "JSON::PP version 2.97001"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Archive-Tar-Wrapper-0.35/META.yml 
new/Archive-Tar-Wrapper-0.36/META.yml
--- old/Archive-Tar-Wrapper-0.35/META.yml       2019-04-06 03:18:00.000000000 
+0200
+++ new/Archive-Tar-Wrapper-0.36/META.yml       2019-04-12 01:07:21.000000000 
+0200
@@ -24,7 +24,7 @@
 provides:
   Archive::Tar::Wrapper:
     file: lib/Archive/Tar/Wrapper.pm
-    version: '0.35'
+    version: '0.36'
 requires:
   Cwd: '0'
   File::Temp: '0'
@@ -35,5 +35,6 @@
 resources:
   bugtracker: https://github.com/glasswalk3r/archive-tar-wrapper-perl/issues
   repository: https://github.com/glasswalk3r/archive-tar-wrapper-perl.git
-version: '0.35'
+version: '0.36'
+x_NO_MYMETA: 1
 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Archive-Tar-Wrapper-0.35/Makefile.PL 
new/Archive-Tar-Wrapper-0.36/Makefile.PL
--- old/Archive-Tar-Wrapper-0.35/Makefile.PL    2019-04-06 03:09:37.000000000 
+0200
+++ new/Archive-Tar-Wrapper-0.36/Makefile.PL    2019-04-12 00:38:45.000000000 
+0200
@@ -73,6 +73,10 @@
     };
 }
 
+if ($ExtUtils::MakeMaker::VERSION >= 6.57_02) {
+    $WriteMakefileArgs{META_MERGE}->{NO_MYMETA} = 1;
+}
+
 if ( $ExtUtils::MakeMaker::VERSION >= 6.50 ) {
     $WriteMakefileArgs{META_MERGE}->{'meta-spec'} = { version => 2 };
     $WriteMakefileArgs{META_MERGE}->{'resources'} = {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Archive-Tar-Wrapper-0.35/lib/Archive/Tar/Wrapper.pm 
new/Archive-Tar-Wrapper-0.36/lib/Archive/Tar/Wrapper.pm
--- old/Archive-Tar-Wrapper-0.35/lib/Archive/Tar/Wrapper.pm     2019-04-06 
03:09:37.000000000 +0200
+++ new/Archive-Tar-Wrapper-0.36/lib/Archive/Tar/Wrapper.pm     2019-04-12 
00:29:52.000000000 +0200
@@ -18,7 +18,7 @@
 use Symbol 'gensym';
 use Carp;
 
-our $VERSION = '0.35';
+our $VERSION = '0.36';
 my $logger = get_logger();
 
 =pod
@@ -207,7 +207,7 @@
     my ( $class, %options ) = @_;
 
     my $self = {
-        tar                   => undef,
+        tar                   => delete $options{tar} || undef,
         tmpdir                => undef,
         tar_read_options      => '',
         tar_write_options     => '',
@@ -237,33 +237,31 @@
 
     bless $self, $class;
 
-    if ( ( $self->_is_openbsd ) and ( $self->{tar_read_options} ) ) {
-        $self->{tar_read_options} = '-' . $self->{tar_read_options};
-    }
-
-    if ( $self->{osname} eq 'MSWin32' ) {
-        $self->_setup_mswin();
-    }
-    else {
-        my $tar_location = which('tar');
+    unless ( defined $self->{tar} ) {
 
-        unless ( defined($tar_location) ) {
-            $tar_location = which('gtar');
+        if ( ( $self->_is_openbsd ) and ( $self->{tar_read_options} ) ) {
+            $self->{tar_read_options} = '-' . $self->{tar_read_options};
         }
 
-        $self->{tar} = $tar_location;
-    }
+        if ( $self->{osname} eq 'MSWin32' ) {
+            $self->_setup_mswin();
+        }
+        else {
+            $self->{tar} = which('tar') || which('gtar');
+        }
 
-    unless ( defined $self->{tar} ) {
+        unless ( defined $self->{tar} ) {
 
 # this is specific for testing under MS Windows smokers without tar installed
 # "OS unsupported" will mark the testing as NA instead of failure as 
convention.
-        if ( $self->{osname} eq 'MSWin32' ) {
-            LOGDIE 'tar not found in PATH, OS unsupported';
-        }
-        else {
-            LOGDIE 'tar not found in PATH, please specify location';
+            if ( $self->{osname} eq 'MSWin32' ) {
+                LOGDIE 'tar not found in PATH, OS unsupported';
+            }
+            else {
+                LOGDIE 'tar not found in PATH, please specify location';
+            }
         }
+
     }
 
     $self->_acquire_tar_info();
@@ -388,7 +386,7 @@
 
     $arch->list_reset()
 
-Resets the list iterator. To be used before the first call to 
C<$arch->list_next()>.
+Resets the list iterator. To be used before the first call to C<list_next()>.
 
 =cut
 
@@ -443,9 +441,12 @@
     close($err);
     close($wtr);
     waitpid( $pid, 0 );
+    chomp $error;
+    chomp $output;
     $self->{tar_error_msg} = $error;
     $self->{version_info}  = $output;
     $self->{tar_exit_code} = $? >> 8;
+    return 1;
 }
 
 sub _acquire_tar_info {
@@ -455,19 +456,24 @@
     $self->{is_gnu} = 0;
     $self->{is_bsd} = 0;
 
-    # bsdtar exit code is 1 when asking for version
-    unless ( ( $self->{tar_exit_code} == 0 ) or ( $self->{tar} =~ $bsd_regex ) 
)
-    {
-        $self->{version_info} = 'Information not available. Search for errors';
+    if ( $self->_is_openbsd() ) {
+
+# there is no way to acquire version information from default tar program on 
OpenBSD
+        $self->{version_info}  = "Information not available on 
$Config{osname}";
+        $self->{tar_exit_code} = 0;
+        $self->{is_bsd}        = 1;
     }
-    else {
-        if ( $self->{version_info} =~ /GNU/ ) {
-            $self->{is_gnu} = 1;
-        }
-        elsif ( $self->{tar} =~ $bsd_regex ) {
-            $self->{is_bsd} = 1;
-        }
+    elsif ( ( $self->{tar} =~ $bsd_regex ) and ( $self->{tar_exit_code} == 1 ) 
)
+    {
+# bsdtar exit code is 1 when asking for version, forcing to zero since is not 
an error
+        $self->{tar_exit_code} = 0;
+        $self->{is_bsd}        = 1;
     }
+
+    $self->{version_info} = 'Information not available. Search for errors'
+      unless ( $self->{tar_exit_code} == 0 );
+    $self->{is_gnu} = 1 if ( $self->{version_info} =~ /GNU/ );
+    return 1;
 }
 
 sub _setup_mswin {
@@ -508,9 +514,21 @@
 
 Returns:
 
-- a "z" character if the file is compressed with gzip.
-- a "j" character if the file is compressed with bzip2.
-- a "" character if the file is not compressed at all.
+=over
+
+=item *
+
+a "z" character if the file is compressed with gzip.
+
+=item *
+
+a "j" character if the file is compressed with bzip2.
+
+=item *
+
+a "" character if the file is not compressed at all.
+
+=back
 
 =cut
 
@@ -666,9 +684,13 @@
 
 =over
 
-=item 1. string of the path to the file which permissions will be copied from.
+=item 1.
 
-=item 2. string of the path to the file which permissions will be copied to. 
+string of the path to the file which permissions will be copied from.
+
+=item 2.
+
+string of the path to the file which permissions will be copied to. 
 
 =back
 
@@ -1181,20 +1203,22 @@
 
 Support on Microsoft Windows is limited.
 
-Version below Windows 10 will not be supported for desktops, and for servers 
from Windows 2012 and above.
+Versions below Windows 10 will not be supported for desktops, and for servers 
only Windows 2012 and above.
 
 The GNU C<tar.exe> program doesn't work properly with the current interface of 
B<Archive::Tar::Wrapper>.
+
 You must use the C<bsdtar.exe> and make sure it appears first in the C<PATH> 
environment variable than
 the GNU tar (if it is installed). See L<http://libarchive.org/> for details 
about how to download and
 install C<bsdtar.exe>, or go to 
L<http://gnuwin32.sourceforge.net/packages.html> for a direct download.
+Be sure to look for the C<bzip2> program package to install it as well.
 
-Windows 10 might come already with bsdtar program installed. Check
-L<https://blogs.technet.microsoft.com/virtualization/2017/12/19/tar-and-curl-come-to-windows/>
 for
-more details.
+Windows 10 might come already with C<bsdtar> program already installed. Please 
search for that on the appropriate
+page (Microsoft keeps changing the link to keep track of it here).
 
 Having spaces in the path string to the tar program might be an issue too. 
Although there is some effort
 in terms of workaround it, you best might avoid it completely by installing in 
a different path than
-C<C:\Program Files>.
+C<C:\Program Files>. Installing both C<bsdtar> and C<bzip2> in C<C:\GnuWin32> 
will probably be enough when
+running the installers.
 
 =head1 LEGALESE
 
@@ -1230,3 +1254,5 @@
 =head1 MAINTAINER
 
 2018, Alceu Rodrigues de Freitas Junior <[email protected]>
+
+=cut
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Archive-Tar-Wrapper-0.35/t/010openbsd.t 
new/Archive-Tar-Wrapper-0.36/t/010openbsd.t
--- old/Archive-Tar-Wrapper-0.35/t/010openbsd.t 2019-04-06 03:09:18.000000000 
+0200
+++ new/Archive-Tar-Wrapper-0.36/t/010openbsd.t 2019-04-12 00:29:52.000000000 
+0200
@@ -1,32 +1,35 @@
 use warnings;
 use strict;
-use Test::More;
+use Test::More tests => 7;
 use Archive::Tar::Wrapper;
 use File::Spec;
 use File::Which qw(which);
 
-my $tar =
-  Archive::Tar::Wrapper->new( osname => 'openbsd', tar_read_options => 'p' );
+SKIP: {
+    skip 'This test is designed to run only on OpenBSD', 7
+      unless ( $^O eq 'openbsd' );
+    my $tar_path = which('tar');
+    note("tar available at $tar_path");
 
-my $tar_path = which('tar');
+    my $tar = Archive::Tar::Wrapper->new( tar_read_options => 'p' );
 
-is( $tar->{tar_read_options},
-    '-p', 'tar parameters on OpenBSD have a "-" prefix' );
-ok( $tar->_is_openbsd(), 'correctly identify the OS' );
-is_deeply(
-    $tar->_read_openbsd_opts('z'),
-    [ "$tar_path", '-z', '-x', '-p' ],
-    'got correct options for gziped tarball'
-) or diag( explain( $tar->_read_openbsd_opts('z') ) );
-is_deeply(
-    $tar->_read_openbsd_opts('j'),
-    [ "$tar_path", '-j', '-x', '-p' ],
-    'got correct options for bziped tarball'
-) or diag( explain( $tar->_read_openbsd_opts('j') ) );
+    is( $tar->{tar_read_options},
+        '-p', 'tar parameters on OpenBSD have a "-" prefix' );
+    ok( $tar->_is_openbsd(), 'correctly identify the OS' );
+    is_deeply(
+        $tar->_read_openbsd_opts('z'),
+        [ "$tar_path", '-z', '-x', '-p' ],
+        'got correct options for gziped tarball'
+    ) or diag( explain( $tar->_read_openbsd_opts('z') ) );
+    is_deeply(
+        $tar->_read_openbsd_opts('j'),
+        [ "$tar_path", '-j', '-x', '-p' ],
+        'got correct options for bziped tarball'
+    ) or diag( explain( $tar->_read_openbsd_opts('j') ) );
 
-for my $file (qw(bar.tar foo.tgz foo.tar.bz2)) {
-    ok( $tar->read( File::Spec->catfile( 't', 'data', $file ) ),
-        "read tarball $file" );
+    for my $file (qw(bar.tar foo.tgz foo.tar.bz2)) {
+        ok( $tar->read( File::Spec->catfile( 't', 'data', $file ) ),
+            "read tarball $file" );
+    }
 }
 
-done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Archive-Tar-Wrapper-0.35/t/011remdots.t 
new/Archive-Tar-Wrapper-0.36/t/011remdots.t
--- old/Archive-Tar-Wrapper-0.35/t/011remdots.t 1970-01-01 01:00:00.000000000 
+0100
+++ new/Archive-Tar-Wrapper-0.36/t/011remdots.t 2019-04-11 21:33:54.000000000 
+0200
@@ -0,0 +1,35 @@
+use strict;
+use warnings;
+use Archive::Tar::Wrapper;
+use Test::More;
+
+my $arch    = Archive::Tar::Wrapper->new();
+my @samples = (
+    [ '.',         '..',      'ar',     'ogoyugfyu', 'iohoihoi', 'pojij' ],
+    [ '..',        'buiv',    'oihoih', 'oiggf',     '.' ],
+    [ 'uiuig',     'ohphpui', 'nuvg',   '.',         '..' ],
+    [ 'uigbyufcd', 'opkokj',  '.',      '..',        'ugoig' ],
+    [ 'uigbyufcd', '.',       'opkokj', '..',        'ugoig' ]
+);
+
+plan tests => scalar(@samples);
+
+for my $sample_ref (@samples) {
+    $arch->_rem_dots($sample_ref);
+    ok( has_no_dots($sample_ref), 'all dots removed' )
+      or diag( explain($sample_ref) );
+}
+
+sub has_no_dots {
+    my $entries_ref = shift;
+    my $result      = 1;
+
+    for my $entry ( @{$entries_ref} ) {
+        if ( ( $entry eq '.' ) or ( $entry eq '..' ) ) {
+            $result = 0;
+            last;
+        }
+    }
+
+    return $result;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Archive-Tar-Wrapper-0.35/t/012tarinfo.t 
new/Archive-Tar-Wrapper-0.36/t/012tarinfo.t
--- old/Archive-Tar-Wrapper-0.35/t/012tarinfo.t 1970-01-01 01:00:00.000000000 
+0100
+++ new/Archive-Tar-Wrapper-0.36/t/012tarinfo.t 2019-04-12 00:29:52.000000000 
+0200
@@ -0,0 +1,63 @@
+use warnings;
+use strict;
+use Test::More tests => 14;
+use Archive::Tar::Wrapper;
+use File::Which;
+
+note('Testing generic interface, should work everywhere');
+my $arch = Archive::Tar::Wrapper->new();
+
+# don't use those methods yourself outside these tests!
+$arch->_acquire_tar_info();
+ok( $arch->{version_info}, 'has version_info' );
+is( $arch->{tar_exit_code}, 0, 'has the expected exit code' );
+ok( defined( $arch->is_gnu ), 'is_gnu is defined' );
+ok( defined( $arch->is_bsd ), 'is_bsd is defined' );
+note('Specific tests for OpenBSD');
+SKIP: {
+    skip 'Not running on OpenBSD', 3 unless ( $^O eq 'openbsd' );
+    $arch = Archive::Tar::Wrapper->new();
+    ok( !$arch->is_gnu, 'tar is not GNU' );
+    ok( $arch->is_bsd,  'tar is BSD' );
+    like(
+        $arch->{version_info},
+        qr/^Information not available/,
+        'OpenBSD has no version information'
+    );
+}
+
+note('All tests below are forced to ignore platform specific details');
+note('Faking error when executing tar');
+my $tar;
+
+if ( $^O eq 'MSWin32' ) {
+    $tar = which('bsdtar');
+}
+else {
+    $tar = which('tar');
+}
+
+$arch = Archive::Tar::Wrapper->new( osname => 'yadayadayada', tar => $tar );
+$arch->{tar_exit_code} = 42;
+$arch->_acquire_tar_info(1);
+like(
+    $arch->{version_info},
+    qr/^Information not available/,
+    'on error has no version information'
+);
+is( $arch->is_gnu, 0, 'is not GNU tar' );
+is( $arch->is_bsd, 0, 'is not BSD tar' );
+note('Testing as GNU tar');
+$arch->{tar_exit_code} = 0;
+$arch->{version_info}  = 'tar (GNU tar) 1.26';
+$arch->_acquire_tar_info(1);
+ok( $arch->is_gnu,  'tar is GNU' );
+ok( !$arch->is_bsd, 'tar is not BSD' );
+note('Testing as BSD tar');
+$arch->{tar_exit_code} = 1;
+$arch->{version_info}  = 'bsdtar 2.4.12 - libarchive 2.4.12';
+$arch->{tar}           = '/usr/bin/bsdtar';
+$arch->_acquire_tar_info(1);
+ok( !$arch->is_gnu, 'tar is not GNU' );
+ok( $arch->is_bsd,  'tar is BSD' );
+


Reply via email to