r31333 - in /trunk/libnamespace-clean-perl: ./ debian/ inc/Module/ inc/Module/Install/ lib/namespace/ t/ t/lib/
antonio-guest at users.alioth.debian.org
antonio-guest at users.alioth.debian.org
Tue Mar 3 21:04:50 UTC 2009
Author: antonio-guest
Date: Tue Mar 3 21:04:44 2009
New Revision: 31333
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=31333
Log:
* New upstream release
* debian/control:
+ Adding me to the Uploaders
+ bumping the dependency of libb-hooks-endofscope-perl to 0.07
* debian/copyright:
+ added the names of the contributor from "Debian Perl Group"
+ added the headers of Artistic and GPL-1+
+ added copyright info for Module::Install
Added:
trunk/libnamespace-clean-perl/t/05-explicit-cleanee.t
- copied unchanged from r31332, branches/upstream/libnamespace-clean-perl/current/t/05-explicit-cleanee.t
trunk/libnamespace-clean-perl/t/lib/CleaneeBridge.pm
- copied unchanged from r31332, branches/upstream/libnamespace-clean-perl/current/t/lib/CleaneeBridge.pm
trunk/libnamespace-clean-perl/t/lib/CleaneeBridgeDirect.pm
- copied unchanged from r31332, branches/upstream/libnamespace-clean-perl/current/t/lib/CleaneeBridgeDirect.pm
trunk/libnamespace-clean-perl/t/lib/CleaneeBridgeExplicit.pm
- copied unchanged from r31332, branches/upstream/libnamespace-clean-perl/current/t/lib/CleaneeBridgeExplicit.pm
trunk/libnamespace-clean-perl/t/lib/CleaneeTarget.pm
- copied unchanged from r31332, branches/upstream/libnamespace-clean-perl/current/t/lib/CleaneeTarget.pm
Modified:
trunk/libnamespace-clean-perl/Changes
trunk/libnamespace-clean-perl/MANIFEST
trunk/libnamespace-clean-perl/META.yml
trunk/libnamespace-clean-perl/Makefile.PL
trunk/libnamespace-clean-perl/README
trunk/libnamespace-clean-perl/debian/changelog
trunk/libnamespace-clean-perl/debian/control
trunk/libnamespace-clean-perl/debian/copyright
trunk/libnamespace-clean-perl/inc/Module/Install.pm
trunk/libnamespace-clean-perl/inc/Module/Install/AutoInstall.pm
trunk/libnamespace-clean-perl/inc/Module/Install/Base.pm
trunk/libnamespace-clean-perl/inc/Module/Install/Can.pm
trunk/libnamespace-clean-perl/inc/Module/Install/Fetch.pm
trunk/libnamespace-clean-perl/inc/Module/Install/Include.pm
trunk/libnamespace-clean-perl/inc/Module/Install/Makefile.pm
trunk/libnamespace-clean-perl/inc/Module/Install/Metadata.pm
trunk/libnamespace-clean-perl/inc/Module/Install/Win32.pm
trunk/libnamespace-clean-perl/inc/Module/Install/WriteAll.pm
trunk/libnamespace-clean-perl/lib/namespace/clean.pm
Modified: trunk/libnamespace-clean-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnamespace-clean-perl/Changes?rev=31333&op=diff
==============================================================================
--- trunk/libnamespace-clean-perl/Changes (original)
+++ trunk/libnamespace-clean-perl/Changes Tue Mar 3 21:04:44 2009
@@ -1,3 +1,11 @@
+ [0.11] Tue Mar 3 17:34:49 CET 2009
+ - Added -cleanee option to specify the package to clean (Closes
+ RT#41850).
+ - Added n:c->clean_subroutines($cleanee, @subs).
+
+ [0.10] Fri Feb 20 14:31:36 CET 2009
+ - Depend on B::Hooks::EndOfScope 0.07 to avoid segfaults and lost error
+ messages when something goes wrong.
[0.09] Wed Oct 22 17:48:49 CEST 2008
- Use B::Hooks::EndOfScope instead of %^H + Scope::Guard.
Modified: trunk/libnamespace-clean-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnamespace-clean-perl/MANIFEST?rev=31333&op=diff
==============================================================================
--- trunk/libnamespace-clean-perl/MANIFEST (original)
+++ trunk/libnamespace-clean-perl/MANIFEST Tue Mar 3 21:04:44 2009
@@ -20,6 +20,11 @@
t/02-inheritance.t
t/03-unimport.t
t/04-except.t
+t/05-explicit-cleanee.t
+t/lib/CleaneeBridge.pm
+t/lib/CleaneeBridgeDirect.pm
+t/lib/CleaneeBridgeExplicit.pm
+t/lib/CleaneeTarget.pm
t/lib/ExporterTest.pm
t/lib/FunctionWipeout.pm
t/lib/Inheritance.pm
Modified: trunk/libnamespace-clean-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnamespace-clean-perl/META.yml?rev=31333&op=diff
==============================================================================
--- trunk/libnamespace-clean-perl/META.yml (original)
+++ trunk/libnamespace-clean-perl/META.yml Tue Mar 3 21:04:44 2009
@@ -6,7 +6,7 @@
FindBin: 0
Test::More: 0.62
distribution_type: module
-generated_by: 'Module::Install version 0.77'
+generated_by: 'Module::Install version 0.79'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -16,13 +16,9 @@
directory:
- inc
- t
-provides:
- namespace::clean:
- file: lib/namespace/clean.pm
- version: 0.09
requires:
- B::Hooks::EndOfScope: 0
+ B::Hooks::EndOfScope: 0.07
Symbol: 0
resources:
license: http://dev.perl.org/licenses/
-version: 0.09
+version: 0.11
Modified: trunk/libnamespace-clean-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnamespace-clean-perl/Makefile.PL?rev=31333&op=diff
==============================================================================
--- trunk/libnamespace-clean-perl/Makefile.PL (original)
+++ trunk/libnamespace-clean-perl/Makefile.PL Tue Mar 3 21:04:44 2009
@@ -6,13 +6,13 @@
name q{namespace-clean};
license q{perl};
-author q{Robert 'phaylon' Sedlacek <rs at 474.at>};
+author q{Robert 'phaylon'' Sedlacek <rs at 474.at>};
all_from q{lib/namespace/clean.pm};
build_requires q{Test::More}, '0.62';
build_requires q{FindBin}, 0;
-requires q{B::Hooks::EndOfScope}, 0;
+requires q{B::Hooks::EndOfScope}, '0.07';
requires q{Symbol}, 0;
auto_provides;
Modified: trunk/libnamespace-clean-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnamespace-clean-perl/README?rev=31333&op=diff
==============================================================================
--- trunk/libnamespace-clean-perl/README (original)
+++ trunk/libnamespace-clean-perl/README Tue Mar 3 21:04:44 2009
@@ -2,7 +2,7 @@
namespace::clean - Keep imports and functions out of your namespace
VERSION
- 0.08
+ 0.11
SYNOPSIS
package Foo;
@@ -91,13 +91,44 @@
Same goes for Moose::Role.
+ Cleaning other packages
+ You can tell "namespace::clean" that you want to clean up another
+ package instead of the one importing. To do this you have to pass in the
+ "-cleanee" option like this:
+
+ package My::MooseX::namespace::clean;
+ use strict;
+
+ use namespace::clean (); # no cleanup, just load
+
+ sub import {
+ namespace::clean->import(
+ -cleanee => scalar(caller),
+ -except => 'meta',
+ );
+ }
+
+ If you don't care about "namespace::clean"s discover-and-"-except"
+ logic, and just want to remove subroutines, try "clean_subroutines".
+
METHODS
You shouldn't need to call any of these. Just "use" the package at the
appropriate place.
+ clean_subroutines
+ This exposes the actual subroutine-removal logic.
+
+ namespace::clean->clean_subroutines($cleanee, qw( subA subB ));
+
+ will remove "subA" and "subB" from $cleanee. Note that this will remove
+ the subroutines immediately and not wait for scope end. If you want to
+ have this effect at a specific time (e.g. "namespace::clean" acts on
+ scope compile end) it is your responsibility to make sure it runs at
+ that time.
+
import
Makes a snapshot of the current defined functions and installs a
- Scope::Guard in the current scope to invoke the cleanups.
+ B::Hooks::EndOfScope hook in the current scope to invoke the cleanups.
unimport
This method will be called when you do a
@@ -132,7 +163,7 @@
use "undef" instead.
SEE ALSO
- Scope::Guard
+ B::Hooks::EndOfScope
AUTHOR AND COPYRIGHT
Robert 'phaylon' Sedlacek "<rs at 474.at>", with many thanks to Matt S
Modified: trunk/libnamespace-clean-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnamespace-clean-perl/debian/changelog?rev=31333&op=diff
==============================================================================
--- trunk/libnamespace-clean-perl/debian/changelog (original)
+++ trunk/libnamespace-clean-perl/debian/changelog Tue Mar 3 21:04:44 2009
@@ -1,3 +1,16 @@
+libnamespace-clean-perl (0.11-1) UNRELEASED; urgency=low
+
+ * New upstream release
+ * debian/control:
+ + Adding me to the Uploaders
+ + bumping the dependency of libb-hooks-endofscope-perl to 0.07
+ * debian/copyright:
+ + added the names of the contributor from "Debian Perl Group"
+ + added the headers of Artistic and GPL-1+
+ + added copyright info for Module::Install
+
+ -- Antonio Radici <antonio at dyne.org> Tue, 03 Mar 2009 20:42:05 +0000
+
libnamespace-clean-perl (0.09-1) unstable; urgency=low
[ Jose Luis Rivas ]
Modified: trunk/libnamespace-clean-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnamespace-clean-perl/debian/control?rev=31333&op=diff
==============================================================================
--- trunk/libnamespace-clean-perl/debian/control (original)
+++ trunk/libnamespace-clean-perl/debian/control Tue Mar 3 21:04:44 2009
@@ -2,11 +2,12 @@
Section: perl
Priority: optional
Build-Depends: debhelper (>= 7)
-Build-Depends-Indep: perl (>= 5.8.8-7), libb-hooks-endofscope-perl
+Build-Depends-Indep: perl (>= 5.8.8-7), libb-hooks-endofscope-perl (>= 0.07)
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Damyan Ivanov <dmn at debian.org>,
Rene Mayorga <rmayorga at debian.org.sv>,
- gregor herrmann <gregoa at debian.org>
+ gregor herrmann <gregoa at debian.org>,
+ Antonio Radici <antonio at dyne.org>
Standards-Version: 3.8.0
Homepage: http://search.cpan.org/dist/namespace-clean/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libnamespace-clean-perl/
@@ -14,7 +15,7 @@
Package: libnamespace-clean-perl
Architecture: all
-Depends: ${perl:Depends}, ${misc:Depends}, libb-hooks-endofscope-perl
+Depends: ${perl:Depends}, ${misc:Depends}, libb-hooks-endofscope-perl (>= 0.07)
Description: Keep imports and functions out of the current namespace
When you define a function, or import one, into a Perl package, it will
naturally also be available as a method. This does not per se cause problems,
Modified: trunk/libnamespace-clean-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnamespace-clean-perl/debian/copyright?rev=31333&op=diff
==============================================================================
--- trunk/libnamespace-clean-perl/debian/copyright (original)
+++ trunk/libnamespace-clean-perl/debian/copyright Tue Mar 3 21:04:44 2009
@@ -6,20 +6,31 @@
Original-Source-Depends: devscripts
Files: *
-Copyright © 2007 Robert 'phaylon' Sedlacek "<rs at 474.at>", with many
- thanks to Matt S Trout for the inspiration on the whole
- idea.
+Copyright: © 2007, Robert 'phaylon' Sedlacek <rs at 474.at>
License: GPL-1+ | Artistic
- This program is free software; you can redistribute
- it and/or modify it under the same terms as Perl itself.
+
+Files: inc/*
+Copyright: © 2002-2009, Brian Ingerson, Audrey Tang and Adam Kennedy
+License: GPL-1+ | Artistic
Files: debian/*
-Copyright: © 2007 Damyan Ivanov <dmn at debian.org>
- © 2007-2008 Debian Perl Group <debian-perl at lists.debian.org>
+Copyright: © 2007, Damyan Ivanov <dmn at debian.org>
+ © 2008, Rene Mayorga <rmayorga at debian.org.sv>
+ © 2008, gregor herrmann <gregoa at debian.org>
+ © 2008, Roberto C. Sanchez <roberto at debian.org>
+ © 2009, Antonio Radici <antonio at dyne.org>
License: GPL-1+ | Artistic
-Perl is distributed under your choice of the GNU General Public License or
-the Artistic License. On Debian GNU/Linux systems, the complete text of the
-GNU General Public License can be found in `/usr/share/common-licenses/GPL'
-and the Artistic Licence in `/usr/share/common-licenses/Artistic'.
+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'
+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'
Modified: trunk/libnamespace-clean-perl/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnamespace-clean-perl/inc/Module/Install.pm?rev=31333&op=diff
==============================================================================
--- trunk/libnamespace-clean-perl/inc/Module/Install.pm (original)
+++ trunk/libnamespace-clean-perl/inc/Module/Install.pm Tue Mar 3 21:04:44 2009
@@ -30,7 +30,7 @@
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
- $VERSION = '0.77';
+ $VERSION = '0.79';
*inc::Module::Install::VERSION = *VERSION;
@inc::Module::Install::ISA = __PACKAGE__;
@@ -250,7 +250,7 @@
sub load_extensions {
my ($self, $path, $top) = @_;
- unless ( grep { lc $_ eq lc $self->{prefix} } @INC ) {
+ unless ( grep { !ref $_ and lc $_ eq lc $self->{prefix} } @INC ) {
unshift @INC, $self->{prefix};
}
@@ -366,4 +366,4 @@
1;
-# Copyright 2008 Adam Kennedy.
+# Copyright 2008 - 2009 Adam Kennedy.
Modified: trunk/libnamespace-clean-perl/inc/Module/Install/AutoInstall.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnamespace-clean-perl/inc/Module/Install/AutoInstall.pm?rev=31333&op=diff
==============================================================================
--- trunk/libnamespace-clean-perl/inc/Module/Install/AutoInstall.pm (original)
+++ trunk/libnamespace-clean-perl/inc/Module/Install/AutoInstall.pm Tue Mar 3 21:04:44 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.77';
+ $VERSION = '0.79';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
Modified: trunk/libnamespace-clean-perl/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnamespace-clean-perl/inc/Module/Install/Base.pm?rev=31333&op=diff
==============================================================================
--- trunk/libnamespace-clean-perl/inc/Module/Install/Base.pm (original)
+++ trunk/libnamespace-clean-perl/inc/Module/Install/Base.pm Tue Mar 3 21:04:44 2009
@@ -1,7 +1,7 @@
#line 1
package Module::Install::Base;
-$VERSION = '0.77';
+$VERSION = '0.79';
# Suspend handler for "redefined" warnings
BEGIN {
Modified: trunk/libnamespace-clean-perl/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnamespace-clean-perl/inc/Module/Install/Can.pm?rev=31333&op=diff
==============================================================================
--- trunk/libnamespace-clean-perl/inc/Module/Install/Can.pm (original)
+++ trunk/libnamespace-clean-perl/inc/Module/Install/Can.pm Tue Mar 3 21:04:44 2009
@@ -11,7 +11,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.77';
+ $VERSION = '0.79';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
Modified: trunk/libnamespace-clean-perl/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnamespace-clean-perl/inc/Module/Install/Fetch.pm?rev=31333&op=diff
==============================================================================
--- trunk/libnamespace-clean-perl/inc/Module/Install/Fetch.pm (original)
+++ trunk/libnamespace-clean-perl/inc/Module/Install/Fetch.pm Tue Mar 3 21:04:44 2009
@@ -6,20 +6,20 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.77';
+ $VERSION = '0.79';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
sub get_file {
my ($self, %args) = @_;
- my ($scheme, $host, $path, $file) =
+ my ($scheme, $host, $path, $file) =
$args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
if ( $scheme eq 'http' and ! eval { require LWP::Simple; 1 } ) {
$args{url} = $args{ftp_url}
or (warn("LWP support unavailable!\n"), return);
- ($scheme, $host, $path, $file) =
+ ($scheme, $host, $path, $file) =
$args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
}
Modified: trunk/libnamespace-clean-perl/inc/Module/Install/Include.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnamespace-clean-perl/inc/Module/Install/Include.pm?rev=31333&op=diff
==============================================================================
--- trunk/libnamespace-clean-perl/inc/Module/Install/Include.pm (original)
+++ trunk/libnamespace-clean-perl/inc/Module/Install/Include.pm Tue Mar 3 21:04:44 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.77';
+ $VERSION = '0.79';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
Modified: trunk/libnamespace-clean-perl/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnamespace-clean-perl/inc/Module/Install/Makefile.pm?rev=31333&op=diff
==============================================================================
--- trunk/libnamespace-clean-perl/inc/Module/Install/Makefile.pm (original)
+++ trunk/libnamespace-clean-perl/inc/Module/Install/Makefile.pm Tue Mar 3 21:04:44 2009
@@ -7,7 +7,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.77';
+ $VERSION = '0.79';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
@@ -64,7 +64,7 @@
my $self = shift;
my $clean = $self->makemaker_args->{clean} ||= {};
%$clean = (
- %$clean,
+ %$clean,
FILES => join ' ', grep { length $_ } ($clean->{FILES} || (), @_),
);
}
@@ -73,7 +73,7 @@
my $self = shift;
my $realclean = $self->makemaker_args->{realclean} ||= {};
%$realclean = (
- %$realclean,
+ %$realclean,
FILES => join ' ', grep { length $_ } ($realclean->{FILES} || (), @_),
);
}
@@ -124,7 +124,7 @@
$self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
- # Generate the
+ # Generate the
my $args = $self->makemaker_args;
$args->{DISTNAME} = $self->name;
$args->{NAME} = $self->module_name || $self->name;
@@ -196,7 +196,7 @@
my $top_class = ref($self->_top) || '';
my $top_version = $self->_top->VERSION || '';
- my $preamble = $self->preamble
+ my $preamble = $self->preamble
? "# Preamble by $top_class $top_version\n"
. $self->preamble
: '';
Modified: trunk/libnamespace-clean-perl/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnamespace-clean-perl/inc/Module/Install/Metadata.pm?rev=31333&op=diff
==============================================================================
--- trunk/libnamespace-clean-perl/inc/Module/Install/Metadata.pm (original)
+++ trunk/libnamespace-clean-perl/inc/Module/Install/Metadata.pm Tue Mar 3 21:04:44 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.77';
+ $VERSION = '0.79';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
@@ -176,18 +176,15 @@
"Did not provide a value to perl_version()"
);
- # Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
- # numbers (eg, 5.006001 or 5.008009).
-
- $version =~ s/^(\d+)\.(\d+)\.(\d+)$/sprintf("%d.%03d%03d",$1,$2,$3)/e;
-
- $version =~ s/_.+$//;
- $version = $version + 0; # Numify
+ # Normalize the version
+ $version = $self->_perl_version($version);
+
+ # We don't support the reall old versions
unless ( $version >= 5.005 ) {
die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n";
}
+
$self->{values}{perl_version} = $version;
- return 1;
}
sub license {
@@ -451,9 +448,6 @@
while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
$pattern =~ s{\s+}{\\s+}g;
if ( $license_text =~ /\b$pattern\b/i ) {
- if ( $osi and $license_text =~ /All rights reserved/i ) {
- print "WARNING: 'All rights reserved' in copyright may invalidate Open Source license.\n";
- }
$self->license($license);
return 1;
}
@@ -482,19 +476,70 @@
return 1;
}
-sub install_script {
- my $self = shift;
- my $args = $self->makemaker_args;
- my $exe = $args->{EXE_FILES} ||= [];
- foreach ( @_ ) {
- if ( -f $_ ) {
- push @$exe, $_;
- } elsif ( -d 'script' and -f "script/$_" ) {
- push @$exe, "script/$_";
- } else {
- die("Cannot find script '$_'");
- }
- }
+# Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
+# numbers (eg, 5.006001 or 5.008009).
+# Also, convert double-part versions (eg, 5.8)
+sub _perl_version {
+ my $v = $_[-1];
+ $v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e;
+ $v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e;
+ $v =~ s/(\.\d\d\d)000$/$1/;
+ $v =~ s/_.+$//;
+ if ( ref($v) ) {
+ $v = $v + 0; # Numify
+ }
+ return $v;
+}
+
+
+
+
+
+######################################################################
+# MYMETA.yml Support
+
+sub WriteMyMeta {
+ $_[0]->write_mymeta;
+}
+
+sub write_mymeta {
+ my $self = shift;
+
+ # If there's no existing META.yml there is nothing we can do
+ return unless -f 'META.yml';
+
+ # Merge the perl version into the dependencies
+ my $val = $self->Meta->{values};
+ my $perl = delete $val->{perl_version};
+ if ( $perl ) {
+ $val->{requires} ||= [];
+ my $requires = $val->{requires};
+
+ # Canonize to three-dot version after Perl 5.6
+ if ( $perl >= 5.006 ) {
+ $perl =~ s{^(\d+)\.(\d\d\d)(\d*)}{join('.', $1, int($2||0), int($3||0))}e
+ }
+ unshift @$requires, [ perl => $perl ];
+ }
+
+ # Load the advisory META.yml file
+ require YAML::Tiny;
+ my @yaml = YAML::Tiny::LoadFile('META.yml');
+ my $meta = $yaml[0];
+
+ # Overwrite the non-configure dependency hashs
+ delete $meta->{requires};
+ delete $meta->{build_requires};
+ delete $meta->{recommends};
+ if ( exists $val->{requires} ) {
+ $meta->{requires} = { map { @$_ } @{ $val->{requires} } };
+ }
+ if ( exists $val->{build_requires} ) {
+ $meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } };
+ }
+
+ # Save as the MYMETA.yml file
+ YAML::Tiny::DumpFile('MYMETA.yml', $meta);
}
1;
Modified: trunk/libnamespace-clean-perl/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnamespace-clean-perl/inc/Module/Install/Win32.pm?rev=31333&op=diff
==============================================================================
--- trunk/libnamespace-clean-perl/inc/Module/Install/Win32.pm (original)
+++ trunk/libnamespace-clean-perl/inc/Module/Install/Win32.pm Tue Mar 3 21:04:44 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.77';
+ $VERSION = '0.79';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
Modified: trunk/libnamespace-clean-perl/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnamespace-clean-perl/inc/Module/Install/WriteAll.pm?rev=31333&op=diff
==============================================================================
--- trunk/libnamespace-clean-perl/inc/Module/Install/WriteAll.pm (original)
+++ trunk/libnamespace-clean-perl/inc/Module/Install/WriteAll.pm Tue Mar 3 21:04:44 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.77';
+ $VERSION = '0.79';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
Modified: trunk/libnamespace-clean-perl/lib/namespace/clean.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnamespace-clean-perl/lib/namespace/clean.pm?rev=31333&op=diff
==============================================================================
--- trunk/libnamespace-clean-perl/lib/namespace/clean.pm (original)
+++ trunk/libnamespace-clean-perl/lib/namespace/clean.pm Tue Mar 3 21:04:44 2009
@@ -15,11 +15,11 @@
=head1 VERSION
-0.08
-
-=cut
-
-$VERSION = 0.09;
+0.11
+
+=cut
+
+$VERSION = '0.11';
$STORAGE_VAR = '__NAMESPACE_CLEAN_STORAGE';
=head1 SYNOPSIS
@@ -114,6 +114,27 @@
Same goes for L<Moose::Role>.
+=head2 Cleaning other packages
+
+You can tell C<namespace::clean> that you want to clean up another package
+instead of the one importing. To do this you have to pass in the C<-cleanee>
+option like this:
+
+ package My::MooseX::namespace::clean;
+ use strict;
+
+ use namespace::clean (); # no cleanup, just load
+
+ sub import {
+ namespace::clean->import(
+ -cleanee => scalar(caller),
+ -except => 'meta',
+ );
+ }
+
+If you don't care about C<namespace::clean>s discover-and-C<-except> logic, and
+just want to remove subroutines, try L</clean_subroutines>.
+
=head1 METHODS
You shouldn't need to call any of these. Just C<use> the package at the
@@ -121,14 +142,21 @@
=cut
-=head2 import
-
-Makes a snapshot of the current defined functions and installs a
-L<B::Hooks::EndOfScope> hook in the current scope to invoke the cleanups.
+=head2 clean_subroutines
+
+This exposes the actual subroutine-removal logic.
+
+ namespace::clean->clean_subroutines($cleanee, qw( subA subB ));
+
+will remove C<subA> and C<subB> from C<$cleanee>. Note that this will remove the
+subroutines B<immediately> and not wait for scope end. If you want to have this
+effect at a specific time (e.g. C<namespace::clean> acts on scope compile end)
+it is your responsibility to make sure it runs at that time.
=cut
my $RemoveSubs = sub {
+
my $cleanee = shift;
my $store = shift;
SYMBOL:
@@ -153,19 +181,38 @@
}
};
+sub clean_subroutines {
+ my ($nc, $cleanee, @subs) = @_;
+ $RemoveSubs->($cleanee, {}, @subs);
+}
+
+=head2 import
+
+Makes a snapshot of the current defined functions and installs a
+L<B::Hooks::EndOfScope> hook in the current scope to invoke the cleanups.
+
+=cut
+
sub import {
my ($pragma, @args) = @_;
my (%args, $is_explicit);
- if (@args and $args[0] =~ /^\-/) {
- %args = @args;
- @args = ();
- }
- elsif (@args) {
- $is_explicit++;
- }
-
- my $cleanee = caller;
+
+ ARG:
+ while (@args) {
+
+ if ($args[0] =~ /^\-/) {
+ my $key = shift @args;
+ my $value = shift @args;
+ $args{ $key } = $value;
+ }
+ else {
+ $is_explicit++;
+ last ARG;
+ }
+ }
+
+ my $cleanee = exists $args{ -cleanee } ? $args{ -cleanee } : scalar caller;
if ($is_explicit) {
on_scope_end {
$RemoveSubs->($cleanee, {}, @args);
@@ -215,10 +262,10 @@
=cut
sub unimport {
- my ($pragma) = @_;
+ my ($pragma, %args) = @_;
# the calling class, the current functions and our storage
- my $cleanee = caller;
+ my $cleanee = exists $args{ -cleanee } ? $args{ -cleanee } : scalar caller;
my $functions = $pragma->get_functions($cleanee);
my $store = $pragma->get_class_store($cleanee);
More information about the Pkg-perl-cvs-commits
mailing list