r60022 - in /trunk/libtext-micromason-perl: ./ MicroMason/ MicroMason/Docs/ debian/ debian/patches/ samples/ t/
ansgar-guest at users.alioth.debian.org
ansgar-guest at users.alioth.debian.org
Sat Jul 3 16:43:47 UTC 2010
Author: ansgar-guest
Date: Sat Jul 3 16:43:37 2010
New Revision: 60022
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=60022
Log:
* New upstream release.
+ The safe_methods parameter has been deprecated. (Closes: #582892)
* Add build-dep on libtest-warn-perl for new tests.
* debian/copyright: Formatting changes for current DEP-5 proposal.
* Bump Standards-Version to 3.9.0 (no changes).
* Add myself to Uploaders.
Added:
trunk/libtext-micromason-perl/debian/NEWS
trunk/libtext-micromason-perl/samples/uninitialized.msn
- copied unchanged from r60021, branches/upstream/libtext-micromason-perl/current/samples/uninitialized.msn
Modified:
trunk/libtext-micromason-perl/MANIFEST
trunk/libtext-micromason-perl/META.yml
trunk/libtext-micromason-perl/MicroMason.pm
trunk/libtext-micromason-perl/MicroMason/Docs/Changes.pod
trunk/libtext-micromason-perl/MicroMason/Docs/ReadMe.pod
trunk/libtext-micromason-perl/MicroMason/Safe.pm
trunk/libtext-micromason-perl/debian/changelog
trunk/libtext-micromason-perl/debian/control
trunk/libtext-micromason-perl/debian/copyright
trunk/libtext-micromason-perl/debian/patches/pod-errors
trunk/libtext-micromason-perl/t/32-safe.t
trunk/libtext-micromason-perl/t/33-filters.t
trunk/libtext-micromason-perl/t/41-line_numbers.t
Modified: trunk/libtext-micromason-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/MANIFEST?rev=60022&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/MANIFEST (original)
+++ trunk/libtext-micromason-perl/MANIFEST Sat Jul 3 16:43:37 2010
@@ -48,6 +48,7 @@
samples/test-recur.msn
samples/test-relative.msn
samples/test.msn
+samples/uninitialized.msn
t/00-startup.t
t/01-syntax.t
t/02-perl.t
Modified: trunk/libtext-micromason-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/META.yml?rev=60022&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/META.yml (original)
+++ trunk/libtext-micromason-perl/META.yml Sat Jul 3 16:43:37 2010
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Text-MicroMason
-version: 2.09
+version: 2.10
abstract: Simple and Extensible Templating
author:
- Alan Ferrency <ferrency at cpan.org>
Modified: trunk/libtext-micromason-perl/MicroMason.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/MicroMason.pm?rev=60022&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/MicroMason.pm (original)
+++ trunk/libtext-micromason-perl/MicroMason.pm Sat Jul 3 16:43:37 2010
@@ -1,5 +1,5 @@
package Text::MicroMason;
-$VERSION = '2.09';
+$VERSION = '2.10';
# The #line directive requires Perl 5.6 to work correctly the way we use
# it in Base.
Modified: trunk/libtext-micromason-perl/MicroMason/Docs/Changes.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/MicroMason/Docs/Changes.pod?rev=60022&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/MicroMason/Docs/Changes.pod (original)
+++ trunk/libtext-micromason-perl/MicroMason/Docs/Changes.pod Sat Jul 3 16:43:37 2010
@@ -6,6 +6,31 @@
=head1 VERSION 2 HISTORY
=over 4
+
+=head2 Version 2.10
+
+=item 2010-06-29
+
+[rt.cpan.org #57797] Deprecate safe_methods parameter. Unfortunately,
+Safe.pm version 2.27 patches a bug we were inadvertantly taking
+advantage of to implement the safe_methods parameter. Unless we can
+find a working implementation of safe_methods that is smaller than
+"make everything unsafe" then we can't continue to support
+safe_methods.
+
+Using safe_methods now issues a deprecation warning, but it should
+work with older versions of Safe. I'm in no hurry to remove the
+feature, but I don't want anyone to use it who isn't already using it,
+until we know it can be supported in the future.
+
+=item 2010-04-05
+
+"uninitialized" warnings in templates were being taggedgenerated at a
+line number within MicroMason instead of a line number within the
+template itself. Thanks to Mike Kelly for a patch: by concatenating
+an empty string to each TOKEN within the template, the warning's line
+number is shifted to inside the template where the interpolation took
+place.
=head2 Version 2.09
Modified: trunk/libtext-micromason-perl/MicroMason/Docs/ReadMe.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/MicroMason/Docs/ReadMe.pod?rev=60022&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/MicroMason/Docs/ReadMe.pod (original)
+++ trunk/libtext-micromason-perl/MicroMason/Docs/ReadMe.pod Sat Jul 3 16:43:37 2010
@@ -50,7 +50,7 @@
=head1 DISTRIBUTION STATUS
-This is version 2.09 of Text::MicroMason.
+This is version 2.10 of Text::MicroMason.
If you encounter any problems, please inform the current maintainer and
I'll endeavor to patch them promptly.
Modified: trunk/libtext-micromason-perl/MicroMason/Safe.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/MicroMason/Safe.pm?rev=60022&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/MicroMason/Safe.pm (original)
+++ trunk/libtext-micromason-perl/MicroMason/Safe.pm Sat Jul 3 16:43:37 2010
@@ -33,6 +33,12 @@
sub safe_facade {
my $self = shift;
+
+ our @CARP_NOT = qw(Text::MicroMason::Base);
+
+ carp("* WARNING: safe_methods is deprecated; please see the pod")
+ if $self->{safe_methods};
+
Text::MicroMason::Safe::Facade->new(
map {
my $method = $_;
@@ -139,6 +145,31 @@
=item safe_methods
+B<IMPORTANT NOTE:> The C<safe_methods> parameter is deprecated and will
+be removed in future versions of Text::MicroMason (unless a Safe and
+future-proof implementation can be found). If you use this parameter,
+you will receive a warning via carp:
+
+"* WARNING: safe_methods is deprecated; please see the pod"
+
+This parameter works correctly with sufficiently old versions of the
+Safe module (prior to the release of perl 5.12.1), but modern versions
+of Safe make it impossible for a Safe compartment to run any code
+outside the compartment. Even with the object shared within the Safe
+compartment, there is currently no known way to call methods on it
+without defining the whole class within the compartment (which isn't
+safe).
+
+If anyone has an appropriately safe solution that will allow
+C<safe_methods> to work, please submit a patch to the module maintainer.
+Also see t/32-safe.t for tests related to C<safe_methods> that are
+currently being skipped.
+
+The following pod is provided for legacy purposes only. It is
+strongly recommended that you do not use this method. It is no longer
+allowed to call methods from within a "Safe" template, because it
+isn't actually safe.
+
A space-separated string of methods names to be supported by the Safe::Facade.
To control which Mason methods are available within the template, pass a
@@ -150,6 +181,7 @@
method. We'll also load the TemplateDir mixin with strict_root on to prevent
inclusion of templates from outside the current directory.
+ # safe_methods is DEPRECATED, please see above
$mason = Text::MicroMason->new( -Safe, safe_methods => 'execute',
-TemplateDir, strict_root => 1 );
@@ -157,6 +189,7 @@
calls to the filter method; to allow multiple methods, join their names
with spaces:
+ # safe_methods is DEPRECATED, please see above
$mason = Text::MicroMason->new( -Safe, safe_methods => 'execute filter',
-TemplateDir, strict_root => 1,
-Filters );
Added: trunk/libtext-micromason-perl/debian/NEWS
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/debian/NEWS?rev=60022&op=file
==============================================================================
--- trunk/libtext-micromason-perl/debian/NEWS (added)
+++ trunk/libtext-micromason-perl/debian/NEWS Sat Jul 3 16:43:37 2010
@@ -1,0 +1,17 @@
+libtext-micromason-perl (2.10-1) unstable; urgency=low
+
+ The safe_methods parameter has been deprecated as it no longer works with
+ Safe.pm 2.27. See https://rt.cpan.org/Public/Bug/Display.html?id=57797 for
+ more details.
+
+ From the upstream changelog:
+
+ Deprecate safe_methods parameter. Unfortunately,
+ Safe.pm version 2.27 patches a bug we were inadvertantly taking
+ advantage of to implement the safe_methods parameter. Unless we can
+ find a working implementation of safe_methods that is smaller than
+ "make everything unsafe" then we can't continue to support
+ safe_methods.
+
+ -- Ansgar Burchardt <ansgar at 43-1.org> Sun, 04 Jul 2010 01:28:21 +0900
+
Modified: trunk/libtext-micromason-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/debian/changelog?rev=60022&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/debian/changelog (original)
+++ trunk/libtext-micromason-perl/debian/changelog Sat Jul 3 16:43:37 2010
@@ -1,3 +1,14 @@
+libtext-micromason-perl (2.10-1) unstable; urgency=low
+
+ * New upstream release.
+ + The safe_methods parameter has been deprecated. (Closes: #582892)
+ * Add build-dep on libtest-warn-perl for new tests.
+ * debian/copyright: Formatting changes for current DEP-5 proposal.
+ * Bump Standards-Version to 3.9.0 (no changes).
+ * Add myself to Uploaders.
+
+ -- Ansgar Burchardt <ansgar at 43-1.org> Sun, 04 Jul 2010 01:42:36 +0900
+
libtext-micromason-perl (2.09-1) unstable; urgency=low
* New upstream release
Modified: trunk/libtext-micromason-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/debian/control?rev=60022&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/debian/control (original)
+++ trunk/libtext-micromason-perl/debian/control Sat Jul 3 16:43:37 2010
@@ -3,11 +3,11 @@
Priority: optional
Build-Depends: debhelper (>= 7.0.50)
Build-Depends-Indep: perl, libclass-mixinfactory-perl (>= 0.9),
- libhtml-parser-perl, liburi-perl (>= 1.53)
+ libhtml-parser-perl, liburi-perl (>= 1.53), libtest-warn-perl
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: gregor herrmann <gregoa at debian.org>, Jonathan Yu <jawnsy at cpan.org>,
- Chris Butler <chrisb at debian.org>
-Standards-Version: 3.8.4
+ Chris Butler <chrisb at debian.org>, Ansgar Burchardt <ansgar at 43-1.org>
+Standards-Version: 3.9.0
Homepage: http://search.cpan.org/dist/Text-MicroMason/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libtext-micromason-perl/
Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libtext-micromason-perl/
Modified: trunk/libtext-micromason-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/debian/copyright?rev=60022&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/debian/copyright (original)
+++ trunk/libtext-micromason-perl/debian/copyright Sat Jul 3 16:43:37 2010
@@ -1,20 +1,17 @@
-Format-Specification:
- http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196
-Upstream-Maintainer: Alan Ferrency <ferrency at cpan.org>
-Upstream-Source: http://search.cpan.org/dist/Text-MicroMason/
-Upstream-Name: Text-MicroMason
+Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
+Maintainer: Alan Ferrency <ferrency at cpan.org>
+Source: http://search.cpan.org/dist/Text-MicroMason/
+Name: Text-MicroMason
-Files: *
Copyright: 2002-2005, Matthew Simon Cavalletto <evo at cpan.org>
Portions copyright 2001 Evolution Online Systems, Inc.
-License-Alias: Perl
-License: Artistic | GPL-1+
+License: Artistic or GPL-1+
Files: debian/*
Copyright: 2009, Jonathan Yu <jawnsy at cpan.org>
2009, gregor herrmann <gregoa at debian.org>
2007-2009, Christoph Berg <myon at debian.org>
-License: Artistic | GPL-1+
+License: Artistic or GPL-1+
X-Comment: Packaging of this module was kindly funded by Dembach Goo
Informatik on behalf of Allianz 24.
Modified: trunk/libtext-micromason-perl/debian/patches/pod-errors
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/debian/patches/pod-errors?rev=60022&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/debian/patches/pod-errors (original)
+++ trunk/libtext-micromason-perl/debian/patches/pod-errors Sat Jul 3 16:43:37 2010
@@ -1,8 +1,8 @@
fix several pod errors
---- a/MicroMason/Docs/Changes.pod
-+++ b/MicroMason/Docs/Changes.pod
-@@ -162,6 +162,8 @@
+--- libtext-micromason-perl.orig/MicroMason/Docs/Changes.pod
++++ libtext-micromason-perl/MicroMason/Docs/Changes.pod
+@@ -187,6 +187,8 @@
Bump version to 2.0
@@ -11,8 +11,8 @@
=head2 Version 1.993_01
=over 4
---- a/MicroMason/HasParams.pm
-+++ b/MicroMason/HasParams.pm
+--- libtext-micromason-perl.orig/MicroMason/HasParams.pm
++++ libtext-micromason-perl/MicroMason/HasParams.pm
@@ -72,6 +72,10 @@
######################################################################
@@ -24,8 +24,8 @@
=head1 DESCRIPTION
This mixin class ...
---- a/MicroMason/StoreOne.pm
-+++ b/MicroMason/StoreOne.pm
+--- libtext-micromason-perl.orig/MicroMason/StoreOne.pm
++++ libtext-micromason-perl/MicroMason/StoreOne.pm
@@ -36,6 +36,10 @@
######################################################################
Modified: trunk/libtext-micromason-perl/t/32-safe.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/t/32-safe.t?rev=60022&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/t/32-safe.t (original)
+++ trunk/libtext-micromason-perl/t/32-safe.t Sat Jul 3 16:43:37 2010
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
use strict;
-use Test::More tests => 23;
+use Test::More tests => 24;
use_ok 'Text::MicroMason', qw( safe_compile safe_execute try_safe_compile try_safe_execute );
@@ -39,7 +39,10 @@
local $^W; # no warnings uninitialized
my $variable = 'secret';
my $scr_hidden = '<% $variable %>';
- unlike try_safe_execute( $scr_hidden ), qr/secret/;
+
+ my ($output, $err) = try_safe_execute( $scr_hidden );
+ is $output, undef;
+ like $err, qr/requires explicit package name/;
}
{
@@ -83,7 +86,9 @@
like $@, qr/Can't call .*?execute/;
}
+SKIP:
{
+ skip "safe_methods is deprecated because it can't work with modern Safe", 2;
my $m = Text::MicroMason->new( '-Safe', safe_methods => 'execute' );
my $script = qq| <& 'samples/test.msn', %ARGS &> |;
@@ -93,13 +98,14 @@
}
my $safe_dir_mason = Text::MicroMason->class( 'Safe', 'TemplateDir' );
+SKIP:
{
-# my $m = Text::MicroMason->new( '-Safe', safe_methods => 'execute',
-# -TemplateDir, template_root => 'samples', strict_root => 1 );
+ skip "safe_methods is deprecated because it can't work with modern Safe", 2;
+
my $m = Text::MicroMason->new(
- -TemplateDir, template_root => 'samples', strict_root => 1,
- '-Safe', safe_methods => 'execute',
- );
+ -TemplateDir, template_root => 'samples', strict_root => 1,
+ '-Safe', safe_methods => 'execute',
+ );
my $script = qq| <& 'test.msn', %ARGS &> |;
my $output = eval{ $m->execute( text => $script, name => 'Sam', hour => 9)};
@@ -107,9 +113,12 @@
ok !$@, "Execute produced error: $@";
}
+SKIP:
{
- my $m = Text::MicroMason->new( '-Safe', safe_methods => 'execute',
- -TemplateDir, template_root => 'samples', strict_root => 1 );
+ skip "safe_methods is deprecated because it can't work with modern Safe", 2;
+ my $m = Text::MicroMason->new(
+ '-Safe', safe_methods => 'execute',
+ -TemplateDir, template_root => 'samples', strict_root => 1 );
my $script = qq| <& '../MicroMason.pm', %ARGS &> |;
my $output = eval{ $m->execute( text => $script, name => 'Sam', hour => 9)};
Modified: trunk/libtext-micromason-perl/t/33-filters.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/t/33-filters.t?rev=60022&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/t/33-filters.t (original)
+++ trunk/libtext-micromason-perl/t/33-filters.t Sat Jul 3 16:43:37 2010
@@ -48,12 +48,12 @@
skip "URI::Escape is not installed", 8
unless URI::Escape->can('uri_escape');
- my $res_u = 'Hello %3C%27world%27%3E!';
+ my $res_u = 'Hello %3C%3Fworld%3F%3E!';
- is $m->execute(text => qq(Hello <% "<'world'>" |u %>!)), $res_u,
+ is $m->execute(text => qq(Hello <% "<?world?>" |u %>!)), $res_u,
"Execute text with URI::Escape filter";
- ok my $res = eval {$m->execute(text => qq(Hello <% "<'world'>"|u %>!))},
+ ok my $res = eval {$m->execute(text => qq(Hello <% "<?world?>"|u %>!))},
"Execute text with URI::Escape filter and no space";
is $res, $res_u;
@@ -65,18 +65,18 @@
# Test u as a default filter
{
local $m->{default_filters} = 'u';
- my $src_u2 = qq(Hello <% "<'world'>" %>!);
+ my $src_u2 = qq(Hello <% "<?world?>" %>!);
is $m->execute( text => $src_u2), $res_u, "Execute text with URI::Escape default filter";
# Explicitly disable the default filters
- my $src_u3 = qq(Hello <% "<'world'>" | n %>!);
- my $res_u3 = q(Hello <'world'>!);
- is $m->execute( text => $src_u3), "Hello <'world'>!", "Execute text with URI::Escape default turned off";
+ my $src_u3 = qq(Hello <% "<?world?>" | n %>!);
+ my $res_u3 = q(Hello <?world?>!);
+ is $m->execute( text => $src_u3), "Hello <?world?>!", "Execute text with URI::Escape default turned off";
}
# Test stacking and canceling with n
- my $res_hnu = 'Hello %3C%27world%27%3E!';
- my $src_hnu = qq(Hello <% "<'world'>" |hnu %>!);
+ my $res_hnu = 'Hello %3C%3Fworld%3F%3E!';
+ my $src_hnu = qq(Hello <% "<?world?>" |hnu %>!);
is $m->execute( text => $src_hnu), $res_hnu, "Execute text with stacking u filter";
}
Modified: trunk/libtext-micromason-perl/t/41-line_numbers.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/t/41-line_numbers.t?rev=60022&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/t/41-line_numbers.t (original)
+++ trunk/libtext-micromason-perl/t/41-line_numbers.t Sat Jul 3 16:43:37 2010
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
use strict;
-use Test::More tests => 33;
+use Test::More tests => 37;
use_ok 'Text::MicroMason';
@@ -76,3 +76,19 @@
}
######################################################################
+
+SKIP: {
+ skip "Test::Warn is not installed", 4
+ unless eval { require Test::Warn; };
+ use warnings;
+
+ ok my $m = Text::MicroMason->new( -LineNumbers );
+ Test::Warn::warnings_like(sub {
+ ok my $output = eval { $m->execute( file => 'samples/uninitialized.msn' ) };
+ is $@, '';
+ }, [
+ qr/^Use of uninitialized value.*at samples\/uninitialized\.msn line 1/,
+ qr/^Use of uninitialized value.*at samples\/uninitialized\.msn line 8/,
+ ]);
+}
+
More information about the Pkg-perl-cvs-commits
mailing list