Hello community,
here is the log from the commit of package perl-Template-Toolkit for
openSUSE:Factory checked in at 2019-05-02 19:16:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Template-Toolkit (Old)
and /work/SRC/openSUSE:Factory/.perl-Template-Toolkit.new.5148 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Template-Toolkit"
Thu May 2 19:16:50 2019 rev:33 rq:699562 version:2.29
Changes:
--------
---
/work/SRC/openSUSE:Factory/perl-Template-Toolkit/perl-Template-Toolkit.changes
2018-11-10 17:02:25.095530718 +0100
+++
/work/SRC/openSUSE:Factory/.perl-Template-Toolkit.new.5148/perl-Template-Toolkit.changes
2019-05-02 19:16:52.393369019 +0200
@@ -1,0 +2,13 @@
+Tue Apr 30 05:34:12 UTC 2019 - Stephan Kulow <[email protected]>
+
+- updated to 2.29
+ see /usr/share/doc/packages/perl-Template-Toolkit/Changes
+
+ # Version 2.29 - 29th April 2019
+ #------------------------------------------------------------------------
+
+ * G. Flohr fixed multiple weaken cyclic reference
+
+ #-----------------------------------------------------------------------
+
+-------------------------------------------------------------------
Old:
----
Template-Toolkit-2.28.tar.gz
New:
----
Template-Toolkit-2.29.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Template-Toolkit.spec ++++++
--- /var/tmp/diff_new_pack.268fXK/_old 2019-05-02 19:16:53.101370321 +0200
+++ /var/tmp/diff_new_pack.268fXK/_new 2019-05-02 19:16:53.105370328 +0200
@@ -1,7 +1,7 @@
#
# spec file for package perl-Template-Toolkit
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
Name: perl-Template-Toolkit
-Version: 2.28
+Version: 2.29
Release: 0
%define cpan_name Template-Toolkit
Summary: Template Processing System
@@ -44,10 +44,10 @@
%build
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
-%{__make} %{?_smp_mflags}
+make %{?_smp_mflags}
%check
-%{__make} test
+make test
%install
%perl_make_install
++++++ Template-Toolkit-2.28.tar.gz -> Template-Toolkit-2.29.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Template-Toolkit-2.28/Changes
new/Template-Toolkit-2.29/Changes
--- old/Template-Toolkit-2.28/Changes 2018-10-12 00:46:12.000000000 +0200
+++ new/Template-Toolkit-2.29/Changes 2019-04-29 17:52:56.000000000 +0200
@@ -19,6 +19,12 @@
#------------------------------------------------------------------------
#-----------------------------------------------------------------------
+# Version 2.29 - 29th April 2019
+#------------------------------------------------------------------------
+
+* G. Flohr fixed multiple weaken cyclic reference
+
+#-----------------------------------------------------------------------
# Version 2.28 - 11th October 2018
#------------------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Template-Toolkit-2.28/HACKING
new/Template-Toolkit-2.29/HACKING
--- old/Template-Toolkit-2.28/HACKING 2018-10-12 00:33:16.000000000 +0200
+++ new/Template-Toolkit-2.29/HACKING 2019-04-29 17:52:56.000000000 +0200
@@ -1,11 +1,11 @@
Template Toolkit
- Version 2.28
+ Version 2.29
- October 2018
+ April 2019
- Copyright (C) 1996-2018 Andy Wardley. All Rights Reserved
+ Copyright (C) 1996-2019 Andy Wardley. All Rights Reserved
This is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
@@ -48,7 +48,7 @@
COPYRIGHT
---------
-Copyright (C) 1996-2018 Andy Wardley. All Rights Reserved.
+Copyright (C) 1996-2019 Andy Wardley. All Rights Reserved.
This is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Template-Toolkit-2.28/INSTALL
new/Template-Toolkit-2.29/INSTALL
--- old/Template-Toolkit-2.28/INSTALL 2018-10-12 00:33:16.000000000 +0200
+++ new/Template-Toolkit-2.29/INSTALL 2019-04-29 17:52:56.000000000 +0200
@@ -1,11 +1,11 @@
Template Toolkit
- Version 2.28
+ Version 2.29
- October 2018
+ April 2019
- Copyright (C) 1996-2018 Andy Wardley. All Rights Reserved
+ Copyright (C) 1996-2019 Andy Wardley. All Rights Reserved
This is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
@@ -30,8 +30,8 @@
To install the Template Toolkit from the command line:
- $ tar zxf Template-Toolkit-2.28.tar.gz
- $ cd Template-Toolkit-2.28
+ $ tar zxf Template-Toolkit-2.29.tar.gz
+ $ cd Template-Toolkit-2.29
$ perl Makefile.PL
$ make
$ make test
@@ -85,19 +85,19 @@
Template-Toolkit-<version>.tar.gz
-where <version> represents the current version number, e.g. 2.26.
+where <version> represents the current version number, e.g. 2.29.
To install the Template Toolkit, unpack the distribution archive to
create an installation directory. Something like this:
- $ tar zxf Template-Toolkit-2.26.tar.gz
+ $ tar zxf Template-Toolkit-2.29.tar.gz
or
- $ gunzip Template-Toolkit-2.26.tar.gz
- $ tar xf Template-Toolkit-2.26.tar
+ $ gunzip Template-Toolkit-2.29.tar.gz
+ $ tar xf Template-Toolkit-2.29.tar
You can then 'cd' into the directory created,
- $ cd Template-Toolkit-2.26
+ $ cd Template-Toolkit-2.29
and perform the usual Perl installation procedure:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Template-Toolkit-2.28/MANIFEST
new/Template-Toolkit-2.29/MANIFEST
--- old/Template-Toolkit-2.28/MANIFEST 2018-10-12 00:48:23.000000000 +0200
+++ new/Template-Toolkit-2.29/MANIFEST 2019-04-29 17:53:32.000000000 +0200
@@ -236,6 +236,7 @@
t/wrap.t
t/wrapper.t
t/zz-plugin-cycle.t
+t/zz-plugin-leak-gh-213.t
t/zz-plugin-leak-rt-46691.t
t/zz-plugin-leak.t
t/zz-pmv.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Template-Toolkit-2.28/META.json
new/Template-Toolkit-2.29/META.json
--- old/Template-Toolkit-2.28/META.json 2018-10-12 00:48:22.000000000 +0200
+++ new/Template-Toolkit-2.29/META.json 2019-04-29 17:53:32.000000000 +0200
@@ -57,6 +57,6 @@
"web" : "https://github.com/abw/Template2"
}
},
- "version" : "2.28",
+ "version" : "2.29",
"x_serialization_backend" : "JSON::PP version 2.27400_02"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Template-Toolkit-2.28/META.yml
new/Template-Toolkit-2.29/META.yml
--- old/Template-Toolkit-2.28/META.yml 2018-10-12 00:48:22.000000000 +0200
+++ new/Template-Toolkit-2.29/META.yml 2019-04-29 17:53:32.000000000 +0200
@@ -28,5 +28,5 @@
bugtracker: https://github.com/abw/Template2/issues
homepage: http://www.template-toolkit.org
repository: https://github.com/abw/Template2.git
-version: '2.28'
+version: '2.29'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Template-Toolkit-2.28/README
new/Template-Toolkit-2.29/README
--- old/Template-Toolkit-2.28/README 2018-10-12 00:33:16.000000000 +0200
+++ new/Template-Toolkit-2.29/README 2019-04-29 17:52:56.000000000 +0200
@@ -1,11 +1,11 @@
Template Toolkit
- Version 2.28
+ Version 2.29
- October 2018
+ April 2019
- Copyright (C) 1996-2018 Andy Wardley. All Rights Reserved
+ Copyright (C) 1996-2019 Andy Wardley. All Rights Reserved
This is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
@@ -44,6 +44,8 @@
WHAT'S NEW?
-----------
+Version 2.29 is a maintenance release fixing a cycling weaken issue.
+
Version 2.28 is a maintenance release fixing some minor bugs and warnings.
GitHub is now the official bug tacker tool for the project.
@@ -346,7 +348,7 @@
COPYRIGHT
---------
-Copyright (C) 1996-2014 Andy Wardley. All Rights Reserved.
+Copyright (C) 1996-2019 Andy Wardley. All Rights Reserved.
This is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Template-Toolkit-2.28/lib/Template/Plugin/Filter.pm
new/Template-Toolkit-2.29/lib/Template/Plugin/Filter.pm
--- old/Template-Toolkit-2.28/lib/Template/Plugin/Filter.pm 2018-10-11
23:49:04.000000000 +0200
+++ new/Template-Toolkit-2.29/lib/Template/Plugin/Filter.pm 2019-04-29
17:52:56.000000000 +0200
@@ -11,7 +11,7 @@
# Andy Wardley <[email protected]>
#
# COPYRIGHT
-# Copyright (C) 2001-2009 Andy Wardley. All Rights Reserved.
+# Copyright (C) 2001-2019 Andy Wardley. All Rights Reserved.
#
# This module is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
@@ -23,7 +23,7 @@
use strict;
use warnings;
use base 'Template::Plugin';
-use Scalar::Util 'weaken';
+use Scalar::Util 'weaken', 'isweak';
our $VERSION = 1.38;
@@ -65,7 +65,8 @@
my $this = $self;
# avoid a memory leak
- weaken( $this->{_CONTEXT} ) if ref $this->{_CONTEXT};
+ weaken( $this->{_CONTEXT} ) if ref $this->{_CONTEXT}
+ && !isweak $this->{_CONTEXT};
if ($self->{ _DYNAMIC }) {
return [ sub {
@@ -385,7 +386,7 @@
=head1 COPYRIGHT
-Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved.
+Copyright (C) 1996-2019 Andy Wardley. All Rights Reserved.
This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Template-Toolkit-2.28/lib/Template/Provider.pm
new/Template-Toolkit-2.29/lib/Template/Provider.pm
--- old/Template-Toolkit-2.28/lib/Template/Provider.pm 2018-10-11
23:48:59.000000000 +0200
+++ new/Template-Toolkit-2.29/lib/Template/Provider.pm 2019-04-29
17:52:56.000000000 +0200
@@ -81,17 +81,6 @@
# regex to match relative paths
our $RELATIVE_PATH = qr[(?:^|/)\.+/];
-
-# hack so that 'use bytes' will compile on versions of Perl earlier than
-# 5.6, even though we never call _decode_unicode() on those systems
-BEGIN {
- if ($] < 5.006) {
- package bytes;
- $INC{'bytes.pm'} = 1;
- }
-}
-
-
#========================================================================
# -- PUBLIC METHODS --
#========================================================================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Template-Toolkit-2.28/lib/Template.pm
new/Template-Toolkit-2.29/lib/Template.pm
--- old/Template-Toolkit-2.28/lib/Template.pm 2018-10-12 00:33:16.000000000
+0200
+++ new/Template-Toolkit-2.29/lib/Template.pm 2019-04-29 17:52:56.000000000
+0200
@@ -32,7 +32,7 @@
use File::Path;
use Scalar::Util qw(blessed);
-our $VERSION = '2.28';
+our $VERSION = '2.29';
our $ERROR = '';
our $DEBUG = 0;
our $BINMODE = 0 unless defined $BINMODE;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Template-Toolkit-2.28/t/zz-plugin-leak-gh-213.t
new/Template-Toolkit-2.29/t/zz-plugin-leak-gh-213.t
--- old/Template-Toolkit-2.28/t/zz-plugin-leak-gh-213.t 1970-01-01
01:00:00.000000000 +0100
+++ new/Template-Toolkit-2.29/t/zz-plugin-leak-gh-213.t 2019-04-29
17:52:56.000000000 +0200
@@ -0,0 +1,122 @@
+#!/usr/bin/perl
+
+#============================================================= -*-perl-*-
+#
+# t/zz-plugin-leak-gh-213.t
+#
+# Testcase from aka GH #213
+# view https://github.com/abw/Template2/pull/213
+#
+# Written by Nicolas R. <[email protected]>
+#
+#========================================================================
+
+# stolen from t/filter.t need to refactor
+package Tie::File2Str;
+
+sub TIEHANDLE {
+ my ( $class, $textref ) = @_;
+ bless $textref, $class;
+}
+
+sub PRINT {
+ my $self = shift;
+ $$self .= join( '', @_ );
+}
+
+package main;
+
+use lib qw( t/lib ./lib ../lib ../blib/arch ./test );
+
+use Template;
+use Test::More;
+
+use File::Temp qw(tempfile tempdir);
+
+plan( skip_all => "Developer test only - set RELEASE_TESTING=1" )
+ unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} );
+
+plan tests => 3;
+
+# ------- t1.txt - checkleak template
+my $t1 = <<'EOT';
+[%- USE Echo -%]
+[% FILTER $Echo %]foo[% END %]
+[% FILTER $Echo %]bar[% END %]
+EOT
+
+# ------- checkleak.pm a super checkleak custom filter
+my $plugin_echo = <<'EOT';
+
+package Template::Plugin::Echo;
+
+use base qw(Template::Plugin::Filter);
+
+sub filter {
+ my ($self, $text) = @_;
+
+ return $text . $text;
+}
+
+1;
+EOT
+
+my $template_tmpdir = tempdir( CLEANUP => 1 );
+
+write_text( qq[$template_tmpdir/t1.txt], $t1 );
+
+my $plugindir = tempdir( CLEANUP => 1 );
+
+my $plugin_pm = qq[$plugindir/Template/Plugin/Echo.pm];
+
+# pretty ugly but only run by authors...
+mkdir("$plugindir/Template") && mkdir("$plugindir/Template/Plugin");
+die q[Failed to create plugindir] unless -d "$plugindir/Template/Plugin";
+
+write_text( $plugin_pm, $plugin_echo );
+
+unshift @INC, $plugindir;
+ok eval { do $plugin_pm; 1 }, "can load Template::Plugin::checkleak"
+ or die "Failed to load Template::Plugin::checkleak - $@";
+
+# chdir to our temporary folder with templates
+chdir($template_tmpdir) or die;
+
+my $tt = Template->new( { 'PLUGIN_BASE' => $plugindir } );
+
+my $out;
+my $stderr;
+{
+ local *STDERR;
+ tie( *STDERR, "Tie::File2Str", \$stderr );
+
+ $tt->process(
+ 't1.txt',
+ {},
+ \$out
+ ) || print STDERR "Error: " . $tt->error();
+
+}
+
+# make sure we can process the template without any issues
+# the original bug was doing a weaken on the plugin itself..
+# resulting in not being able to load it a second time
+is $out,
+ <<'EXPECT', "Template processed correctly using Plugin checkleak twice";
+foofoo
+barbar
+EXPECT
+
+is $stderr, undef, "no warning from process 'Reference is already weak'";
+
+done_testing;
+
+exit;
+
+sub write_text { # could also use File::Slurper::write_file ....
+ my ( $file, $content ) = @_;
+
+ open( my $fh, '>', $file ) or die $!;
+ print {$fh} $content;
+ close($fh);
+}