perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From go...@apache.org
Subject svn commit: r179448 - in /perl/modperl/trunk: Changes t/modules/reload.t t/response/TestModules/reload.pm xs/ModPerl/Util/Util_pm
Date Wed, 01 Jun 2005 22:44:02 GMT
Author: gozer
Date: Wed Jun  1 15:44:01 2005
New Revision: 179448

URL: http://svn.apache.org/viewcvs?rev=179448&view=rev
Log:
The pure-perl ModPerl::Util::unload_package implementation was
accidently deleting sub-stashes.

Reported-by: Mark <mark@immermail.com>


Modified:
    perl/modperl/trunk/Changes
    perl/modperl/trunk/t/modules/reload.t
    perl/modperl/trunk/t/response/TestModules/reload.pm
    perl/modperl/trunk/xs/ModPerl/Util/Util_pm

Modified: perl/modperl/trunk/Changes
URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/Changes?rev=179448&r1=179447&r2=179448&view=diff
==============================================================================
--- perl/modperl/trunk/Changes (original)
+++ perl/modperl/trunk/Changes Wed Jun  1 15:44:01 2005
@@ -12,6 +12,9 @@
 
 =item 2.0.1-dev
 
+The pure-perl ModPerl::Util::unload_package implementation was
+accidently deleting sub-stashes [Gozer]
+
 If running Makefile.PL unnatended (STDIN isn't a terminal or
 MP_PROMPT_DEFAULT=1), break out of potentially infinite prompt
 loops [Gozer]

Modified: perl/modperl/trunk/t/modules/reload.t
URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/modules/reload.t?rev=179448&r1=179447&r2=179448&view=diff
==============================================================================
--- perl/modperl/trunk/t/modules/reload.t (original)
+++ perl/modperl/trunk/t/modules/reload.t Wed Jun  1 15:44:01 2005
@@ -16,7 +16,7 @@
 my $module   = 'TestModules::reload';
 my $location = '/' . Apache::TestRequest::module2path($module);
 
-my @tests = qw(simple const prototype);
+my @tests = qw(simple const prototype subpackage);
 
 my $header = join '', <DATA>;
 
@@ -95,7 +95,9 @@
 
 use Apache2::Reload;
 
-our @methods = qw(simple const prototype);
+our @methods = qw(simple const prototype subpackage);
+
+sub subpackage { return Apache2::Reload::Test::SubPackage::subpackage() } 
 
 sub run {
     my $r = shift;

Modified: perl/modperl/trunk/t/response/TestModules/reload.pm
URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/response/TestModules/reload.pm?rev=179448&r1=179447&r2=179448&view=diff
==============================================================================
--- perl/modperl/trunk/t/response/TestModules/reload.pm (original)
+++ perl/modperl/trunk/t/response/TestModules/reload.pm Wed Jun  1 15:44:01 2005
@@ -9,9 +9,11 @@
 
 my $package = 'Apache2::Reload::Test';
 
+our $pass = 0;
+
 sub handler {
     my $r = shift;
-
+    $pass++;
     if ($r->args eq 'last') {
         Apache2::Reload->unregister_module($package);
         ModPerl::Util::unload_package($package);
@@ -24,6 +26,18 @@
     Apache2::Reload::Test::run($r);
 
     return Apache2::Const::OK;
+}
+
+#This one shouldn't be touched
+package Apache2::Reload::Test::SubPackage;
+
+sub subpackage { 
+    if ($TestModules::reload::pass == '2') {
+        return 'subpackage';
+    }
+    else {
+        return 'SUBPACKAGE';
+    }
 }
 
 1;

Modified: perl/modperl/trunk/xs/ModPerl/Util/Util_pm
URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/xs/ModPerl/Util/Util_pm?rev=179448&r1=179447&r2=179448&view=diff
==============================================================================
--- perl/modperl/trunk/xs/ModPerl/Util/Util_pm (original)
+++ perl/modperl/trunk/xs/ModPerl/Util/Util_pm Wed Jun  1 15:44:01 2005
@@ -16,6 +16,9 @@
     # alias but the original function as well
 
     for (keys %$tab) {
+        #Skip sub stashes
+        next if /::$/;
+
         my $fullname = join '::', $package, $_;
         # code/hash/array/scalar might be imported make sure the gv
         # does not point elsewhere before undefing each



Mime
View raw message