diff -Nru libsub-uplevel-perl-0.2002/Build.PL libsub-uplevel-perl-0.2200/Build.PL --- libsub-uplevel-perl-0.2002/Build.PL 2008-09-11 19:34:02.000000000 +0100 +++ libsub-uplevel-perl-0.2200/Build.PL 2009-11-17 10:39:43.000000000 +0000 @@ -1,31 +1,36 @@ -use 5.006; -use strict; -use lib 'inc'; -eval "require Pod::WikiDoc"; -my $class = $@ ? "Module::Build" : "Module::Build::WikiDoc"; -eval "require $class"; - -$class->new( - module_name => 'Sub::Uplevel', - dist_author => 'David A. Golden ', - license => 'perl', - create_readme => 1, - create_makefile_pl => 'traditional', - requires => { - 'perl' => 5.006, - }, - build_requires => { - 'Carp' => 0, - 'Test::More' => 0.47, - }, - meta_add => { - no_index => { - package => [ 'DB' ], - directory => [ qw{ - examples - inc - }], - } - }, -)->create_build_script; - +use 5.006; +use strict; +use lib 'inc'; +eval "require Pod::WikiDoc"; +my $class = $@ ? "Module::Build" : "Module::Build::WikiDoc"; +eval "require $class"; + +$class->new( + module_name => 'Sub::Uplevel', + dist_author => 'David A. Golden ', + license => 'perl', + create_readme => 1, + create_makefile_pl => 'traditional', + requires => { + 'perl' => 5.006, + }, + build_requires => { + 'Carp' => 0, + 'Test::More' => 0.47, + }, + meta_add => { + no_index => { + package => [ 'DB' ], + directory => [ qw{ + examples + inc + }], + }, + }, + meta_merge => { + resources => { + repository => 'http://github.com/dagolden/sub-uplevel', + }, + }, +)->create_build_script; + diff -Nru /tmp/R7lqZqQJqq/libsub-uplevel-perl-0.2002/Changes /tmp/E53S3Z70Yv/libsub-uplevel-perl-0.2200/Changes --- libsub-uplevel-perl-0.2002/Changes 2008-09-11 19:34:02.000000000 +0100 +++ libsub-uplevel-perl-0.2200/Changes 2009-11-17 10:39:43.000000000 +0000 @@ -1,5 +1,15 @@ Changes for Sub::Uplevel +0.22 Tue Nov 17 05:38:42 EST 2009 + + - meta: added repository to metadata [Alexandr Ciornii] + +0.21_01 Sat Nov 29 15:24:49 EST 2008 + + - added: the ":aggressive" tag may be used to force reloading of + Exporter, which often binds caller() prior to Sub::Uplevel's global + override + 0.2002 Thu Sep 11 14:33:09 EDT 2008 - changed: removed Exporter dependency diff -Nru /tmp/R7lqZqQJqq/libsub-uplevel-perl-0.2002/debian/changelog /tmp/E53S3Z70Yv/libsub-uplevel-perl-0.2200/debian/changelog --- libsub-uplevel-perl-0.2002/debian/changelog 2009-12-01 00:12:19.000000000 +0000 +++ libsub-uplevel-perl-0.2200/debian/changelog 2009-12-01 00:12:19.000000000 +0000 @@ -1,3 +1,26 @@ +libsub-uplevel-perl (0.2200-1) unstable; urgency=low + + [ Jonathan Yu ] + * New upstream release + * Standards-Version 3.8.3 (drop perl version dependency) + * Add myself to Uploaders and Copyright + * Use new short debhelper rules file + * Refresh copyright information + + [ gregor herrmann ] + * debian/control: Added: ${misc:Depends} to Depends: field. + * debian/control: remove build dependencies that are not used anymore. + + [ Nathan Handler ] + * debian/watch: Update to ignore development releases. + + [ Salvatore Bonaccorso ] + * debian/control: Changed: Replace versioned (build-)dependency on + perl (>= 5.6.0-{12,16}) with an unversioned dependency on perl (as + permitted by Debian Policy 3.8.3). + + -- Jonathan Yu Tue, 17 Nov 2009 13:04:04 -0500 + libsub-uplevel-perl (0.2002-1) unstable; urgency=low * New upstream release. diff -Nru /tmp/R7lqZqQJqq/libsub-uplevel-perl-0.2002/debian/control /tmp/E53S3Z70Yv/libsub-uplevel-perl-0.2200/debian/control --- libsub-uplevel-perl-0.2002/debian/control 2009-12-01 00:12:19.000000000 +0000 +++ libsub-uplevel-perl-0.2200/debian/control 2009-12-01 00:12:19.000000000 +0000 @@ -1,22 +1,21 @@ Source: libsub-uplevel-perl Section: perl Priority: optional +Build-Depends: debhelper (>= 7.0.8), quilt (>= 0.46-7) +Build-Depends-Indep: perl Maintainer: Debian Perl Group Uploaders: Jay Bonci , Damyan Ivanov , - gregor herrmann -Build-Depends: debhelper (>= 7), quilt -Build-Depends-Indep: perl (>= 5.6.0-16), libtest-pod-perl, - libtest-pod-coverage-perl -Standards-Version: 3.8.0 + gregor herrmann , Jonathan Yu +Standards-Version: 3.8.3 Homepage: http://search.cpan.org/dist/Sub-Uplevel/ Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libsub-uplevel-perl/ Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libsub-uplevel-perl/ Package: libsub-uplevel-perl Architecture: all -Depends: ${perl:Depends} -Description: Sub::Uplevel - safe call stack spoofing for perl - Sub::Uplevel from CPAN provides a safe implementation similar to Tcl's - uplevel() function. It allows you to safely fool the caller() into - thinking it's in a different part of the stack, without knowing that - it is being wrapped. +Depends: ${misc:Depends}, ${perl:Depends} +Description: module to spoof the Perl call stack + Sub::Uplevel is a Perl module that provides a safe implementation similar to + Tcl's uplevel() function. It allows you to safely fool the caller() into + thinking it's in a different part of the stack, without knowing that it is + being wrapped. diff -Nru /tmp/R7lqZqQJqq/libsub-uplevel-perl-0.2002/debian/copyright /tmp/E53S3Z70Yv/libsub-uplevel-perl-0.2200/debian/copyright --- libsub-uplevel-perl-0.2002/debian/copyright 2009-12-01 00:12:19.000000000 +0000 +++ libsub-uplevel-perl-0.2200/debian/copyright 2009-12-01 00:12:19.000000000 +0000 @@ -1,32 +1,41 @@ -Format-Specification: - http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196 -Upstream-Maintainer: David A. Golden -Upstream-Source: http://search.cpan.org/dist/Sub-Uplevel/ -Upstream-Name: Sub-Uplevel +Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=59 +Maintainer: David A. Golden +Source: http://search.cpan.org/dist/Sub-Uplevel/ +Name: Sub-Uplevel Files: * -Copyright: - Original code Copyright (c) 2001 to 2007 by Michael G Schwern. - Additional code Copyright (c) 2006 to 2008 by David A Golden. -License-Alias: Perl -License: Artistic | GPL-1+ +Copyright: 2006-2008, David A. Golden + 2001-2007, Michael G Schwern +License: Artistic or GPL-1+ + +Files: inc/Module/* +Copyright: 2002-2009, Adam Kennedy + 2002-2009, Audrey Tang + 2002-2009, Brian Ingerson +License: Artistic or GPL-1+ Files: debian/* -Copyright: - 2003-2007, Jay Bonci - 2007-2008, various members of the Debian Perl Group, cf. debian/changelog -License: Artistic | GPL-1+ +Copyright: + 2009, Jonathan Yu + 2008, gregor herrmann + 2007, Damyan Ivanov + 2003-2007, Jay Bonci + 2006, Gunnar Wolf + 2003, Jay Bonci +License: Artistic or GPL-1+ License: Artistic - This program is free software; you can redistribute it and/or modify - it under the terms of the Artistic License, which comes with Perl. - On Debian GNU/Linux systems, the complete text of the Artistic License - can be found in /usr/share/common-licenses/Artistic + This program is free software; you can redistribute it and/or modify + it under the terms of the Artistic License, which comes with Perl. + . + On Debian GNU/Linux systems, the complete text of the Artistic License + can be found in `/usr/share/common-licenses/Artistic' License: GPL-1+ - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 1, or (at your option) - any later version. - On Debian GNU/Linux systems, the complete text of the GNU General - Public License can be found in `/usr/share/common-licenses/GPL' + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 1, or (at your option) + any later version. + . + On Debian GNU/Linux systems, the complete text of the GNU General + Public License can be found in `/usr/share/common-licenses/GPL' diff -Nru /tmp/R7lqZqQJqq/libsub-uplevel-perl-0.2002/debian/rules /tmp/E53S3Z70Yv/libsub-uplevel-perl-0.2200/debian/rules --- libsub-uplevel-perl-0.2002/debian/rules 2009-12-01 00:12:19.000000000 +0000 +++ libsub-uplevel-perl-0.2200/debian/rules 2009-12-01 00:12:19.000000000 +0000 @@ -1,28 +1,4 @@ #!/usr/bin/make -f -include /usr/share/quilt/quilt.make - -build: build-stamp -build-stamp: $(QUILT_STAMPFN) - dh build --before dh_auto_test - # we have no Test::Spelling, and Perl::Critic tests fail so we only take the other xt/ tests - $(MAKE) test TEST_FILES='t/*.t xt/pod*.t' - dh build --after dh_auto_test - touch $@ - -clean: unpatch - dh $@ - -install: install-stamp -install-stamp: build-stamp - dh install - touch $@ - -binary-arch: - -binary-indep: install - dh $@ - -binary: binary-arch binary-indep - -.PHONY: binary binary-arch binary-indep install clean build +%: + dh --with quilt $@ diff -Nru /tmp/R7lqZqQJqq/libsub-uplevel-perl-0.2002/debian/watch /tmp/E53S3Z70Yv/libsub-uplevel-perl-0.2200/debian/watch --- libsub-uplevel-perl-0.2002/debian/watch 2009-12-01 00:12:19.000000000 +0000 +++ libsub-uplevel-perl-0.2200/debian/watch 2009-12-01 00:12:19.000000000 +0000 @@ -1,3 +1,3 @@ version=3 opts="uversionmangle=s/\.\d{2}$/$&00/" \ -http://search.cpan.org/dist/Sub-Uplevel/ .*/Sub-Uplevel-v?(\d[\d_.]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip) +http://search.cpan.org/dist/Sub-Uplevel/ .*/Sub-Uplevel-v?(\d[\d.]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip) diff -Nru /tmp/R7lqZqQJqq/libsub-uplevel-perl-0.2002/lib/Sub/Uplevel.pm /tmp/E53S3Z70Yv/libsub-uplevel-perl-0.2200/lib/Sub/Uplevel.pm --- libsub-uplevel-perl-0.2002/lib/Sub/Uplevel.pm 2008-09-11 19:34:02.000000000 +0100 +++ libsub-uplevel-perl-0.2200/lib/Sub/Uplevel.pm 2009-11-17 10:39:43.000000000 +0000 @@ -2,30 +2,47 @@ use 5.006; use strict; -our $VERSION = '0.2002'; +our $VERSION = '0.22'; $VERSION = eval $VERSION; +# We must override *CORE::GLOBAL::caller if it hasn't already been +# overridden or else Perl won't see our local override later. + +if ( not defined *CORE::GLOBAL::caller{CODE} ) { + *CORE::GLOBAL::caller = \&_normal_caller; +} + +# modules to force reload if ":aggressive" is specified +my @reload_list = qw/Exporter Exporter::Heavy/; + sub import { no strict 'refs'; my ($class, @args) = @_; - for my $fcn ( @args ) { - if ( $fcn ne 'uplevel' ) { - die qq{"$fcn" is not exported by the $class module\n} + for my $tag ( @args, 'uplevel' ) { + if ( $tag eq 'uplevel' ) { + my $caller = caller(0); + *{"$caller\::uplevel"} = \&uplevel; + } + elsif( $tag eq ':aggressive' ) { + _force_reload( @reload_list ); + } + else { + die qq{"$tag" is not exported by the $class module\n} } } - my $caller = caller(0); - *{"$caller\::uplevel"} = \&uplevel; return; } -# We must override *CORE::GLOBAL::caller if it hasn't already been -# overridden or else Perl won't see our local override later. - -if ( not defined *CORE::GLOBAL::caller{CODE} ) { - *CORE::GLOBAL::caller = \&_normal_caller; +sub _force_reload { + no warnings 'redefine'; + local $^W = 0; + for my $m ( @_ ) { + $m =~ s{::}{/}g; + $m .= ".pm"; + require $m if delete $INC{$m}; + } } - - + =head1 NAME Sub::Uplevel - apparently run a function in a higher stack frame @@ -280,7 +297,8 @@ =head1 BUGS and CAVEATS Well, the bad news is uplevel() is about 5 times slower than a normal -function call. XS implementation anyone? +function call. XS implementation anyone? It also slows down every invocation +of caller(), regardless of whether uplevel() is in effect. Sub::Uplevel overrides CORE::GLOBAL::caller temporarily for the scope of each uplevel call. It does its best to work with any previously existing @@ -290,6 +308,19 @@ However, if you are routinely using multiple modules that override CORE::GLOBAL::caller, you are probably asking for trouble. +You B load Sub::Uplevel as early as possible within your program. As +with all CORE::GLOBAL overloading, the overload will not affect modules that +have already been compiled prior to the overload. One module that often is +unavoidably loaded prior to Sub::Uplevel is Exporter. To forceably recompile +Exporter (and Exporter::Heavy) after loading Sub::Uplevel, use it with the +":aggressive" tag: + + use Sub::Uplevel qw/:aggressive/; + +The private function C may be passed a list of +additional modules to reload if ":aggressive" is not aggressive enough. +Reloading modules may break things, so only use this as a last resort. + As of version 0.20, Sub::Uplevel requires Perl 5.6 or greater. =head1 HISTORY diff -Nru /tmp/R7lqZqQJqq/libsub-uplevel-perl-0.2002/lib/Sub/Uplevel.pod /tmp/E53S3Z70Yv/libsub-uplevel-perl-0.2200/lib/Sub/Uplevel.pod --- libsub-uplevel-perl-0.2002/lib/Sub/Uplevel.pod 2008-09-11 19:34:02.000000000 +0100 +++ libsub-uplevel-perl-0.2200/lib/Sub/Uplevel.pod 2009-11-17 10:39:43.000000000 +0000 @@ -8,7 +8,7 @@ =head1 VERSION -This documentation describes version 0.2002 +This documentation describes version 0.22 =head1 SYNOPSIS @@ -137,7 +137,8 @@ =head1 BUGS and CAVEATS Well, the bad news is uplevel() is about 5 times slower than a normal -function call. XS implementation anyone? +function call. XS implementation anyone? It also slows down every invocation +of caller(), regardless of whether uplevel() is in effect. Sub::Uplevel overrides CORE::GLOBAL::caller temporarily for the scope of each uplevel call. It does its best to work with any previously existing @@ -147,6 +148,19 @@ However, if you are routinely using multiple modules that override CORE::GLOBAL::caller, you are probably asking for trouble. +You B load Sub::Uplevel as early as possible within your program. As +with all CORE::GLOBAL overloading, the overload will not affect modules that +have already been compiled prior to the overload. One module that often is +unavoidably loaded prior to Sub::Uplevel is Exporter. To forceably recompile +Exporter (and Exporter::Heavy) after loading Sub::Uplevel, use it with the +":aggressive" tag: + + use Sub::Uplevel qw/:aggressive/; + +The private function C may be passed a list of +additional modules to reload if ":aggressive" is not aggressive enough. +Reloading modules may break things, so only use this as a last resort. + As of version 0.20, Sub::Uplevel requires Perl 5.6 or greater. =head1 HISTORY diff -Nru /tmp/R7lqZqQJqq/libsub-uplevel-perl-0.2002/Makefile.PL /tmp/E53S3Z70Yv/libsub-uplevel-perl-0.2200/Makefile.PL --- libsub-uplevel-perl-0.2002/Makefile.PL 2008-09-11 19:34:02.000000000 +0100 +++ libsub-uplevel-perl-0.2200/Makefile.PL 2009-11-17 10:39:43.000000000 +0000 @@ -1,4 +1,4 @@ -# Note: this file was auto-generated by Module::Build::Compat version 0.2808_01 +# Note: this file was auto-generated by Module::Build::Compat version 0.35_08 require 5.006; use ExtUtils::MakeMaker; WriteMakefile diff -Nru /tmp/R7lqZqQJqq/libsub-uplevel-perl-0.2002/MANIFEST /tmp/E53S3Z70Yv/libsub-uplevel-perl-0.2200/MANIFEST --- libsub-uplevel-perl-0.2002/MANIFEST 2008-09-11 19:34:02.000000000 +0100 +++ libsub-uplevel-perl-0.2200/MANIFEST 2009-11-17 10:39:43.000000000 +0000 @@ -18,7 +18,10 @@ t/05_honor_prior_override.t t/06_db_args.t t/07_uplevel_too_high.t +t/08_exporter.t +t/lib/Bar.pm t/lib/Foo.pm +t/lib/Importer.pm Todo xt/critic.t xt/perlcriticrc diff -Nru /tmp/R7lqZqQJqq/libsub-uplevel-perl-0.2002/MANIFEST.SKIP /tmp/E53S3Z70Yv/libsub-uplevel-perl-0.2200/MANIFEST.SKIP --- libsub-uplevel-perl-0.2002/MANIFEST.SKIP 2008-09-11 19:34:02.000000000 +0100 +++ libsub-uplevel-perl-0.2200/MANIFEST.SKIP 2009-11-17 10:39:43.000000000 +0000 @@ -16,6 +16,7 @@ # Module::Build ^Build$ ^_build +^MYMETA # Temp, old, vi and emacs files. ~$ diff -Nru /tmp/R7lqZqQJqq/libsub-uplevel-perl-0.2002/META.yml /tmp/E53S3Z70Yv/libsub-uplevel-perl-0.2200/META.yml --- libsub-uplevel-perl-0.2002/META.yml 2008-09-11 19:34:02.000000000 +0100 +++ libsub-uplevel-perl-0.2200/META.yml 2009-11-17 10:39:43.000000000 +0000 @@ -1,30 +1,33 @@ --- -name: Sub-Uplevel -version: 0.2002 +abstract: 'apparently run a function in a higher stack frame' author: - 'David A. Golden ' -abstract: apparently run a function in a higher stack frame -license: perl -resources: - license: http://dev.perl.org/licenses/ -requires: - perl: 5.006 build_requires: Carp: 0 Test::More: 0.47 -provides: - DB: - file: lib/Sub/Uplevel.pm - Sub::Uplevel: - file: lib/Sub/Uplevel.pm - version: 0.2002 -generated_by: Module::Build version 0.280801 +configure_requires: + Module::Build: 0.35 +generated_by: 'Module::Build version 0.3508' +license: perl meta-spec: - url: http://module-build.sourceforge.net/META-spec-v1.2.html - version: 1.2 + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 +name: Sub-Uplevel no_index: directory: - examples - inc package: - DB +provides: + DB: + file: lib/Sub/Uplevel.pm + Sub::Uplevel: + file: lib/Sub/Uplevel.pm + version: 0.22 +requires: + perl: 5.006 +resources: + license: http://dev.perl.org/licenses/ + repository: http://github.com/dagolden/sub-uplevel +version: 0.22 diff -Nru /tmp/R7lqZqQJqq/libsub-uplevel-perl-0.2002/README /tmp/E53S3Z70Yv/libsub-uplevel-perl-0.2200/README --- libsub-uplevel-perl-0.2002/README 2008-09-11 19:34:02.000000000 +0100 +++ libsub-uplevel-perl-0.2200/README 2009-11-17 10:39:43.000000000 +0000 @@ -2,7 +2,7 @@ Sub::Uplevel - apparently run a function in a higher stack frame VERSION - This documentation describes version 0.2002 + This documentation describes version 0.22 SYNOPSIS use Sub::Uplevel; @@ -33,7 +33,7 @@ caller($frames) it will actually give caller($frames + $num_frames) for them. - "uplevel(1, \&some_func, @_)" is effectively "goto &some_func" but + `uplevel(1, \&some_func, @_)' is effectively `goto &some_func' but you don't immediately exit the current subroutine. So while you can't do this: @@ -52,7 +52,7 @@ return @out; } - "uplevel" will issue a warning if $num_frames is more than the + `uplevel' will issue a warning if `$num_frames' is more than the current call stack depth. EXAMPLE @@ -73,7 +73,8 @@ BUGS and CAVEATS Well, the bad news is uplevel() is about 5 times slower than a normal - function call. XS implementation anyone? + function call. XS implementation anyone? It also slows down every + invocation of caller(), regardless of whether uplevel() is in effect. Sub::Uplevel overrides CORE::GLOBAL::caller temporarily for the scope of each uplevel call. It does its best to work with any previously existing @@ -83,6 +84,20 @@ However, if you are routinely using multiple modules that override CORE::GLOBAL::caller, you are probably asking for trouble. + You should load Sub::Uplevel as early as possible within your program. + As with all CORE::GLOBAL overloading, the overload will not affect + modules that have already been compiled prior to the overload. One + module that often is unavoidably loaded prior to Sub::Uplevel is + Exporter. To forceably recompile Exporter (and Exporter::Heavy) after + loading Sub::Uplevel, use it with the ":aggressive" tag: + + use Sub::Uplevel qw/:aggressive/; + + The private function `Sub::Uplevel::_force_reload()' may be passed a + list of additional modules to reload if ":aggressive" is not aggressive + enough. Reloading modules may break things, so only use this as a last + resort. + As of version 0.20, Sub::Uplevel requires Perl 5.6 or greater. HISTORY diff -Nru /tmp/R7lqZqQJqq/libsub-uplevel-perl-0.2002/t/08_exporter.t /tmp/E53S3Z70Yv/libsub-uplevel-perl-0.2200/t/08_exporter.t --- libsub-uplevel-perl-0.2002/t/08_exporter.t 1970-01-01 01:00:00.000000000 +0100 +++ libsub-uplevel-perl-0.2200/t/08_exporter.t 2009-11-17 10:39:43.000000000 +0000 @@ -0,0 +1,15 @@ +use lib qw(t/lib); +use strict; +use Test::More; + +plan tests => 1; + +# Goal of these tests: confirm that Sub::Uplevel will work with Exporter's +# import() function + +package main; +require Importer; +require Bar; +Importer::import_for_me('Bar','func3'); +can_ok('main','func3'); + diff -Nru /tmp/R7lqZqQJqq/libsub-uplevel-perl-0.2002/t/lib/Bar.pm /tmp/E53S3Z70Yv/libsub-uplevel-perl-0.2200/t/lib/Bar.pm --- libsub-uplevel-perl-0.2002/t/lib/Bar.pm 1970-01-01 01:00:00.000000000 +0100 +++ libsub-uplevel-perl-0.2200/t/lib/Bar.pm 2009-11-17 10:39:43.000000000 +0000 @@ -0,0 +1,8 @@ +package Bar; +use warnings; +use strict; +require Exporter; +our @ISA = qw(Exporter); +our @EXPORT_OK = qw( func3 ); +sub func3 { 3 } +1; diff -Nru /tmp/R7lqZqQJqq/libsub-uplevel-perl-0.2002/t/lib/Importer.pm /tmp/E53S3Z70Yv/libsub-uplevel-perl-0.2200/t/lib/Importer.pm --- libsub-uplevel-perl-0.2002/t/lib/Importer.pm 1970-01-01 01:00:00.000000000 +0100 +++ libsub-uplevel-perl-0.2200/t/lib/Importer.pm 2009-11-17 10:39:43.000000000 +0000 @@ -0,0 +1,15 @@ +package Importer; +use warnings; +use strict; +use Sub::Uplevel qw/:aggressive/; +sub import_for_me { + my ($pkg, @p) = @_; + my $level = 1; + my $import = $pkg->can('import'); + if ($import) { + uplevel $level, $import, ($pkg, @p); + } else { + warn "no import in $pkg\n"; + } +} +1;