Return-Path: Delivered-To: apmail-perl-dev-archive@www.apache.org Received: (qmail 69767 invoked from network); 30 Jul 2010 16:52:18 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 30 Jul 2010 16:52:18 -0000 Received: (qmail 33082 invoked by uid 500); 30 Jul 2010 16:52:18 -0000 Delivered-To: apmail-perl-dev-archive@perl.apache.org Received: (qmail 33021 invoked by uid 500); 30 Jul 2010 16:52:17 -0000 Mailing-List: contact dev-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@perl.apache.org Received: (qmail 33014 invoked by uid 99); 30 Jul 2010 16:52:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Jul 2010 16:52:17 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [74.125.82.53] (HELO mail-ww0-f53.google.com) (74.125.82.53) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Jul 2010 16:52:10 +0000 Received: by wwb39 with SMTP id 39so1560168wwb.22 for ; Fri, 30 Jul 2010 09:51:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.27.69 with SMTP id h5mr1953758wbc.210.1280508709390; Fri, 30 Jul 2010 09:51:49 -0700 (PDT) Received: by 10.216.184.143 with HTTP; Fri, 30 Jul 2010 09:51:48 -0700 (PDT) In-Reply-To: <4C51D366.7080009@livesite.net> References: <4C490DA7.2060402@ectoplasm.org> <4C4E53EE.408@ectoplasm.org> <4C51A920.3080105@livesite.net> <4C51D366.7080009@livesite.net> Date: Fri, 30 Jul 2010 09:51:48 -0700 Message-ID: Subject: Re: 2.0.5 RC soon? From: Fred Moyer To: Ryan Gies Cc: mod_perl Dev Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Can you please generate this patch using 'svn diff' and then send that patch inline as you did this one? I tried to apply the patch below and failed: phred@harpua ~/dev/svn/modperl/mod_perl-2.0/Apache-Reload $ patch -p0 < ryan.diff patching file lib/Apache2/Reload.pm Hunk #2 FAILED at 86. Hunk #3 FAILED at 140. Hunk #4 FAILED at 161. Hunk #5 FAILED at 214. patch unexpectedly ends in middle of line Hunk #6 succeeded at 235 with fuzz 1. 4 out of 6 hunks FAILED -- saving rejects to file lib/Apache2/Reload.pm.rej On Thu, Jul 29, 2010 at 12:15 PM, Ryan Gies wrote: > On 07/29/2010 01:15 PM, Fred Moyer wrote: >> >> I just checked out that thread, not sure how I missed it last year. >> But if you could pull >> https://svn.apache.org/repos/asf/perl/Apache-Reload/trunk =A0and update >> the patches I'd be happy to test them and integrate into this release. > > Below is the patch (inline as previously requested) as well as attached. > =A0The patch file was created in the top (trunk) directory. > > --- lib/Apache2/Reload.pm =A0 =A0 =A0 2010-07-29 14:38:16.187299747 -0400 > +++ lib/Apache2/Reload.pm.mine =A02010-07-29 14:43:38.291778900 -0400 > @@ -20,7 +20,7 @@ > > =A0use mod_perl2; > > -our $VERSION =3D '0.11'; > +our $VERSION =3D '0.12'; > > =A0use Apache2::Const -compile =3D> qw(OK); > > @@ -86,6 +86,8 @@ > > =A0 =A0 my $DEBUG =3D ref($o) && (lc($o->dir_config("ReloadDebug") || '')= eq > 'on'); > > + =A0 =A0my $ReloadByModuleName =3D ref($o) && > (lc($o->dir_config("ReloadByModuleName") || '') eq 'on'); > + > =A0 =A0 my $TouchFile =3D ref($o) && $o->dir_config("ReloadTouchFile"); > > =A0 =A0 my $ConstantRedefineWarnings =3D ref($o) && > @@ -138,6 +140,7 @@ > =A0 =A0 =A0 =A0 my $file =3D $Apache2::Reload::INCS{$key}; > > =A0 =A0 =A0 =A0 next unless defined $file; > + =A0 =A0 =A0 =A0next if ref $file; > =A0 =A0 =A0 =A0 next if @watch_dirs && !grep { $file =3D~ /^$_/ } @watch_= dirs; > =A0 =A0 =A0 =A0 warn "Apache2::Reload: Checking mtime of $key\n" if $DEBU= G; > > @@ -158,24 +161,29 @@ > =A0 =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0 if ($mtime > $Stat{$file}) { > - =A0 =A0 =A0 =A0 =A0 =A0push @changed, $key; > + =A0 =A0 =A0 =A0 =A0 =A0push @changed, [$key, $file]; > =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 $Stat{$file} =3D $mtime; > =A0 =A0 } > > =A0 =A0 #First, let's unload all changed modules > - =A0 =A0foreach my $module (@changed) { > + =A0 =A0foreach my $change (@changed) { > + =A0 =A0 =A0 =A0my ($module, $file) =3D @$change; > =A0 =A0 =A0 =A0 my $package =3D module_to_package($module); > =A0 =A0 =A0 =A0 ModPerl::Util::unload_package($package); > =A0 =A0 } > - > + > =A0 =A0 #Then, let's reload them all, so that module dependencies can sat= isfy > =A0 =A0 #themselves in the correct order. > - =A0 =A0foreach my $module (@changed) { > - =A0 =A0 =A0 =A0my $package =3D module_to_package($module); > - =A0 =A0 =A0 =A0require $module; > - =A0 =A0 =A0 =A0warn("Apache2::Reload: process $$ reloading $package fro= m > $module\n") > - =A0 =A0 =A0 =A0 =A0 =A0if $DEBUG; > + =A0 =A0foreach my $change (@changed) { > + =A0 =A0 =A0 =A0my ($module, $file) =3D @$change; > + =A0 =A0 =A0 =A0my $name =3D $ReloadByModuleName ? $module : $file; > + =A0 =A0 =A0 =A0require $name; > + =A0 =A0 =A0 =A0if ($DEBUG) { > + =A0 =A0 =A0 =A0 =A0my $package =3D module_to_package($module); > + =A0 =A0 =A0 =A0 =A0warn sprintf("Apache2::Reload: process %d reloading = %s from > %s\n", > + =A0 =A0 =A0 =A0 =A0 =A0$$, $package, $name); > + =A0 =A0 =A0 =A0} > =A0 =A0 } > > =A0 =A0 return Apache2::Const::OK; > @@ -206,6 +214,7 @@ > =A0 PerlSetVar ReloadAll Off > =A0 PerlSetVar ReloadModules "ModPerl::* Apache2::*" > =A0 #PerlSetVar ReloadDebug On > + =A0#PerlSetVar ReloadByModuleName On > > =A0 # Reload a single module from within itself: > =A0 package My::Apache2::Module; > @@ -226,16 +235,28 @@ > =A0also do the check for modified modules, when a special touch-file has > =A0been modified. > > -Note that C operates on the current context of > -C<@INC>. =A0Which means, when called as a C it will not > -see C<@INC> paths added or removed by C scripts, as > -the value of C<@INC> is saved on server startup and restored to that > -value after each request. =A0In other words, if you want > -C to work with modules that live in custom C<@INC> > -paths, you should modify C<@INC> when the server is started. =A0Besides, > -C<'use lib'> in the startup script, you can also set the C > -variable in the httpd's environment to include any non-standard 'lib' > -directories that you choose. =A0For example, to accomplish that you can > +Require-hooks, i.e., entries in %INC which are references, are ignored. > =A0The > +hook should modify %INC itself, adding the path to the module file, for = it > to > +be reloaded. > + > +C inspects and reloads the B associated with a gi= ven > +module. =A0Changes to @INC are not recognized, as it is the file which i= s > +being re-required, not the module name. > + > +In version 0.10 and earlier the B, not the file, is > re-required. > +Meaning it operated on the the current context of @INC. =A0If you still = want > this > +behavior set this environment variable in I: > + > + =A0PerlSetVar ReloadByModuleName On > + > +This means, when called as a C, C will no= t > see > +C<@INC> paths added or removed by C scripts, as the > value of > +C<@INC> is saved on server startup and restored to that value after each > +request. =A0In other words, if you want C to work with > modules > +that live in custom C<@INC> paths, you should modify C<@INC> when the > server is > +started. =A0Besides, C<'use lib'> in the startup script, you can also se= t the > +C variable in the httpd's environment to include any non-stand= ard > +'lib' directories that you choose. =A0For example, to accomplish that yo= u can > =A0include a line: > > =A0 PERL5LIB=3D/home/httpd/perl/extra; export PERL5LIB > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org For additional commands, e-mail: dev-help@perl.apache.org