Hello community,

here is the log from the commit of package perl-Path-Tiny for openSUSE:Factory 
checked in at 2016-05-12 09:32:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Path-Tiny (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Path-Tiny.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Path-Tiny"

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Path-Tiny/perl-Path-Tiny.changes    
2016-04-08 09:38:30.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.perl-Path-Tiny.new/perl-Path-Tiny.changes       
2016-05-12 09:32:56.000000000 +0200
@@ -1,0 +2,31 @@
+Thu May  5 09:54:39 UTC 2016 - [email protected]
+
+- updated to 0.090
+   see /usr/share/doc/packages/perl-Path-Tiny/Changes
+
+  0.090     2016-05-02 07:08:58-04:00 America/New_York
+  
+      - No changes from 0.089
+  
+  0.089     2016-04-26 22:21:00-04:00 America/New_York (TRIAL RELEASE)
+  
+      [Fixes]
+  
+      - Fix spew_utf8 to allow array references as input.
+  
+  0.088     2016-04-15 08:41:07-04:00 America/New_York
+  
+      - No changes from 0.087
+  
+  0.087     2016-04-12 12:13:14-04:00 America/New_York (TRIAL RELEASE)
+  
+      [Fixes]
+  
+      - Fixed bugs in relative symlink resolution for realpath, spew and
+        edit_lines.
+  
+      [Changes]
+  
+      - Symlink resolution will detect circular loops and throw an error.
+
+-------------------------------------------------------------------

Old:
----
  Path-Tiny-0.086.tar.gz

New:
----
  Path-Tiny-0.090.tar.gz

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

Other differences:
------------------
++++++ perl-Path-Tiny.spec ++++++
--- /var/tmp/diff_new_pack.mU8gbS/_old  2016-05-12 09:32:57.000000000 +0200
+++ /var/tmp/diff_new_pack.mU8gbS/_new  2016-05-12 09:32:57.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           perl-Path-Tiny
-Version:        0.086
+Version:        0.090
 Release:        0
 %define cpan_name Path-Tiny
 Summary:        File path utility

++++++ Path-Tiny-0.086.tar.gz -> Path-Tiny-0.090.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Path-Tiny-0.086/Changes new/Path-Tiny-0.090/Changes
--- old/Path-Tiny-0.086/Changes 2016-04-03 19:49:55.000000000 +0200
+++ new/Path-Tiny-0.090/Changes 2016-05-02 13:09:21.000000000 +0200
@@ -1,5 +1,30 @@
 Revision history for Path-Tiny
 
+0.090     2016-05-02 07:08:58-04:00 America/New_York
+
+    - No changes from 0.089
+
+0.089     2016-04-26 22:21:00-04:00 America/New_York (TRIAL RELEASE)
+
+    [Fixes]
+
+    - Fix spew_utf8 to allow array references as input.
+
+0.088     2016-04-15 08:41:07-04:00 America/New_York
+
+    - No changes from 0.087
+
+0.087     2016-04-12 12:13:14-04:00 America/New_York (TRIAL RELEASE)
+
+    [Fixes]
+
+    - Fixed bugs in relative symlink resolution for realpath, spew and
+      edit_lines.
+
+    [Changes]
+
+    - Symlink resolution will detect circular loops and throw an error.
+
 0.086     2016-04-03 13:49:37-04:00 America/New_York
 
     [Documented]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Path-Tiny-0.086/MANIFEST new/Path-Tiny-0.090/MANIFEST
--- old/Path-Tiny-0.086/MANIFEST        2016-04-03 19:49:55.000000000 +0200
+++ new/Path-Tiny-0.090/MANIFEST        2016-05-02 13:09:21.000000000 +0200
@@ -1,4 +1,4 @@
-# This file was automatically generated by Dist::Zilla::Plugin::Manifest 
v5.043.
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest 
v5.047.
 CONTRIBUTING.mkdn
 Changes
 LICENSE
@@ -35,6 +35,7 @@
 t/recurse.t
 t/rel-abs.t
 t/subsumes.t
+t/symlinks.t
 t/temp.t
 t/visit.t
 t/zz-atomic.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Path-Tiny-0.086/META.json 
new/Path-Tiny-0.090/META.json
--- old/Path-Tiny-0.086/META.json       2016-04-03 19:49:55.000000000 +0200
+++ new/Path-Tiny-0.090/META.json       2016-05-02 13:09:21.000000000 +0200
@@ -4,7 +4,7 @@
       "David Golden <[email protected]>"
    ],
    "dynamic_config" : 0,
