[Bps-public-commit] Module-Refresh branch, master, updated. 0608b4f71672b9a4b07a06ef1d95b7a446b35228

Jesse Vincent jesse at bestpractical.com
Tue Apr 12 04:10:24 EDT 2011


The branch, master has been updated
       via  0608b4f71672b9a4b07a06ef1d95b7a446b35228 (commit)
       via  12165463bdb498351ee80315d5b91999b009563b (commit)
       via  e71b2fd703f88cd9bebfebeebc1de85f95474d4c (commit)
      from  58fb2de2757af7cd6102dde160e47b9baf142bd4 (commit)

Summary of changes:
 Changes               |    3 +++
 MANIFEST              |    3 ++-
 SIGNATURE             |   40 ++++++++++++++++++++++++++++++++++++++++
 lib/Module/Refresh.pm |   17 ++++++++++++-----
 t/clear_symtable.t    |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 106 insertions(+), 6 deletions(-)
 create mode 100644 SIGNATURE
 create mode 100644 t/clear_symtable.t

- Log -----------------------------------------------------------------
commit e71b2fd703f88cd9bebfebeebc1de85f95474d4c
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Apr 12 18:06:13 2011 +1000

    Tests for [rt.cpan.org #67262] subroutines not being unloaded - Jesse Luehrs

diff --git a/t/clear_symtable.t b/t/clear_symtable.t
new file mode 100644
index 0000000..344497b
--- /dev/null
+++ b/t/clear_symtable.t
@@ -0,0 +1,49 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
+use Module::Refresh;
+
+use File::Temp;
+use Path::Class;
+
+my $dir = File::Temp->newdir;
+push @INC, $dir->dirname;
+
+dir($dir)->file('Foo.pm')->openw->print(<<'PM');
+package Foo;
+sub bar { }
+1;
+PM
+
+require Foo;
+
+Module::Refresh->refresh;
+
+can_ok('Foo', 'bar');
+ok(!Foo->can('baz'), "!Foo->can('baz')");
+
+sleep 2;
+
+dir($dir)->file('Foo.pm')->openw->print(<<'PM');
+package Foo;
+sub baz { }
+1;
+PM
+
+Module::Refresh->refresh;
+
+can_ok('Foo', 'baz');
+ok(!Foo->can('bar'), "!Foo->can('bar')");
+
+done_testing;
+__END__
+ok 1 - Foo->can('bar')
+ok 2 - !Foo->can('baz')
+ok 3 - Foo->can('baz')
+not ok 4 - !Foo->can('bar')
+#   Failed test '!Foo->can('bar')'
+#   at test.pl line 38.
+1..4
+# Looks like you failed 1 test of 4.

commit 12165463bdb498351ee80315d5b91999b009563b
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Apr 12 18:07:24 2011 +1000

    Fixes for [rt.cpan.org #67262] subroutines not being unloaded

diff --git a/Changes b/Changes
index b3c8964..5e362f4 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,6 @@
 
+ * Actually remove subroutines from the symbol table, Thanks to DOY.
+
 0.13 Thu May  3 23:03:00 EDT 2007
 
  * Requires 5.8.1. (Uses tricks that don't work on 5.6). Thanks to DCANTRELL
diff --git a/MANIFEST b/MANIFEST
index 42c5d55..875e1a8 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,4 +1,3 @@
-SIGNATURE 
 Changes
 inc/Module/Install.pm
 inc/Module/Install/Base.pm
@@ -12,6 +11,8 @@ lib/Module/Refresh.pm
 Makefile.PL
 MANIFEST			This list of files
 META.yml
+SIGNATURE
 t/0-smoke.t
 t/1api.t
 t/2lateuse.t
+t/clear_symtable.t
diff --git a/lib/Module/Refresh.pm b/lib/Module/Refresh.pm
index ce6259c..b8bf3c3 100644
--- a/lib/Module/Refresh.pm
+++ b/lib/Module/Refresh.pm
@@ -177,10 +177,16 @@ sub unload_subs {
     foreach my $sym ( grep { index( $DB::sub{$_}, "$file:" ) == 0 }
         keys %DB::sub )
     {
+
         warn "Deleting $sym from $file" if ( $sym =~ /freeze/ );
         eval { undef &$sym };
         warn "$sym: $@" if $@;
         delete $DB::sub{$sym};
+        { no strict 'refs';
+            if ($sym =~ /^(.*::)(.*?)$/) {
+                delete *{$1}->{$2};
+            }
+        } 
     }
 
     return $self;
@@ -205,8 +211,9 @@ BEGIN {
 
 =head1 BUGS
 
-When we walk the symbol table to whack reloaded subroutines, we don't have a good way
-to invalidate the symbol table.
+When we walk the symbol table to whack reloaded subroutines, we don't
+have a good way to invalidate the symbol table properly, so we mess up
+on things like global variables that were previously set.
 
 =head1 SEE ALSO
 
@@ -214,8 +221,8 @@ L<Apache::StatINC>, L<Module::Reload>
 
 =head1 COPYRIGHT
 
-Copyright 2004 by Jesse Vincent E<lt>jesse at bestpractical.comE<gt>,
-Autrijus Tang E<lt>autrijus at autrijus.orgE<gt>
+Copyright 2004,2011 by Jesse Vincent E<lt>jesse at bestpractical.comE<gt>,
+Audrey Tang E<lt>audreyt at audreyt.orgE<gt>
 
 This program is free software; you can redistribute it and/or 
 modify it under the same terms as Perl itself.

commit 0608b4f71672b9a4b07a06ef1d95b7a446b35228
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Apr 12 18:09:16 2011 +1000

    0.14

diff --git a/Changes b/Changes
index 5e362f4..25233a1 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,4 @@
+0.14 Tue Apr 12 18:07:44 EST 2011
 
  * Actually remove subroutines from the symbol table, Thanks to DOY.
 
diff --git a/SIGNATURE b/SIGNATURE
new file mode 100644
index 0000000..4f25c43
--- /dev/null
+++ b/SIGNATURE
@@ -0,0 +1,40 @@
+This file contains message digests of all files listed in MANIFEST,
+signed via the Module::Signature module, version 0.66.
+
+To verify the content in this distribution, first make sure you have
+Module::Signature installed, then type:
+
+    % cpansign -v
+
+It will check each file's integrity, as well as the signature's
+validity.  If "==> Signature verified OK! <==" is not displayed,
+the distribution may already have been compromised, and you should
+not run its Makefile.PL or Build.PL.
+
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+SHA1 c319570e3ba54dd6637c447c67a8b739623ee31a Changes
+SHA1 68778c52d10c41f67e469665dd332886a6c628e6 MANIFEST
+SHA1 b7486e3cbe8cb200c626c9c5c8e0a16b13affb0c META.yml
+SHA1 67db1c195cf3a6397112cbb3639553e7d3bd8bab Makefile.PL
+SHA1 0de53a33616127f8680e6e4118741e80f354cd3e inc/Module/Install.pm
+SHA1 11d43fa1484b63eb90b0a3a1b62dcb7e71060084 inc/Module/Install/Base.pm
+SHA1 d3122b9f825c49da1184636699531ac0a7844da0 inc/Module/Install/Can.pm
+SHA1 9f146b26e914b78d7f07559d1810bca6d96c2bc7 inc/Module/Install/Fetch.pm
+SHA1 836dc65ebcb2913f5a7da77ddba4b6d46bd98f99 inc/Module/Install/Makefile.pm
+SHA1 2d0fae3f1ecf71666075b39911cb4694b1310edd inc/Module/Install/Metadata.pm
+SHA1 71c0f2e04d98c302c22d92b03ab8852f768b6431 inc/Module/Install/Win32.pm
+SHA1 ea6fe523768b5c7d8a50528fbc18885bb0901d88 inc/Module/Install/WriteAll.pm
+SHA1 eb9346b7280652fcd17cb01fdb0f653a455ddf0f lib/Module/Refresh.pm
+SHA1 59ee3fb5cc33fa83f37010c6f1bbffc96169c3d4 t/0-smoke.t
+SHA1 9103ce09992aa9abff57823a090e109b1e9511a5 t/1api.t
+SHA1 d6fce094ee7fb7e800f646ac216dcc4a8a45f7db t/2lateuse.t
+SHA1 ca479c7b8ae0997a66d18c00216ac44c1346cbc4 t/clear_symtable.t
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.11 (GNU/Linux)
+
+iEYEARECAAYFAk2kCJQACgkQEi9d9xCOQEbuRwCguO+nwibDF2xnnsWUthVu5iFH
+czoAoMe6gAYBCPvfMA3MX3tkI1+FCdO/
+=YPJG
+-----END PGP SIGNATURE-----
diff --git a/lib/Module/Refresh.pm b/lib/Module/Refresh.pm
index b8bf3c3..9681b60 100644
--- a/lib/Module/Refresh.pm
+++ b/lib/Module/Refresh.pm
@@ -3,7 +3,7 @@ package Module::Refresh;
 use strict;
 use vars qw( $VERSION %CACHE );
 
-$VERSION = "0.13";
+$VERSION = "0.14";
 
 BEGIN {
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list