-   "generated_by" : "Dist::Zilla version 5.043, CPAN::Meta::Converter version 
2.150001",
+   "generated_by" : "Dist::Zilla version 5.047, CPAN::Meta::Converter version 
2.150001",
    "license" : [
       "apache_2_0"
    ],
@@ -108,11 +108,11 @@
    "provides" : {
       "Path::Tiny" : {
          "file" : "lib/Path/Tiny.pm",
-         "version" : "0.086"
+         "version" : "0.090"
       },
       "Path::Tiny::Error" : {
          "file" : "lib/Path/Tiny.pm",
-         "version" : "0.086"
+         "version" : "0.090"
       }
    },
    "release_status" : "stable",
@@ -127,7 +127,7 @@
          "web" : "https://github.com/dagolden/Path-Tiny";
       }
    },
-   "version" : "0.086",
+   "version" : "0.090",
    "x_authority" : "cpan:DAGOLDEN",
    "x_contributors" : [
       "Alex Efros <[email protected]>",
@@ -156,7 +156,7 @@
       "Tatsuhiko Miyagawa <[email protected]>",
       "Toby Inkster <[email protected]>",
       "Yanick Champoux <[email protected]>",
-      "κΉ€λ„ν˜• - Keedi Kim <[email protected]>"
+      "\uae40\ub3c4\ud615 - Keedi Kim <[email protected]>"
    ]
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Path-Tiny-0.086/META.yml new/Path-Tiny-0.090/META.yml
--- old/Path-Tiny-0.086/META.yml        2016-04-03 19:49:55.000000000 +0200
+++ new/Path-Tiny-0.090/META.yml        2016-05-02 13:09:21.000000000 +0200
@@ -17,7 +17,7 @@
   ExtUtils::MakeMaker: '6.17'
   perl: '5.008001'
 dynamic_config: 0
-generated_by: 'Dist::Zilla version 5.043, CPAN::Meta::Converter version 
2.150001'
+generated_by: 'Dist::Zilla version 5.047, CPAN::Meta::Converter version 
2.150001'
 license: apache
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -35,10 +35,10 @@
 provides:
   Path::Tiny:
     file: lib/Path/Tiny.pm
-    version: '0.086'
+    version: '0.090'
   Path::Tiny::Error:
     file: lib/Path/Tiny.pm
-    version: '0.086'
+    version: '0.090'
 recommends:
   Unicode::UTF8: '0.58'
 requires:
@@ -64,7 +64,7 @@
   bugtracker: https://github.com/dagolden/Path-Tiny/issues
   homepage: https://github.com/dagolden/Path-Tiny
   repository: https://github.com/dagolden/Path-Tiny.git
-version: '0.086'
+version: '0.090'
 x_authority: cpan:DAGOLDEN
 x_contributors:
   - 'Alex Efros <[email protected]>'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Path-Tiny-0.086/Makefile.PL 
new/Path-Tiny-0.090/Makefile.PL
--- old/Path-Tiny-0.086/Makefile.PL     2016-04-03 19:49:55.000000000 +0200
+++ new/Path-Tiny-0.090/Makefile.PL     2016-05-02 13:09:21.000000000 +0200
@@ -1,4 +1,4 @@
-# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker 
v5.043.
+# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker 
v5.047.
 use strict;
 use warnings;
 
@@ -46,7 +46,7 @@
     "lib" => 0,
     "open" => 0
   },
-  "VERSION" => "0.086",
+  "VERSION" => "0.090",
   "test" => {
     "TESTS" => "t/*.t"
   }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Path-Tiny-0.086/README new/Path-Tiny-0.090/README
--- old/Path-Tiny-0.086/README  2016-04-03 19:49:55.000000000 +0200
+++ new/Path-Tiny-0.090/README  2016-05-02 13:09:21.000000000 +0200
@@ -2,7 +2,7 @@
     Path::Tiny - File path utility
 
 VERSION
-    version 0.086
+    version 0.090
 
 SYNOPSIS
       use Path::Tiny;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Path-Tiny-0.086/lib/Path/Tiny.pm 
new/Path-Tiny-0.090/lib/Path/Tiny.pm
--- old/Path-Tiny-0.086/lib/Path/Tiny.pm        2016-04-03 19:49:55.000000000 
+0200
+++ new/Path-Tiny-0.090/lib/Path/Tiny.pm        2016-05-02 13:09:21.000000000 
+0200
@@ -5,7 +5,7 @@
 package Path::Tiny;
 # ABSTRACT: File path utility
 
-our $VERSION = '0.086';
+our $VERSION = '0.090';
 
 # Dependencies
 use Config;
@@ -116,7 +116,7 @@
 my $WARNED_BSD_NFS = 0;
 
 sub _throw {
-    my ( $self, $function, $file ) = @_;
+    my ( $self, $function, $file, $msg ) = @_;
     if (   IS_BSD()
         && $function =~ /^flock/
         && $! =~ /operation not supported/i
@@ -128,7 +128,9 @@
         }
     }
     else {
-        Path::Tiny::Error->throw( $function, ( defined $file ? $file : 
$self->[PATH] ), $! );
+        $msg = $! unless defined $msg;
+        Path::Tiny::Error->throw( $function, ( defined $file ? $file : 
$self->[PATH] ),
+            $msg );
     }
     return;
 }
@@ -396,6 +398,24 @@
     @{$self}[ VOL, DIR, FILE ] = File::Spec->splitpath( $self->[PATH] );
 }
 
+sub _resolve_symlinks {
+    my ($self) = @_;
+    my $new = $self;
+    my ( $count, %seen ) = 0;
+    while ( -l $new->[PATH] ) {
+        if ( $seen{ $new->[PATH] }++ ) {
+            $self->_throw( 'readlink', $self->[PATH], "symlink loop detected" 
);
+        }
+        if ( ++$count > 100 ) {
+            $self->_throw( 'readlink', $self->[PATH], "maximum symlink depth 
exceeded" );
+        }
+        my $resolved = readlink $new->[PATH] or $new->_throw( 'readlink', 
$new->[PATH] );
+        $resolved = path($resolved);
+        $new = $resolved->is_absolute ? $resolved : $new->sibling($resolved);
+    }
+    return $new;
+}
+
 #--------------------------------------------------------------------------#
 # Public methods
 #--------------------------------------------------------------------------#
@@ -847,9 +867,8 @@
 
     # writing need to follow the link and create the tempfile in the same
     # dir for later atomic rename
-    my $resolved_path = $self->[PATH];
-    $resolved_path = readlink $resolved_path while -l $resolved_path;
-    my $temp = path( $resolved_path . $$ . int( rand( 2**31 ) ) );
+    my $resolved_path = $self->_resolve_symlinks;
+    my $temp          = path( $resolved_path . $$ . int( rand( 2**31 ) ) );
 
     my $temp_fh = $temp->filehandle( { exclusive => 1, locked => 1 }, ">", 
$binmode );
     my $in_fh = $self->filehandle( { locked => 1 }, '<', $binmode );
@@ -1425,10 +1444,7 @@
 # doesn't throw an error resolving non-existent basename
 sub realpath {
     my $self = shift;
-    while ( -l $self->[PATH] ) {
-        my $resolved = readlink $self->[PATH] or $self->_throw( 'readlink', 
$self->[PATH] );
-        $self = path($resolved);
-    }
+    $self = $self->_resolve_symlinks;
     require Cwd;
     $self->_splitpath if !defined $self->[FILE];
     my $check_parent =
@@ -1761,8 +1777,7 @@
 
     # spewing need to follow the link
     # and create the tempfile in the same dir
-    my $resolved_path = $self->[PATH];
-    $resolved_path = readlink $resolved_path while -l $resolved_path;
+    my $resolved_path = $self->_resolve_symlinks;
 
     my $temp = path( $resolved_path . $$ . int( rand( 2**31 ) ) );
     my $fh = $temp->filehandle( { exclusive => 1, locked => 1 }, ">", $binmode 
);
@@ -1777,7 +1792,11 @@
 sub spew_utf8 {
     if ( defined($HAS_UU) ? $HAS_UU : ( $HAS_UU = _check_UU() ) ) {
         my $self = shift;
-        spew( $self, { binmode => ":unix" }, map { 
Unicode::UTF8::encode_utf8($_) } @_ );
+        spew(
+            $self,
+            { binmode => ":unix" },
+            map { Unicode::UTF8::encode_utf8($_) } map { ref eq 'ARRAY' ? @$_ 
: $_ } @_
+        );
     }
     else {
         splice @_, 1, 0, { binmode => ":unix:encoding(UTF-8)" };
@@ -2046,7 +2065,7 @@
 
 =head1 VERSION
 
-version 0.086
+version 0.090
 
 =head1 SYNOPSIS
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Path-Tiny-0.086/t/input_output.t 
new/Path-Tiny-0.090/t/input_output.t
--- old/Path-Tiny-0.086/t/input_output.t        2016-04-03 19:49:55.000000000 
+0200
+++ new/Path-Tiny-0.090/t/input_output.t        2016-05-02 13:09:21.000000000 
+0200
@@ -70,6 +70,14 @@
     ok( utf8::is_utf8($got), "is UTF8" );
 };
 
+subtest "spew -> slurp (UTF-8, arrayref)" => sub {
+    my $file = Path::Tiny->tempfile;
+    ok( $file->spew_utf8( [_utf8_lines] ), "spew" );
+    my $got = $file->slurp_utf8();
+    is( $got, join( '', _utf8_lines ), "slurp" );
+    ok( utf8::is_utf8($got), "is UTF8" );
+};
+
 subtest "spew -> slurp (raw)" => sub {
     my $file = Path::Tiny->tempfile;
     ok( $file->spew_raw(_lines), "spew" );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Path-Tiny-0.086/t/symlinks.t 
new/Path-Tiny-0.090/t/symlinks.t
--- old/Path-Tiny-0.086/t/symlinks.t    1970-01-01 01:00:00.000000000 +0100
+++ new/Path-Tiny-0.090/t/symlinks.t    2016-05-02 13:09:21.000000000 +0200
@@ -0,0 +1,62 @@
+use 5.008001;
+use strict;
+use warnings;
+use Test::More 0.96;
+
+use lib 't/lib';
+use TestUtils qw/exception/;
+
+use Config;
+use Path::Tiny;
+use Cwd 'abs_path';
+
+plan skip_all => "No symlink support" unless $Config{d_symlink};
+
+subtest "relative symlinks with updir" => sub {
+    my $temp = Path::Tiny->tempdir;
+    my $td   = $temp->realpath;
+    $td->child(qw/tmp tmp2/)->mkpath;
+
+    my $foo = $td->child(qw/tmp foo/)->touch;
+    my $bar = $td->child(qw/tmp tmp2 bar/);
+
+    symlink "../foo", $bar or die "Failed to symlink: $!\n";
+
+    ok -f $foo, "it's a file";
+    ok -l $bar, "it's a link";
+
+    is readlink $bar, "../foo", "the link seems right";
+    is abs_path($bar), $foo, "abs_path gets's it right";
+
+    is $bar->realpath, $foo, "realpath get's it right";
+};
+
+subtest "symlink loop detection" => sub {
+    my $temp = Path::Tiny->tempdir;
+    my $td   = $temp->realpath;
+    $td->child("A")->touch;
+    for my $pair ( [qw/A B/], [qw/B C/], [qw/C A/] ) {
+        my $target = $td->child( $pair->[1] );
+        $target->remove if -e $target;
+        symlink $pair->[0], $td->child( $pair->[1] ) or die "Failed to symlink 
@$pair: $!\n";
+    }
+    diag for $td->children;
+    like(
+        exception { $td->child("A")->realpath },
+        qr/symlink loop detected/,
+        "symlink loop detected"
+    );
+};
+
+done_testing;
+
+#
+# This file is part of Path-Tiny
+#
+# This software is Copyright (c) 2014 by David Golden.
+#
+# This is free software, licensed under:
+#
+#   The Apache License, Version 2.0, January 2004
+#
+# vim: set ts=4 sts=4 sw=4 et tw=75:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Path-Tiny-0.086/xt/author/test-version.t 
new/Path-Tiny-0.090/xt/author/test-version.t
--- old/Path-Tiny-0.086/xt/author/test-version.t        2016-04-03 
19:49:55.000000000 +0200
+++ new/Path-Tiny-0.090/xt/author/test-version.t        2016-05-02 
13:09:21.000000000 +0200
@@ -2,7 +2,7 @@
 use warnings;
 use Test::More;
 
-# generated by Dist::Zilla::Plugin::Test::Version 1.05
+# generated by Dist::Zilla::Plugin::Test::Version 1.06
 use Test::Version;
 
 my @imports = qw( version_all_ok );
@@ -17,7 +17,6 @@
 push @imports, $params
     if version->parse( $Test::Version::VERSION ) >= version->parse('1.002');
 
-
 Test::Version->import(@imports);
 
 version_all_ok;


Reply via email to