r64095 - in /trunk/libapache2-reload-perl: Changes META.yml RELEASE debian/changelog lib/Apache/Reload.pm lib/Apache2/Reload.pm
periapt-guest at users.alioth.debian.org
periapt-guest at users.alioth.debian.org
Wed Oct 20 22:27:25 UTC 2010
Author: periapt-guest
Date: Wed Oct 20 22:27:14 2010
New Revision: 64095
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=64095
Log:
New upstream release
Modified:
trunk/libapache2-reload-perl/Changes
trunk/libapache2-reload-perl/META.yml
trunk/libapache2-reload-perl/RELEASE
trunk/libapache2-reload-perl/debian/changelog
trunk/libapache2-reload-perl/lib/Apache/Reload.pm
trunk/libapache2-reload-perl/lib/Apache2/Reload.pm
Modified: trunk/libapache2-reload-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libapache2-reload-perl/Changes?rev=64095&op=diff
==============================================================================
--- trunk/libapache2-reload-perl/Changes (original)
+++ trunk/libapache2-reload-perl/Changes Wed Oct 20 22:27:14 2010
@@ -5,6 +5,22 @@
=head1 CHANGES
=over 1
+
+=item 0.11 August 21, 2010
+
+Ignore require-hooks which exist in %INC
+[Ryan Gies <ryan at livesite.net>]
+
+Reloads by file, not module name
+[Ryan Gies <ryan at livesite.net>]
+
+Add a no Apache::Reload directive which skips reloading for modules
+that have it included (useful for Moose compatibility).
+[Graham Barr, <gbarr at pobox.com>]
+
+Add Empty NOTICE file
+http://rt.cpan.org/Ticket/Display.html?id=34786
+[Niko Tyni (Debian Perl Group) <ntyni at debian.org>]
=item 0.10 February 25, 2008
Modified: trunk/libapache2-reload-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libapache2-reload-perl/META.yml?rev=64095&op=diff
==============================================================================
--- trunk/libapache2-reload-perl/META.yml (original)
+++ trunk/libapache2-reload-perl/META.yml Wed Oct 20 22:27:14 2010
@@ -1,11 +1,21 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
-name: Apache-Reload
-version: 0.10
-version_from: lib/Apache/Reload.pm
-installdirs: site
+--- #YAML:1.0
+name: Apache-Reload
+version: 0.11
+abstract: Reload changed modules
+author: []
+license: unknown
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+build_requires:
+ ExtUtils::MakeMaker: 0
requires:
- mod_perl: 0
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.30
+ mod_perl: 0
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version 6.56
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
Modified: trunk/libapache2-reload-perl/RELEASE
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libapache2-reload-perl/RELEASE?rev=64095&op=diff
==============================================================================
--- trunk/libapache2-reload-perl/RELEASE (original)
+++ trunk/libapache2-reload-perl/RELEASE Wed Oct 20 22:27:14 2010
@@ -26,7 +26,7 @@
a. login into https://pause.perl.org
b. menu click: Select Mailinglist/Action
c. choose APML and share_perms and click go
- d. click 3.1 Make somebody else co-maintainer
+ d. click 3.2 Make somebody else co-maintainer
e. choose the modules to give the perms to
type the username of the new co-maintainer
f. if you happen to know that packages were added this release,
@@ -41,8 +41,8 @@
a. edit ./Changes:
- find lib -type f -name "*.pm" | \
- xargs perl -pi -e 's,0.10-dev,0.10-rc1,g'
- - perl -pi -e 's,0.10-dev,0.10-rc1,g' Changes
+ xargs perl -pi -e 's,0.11-dev,0.11-rc1,g'
+ - perl -pi -e 's,0.11-dev,0.11-rc1,g' Changes
- don't commit these (see dev@ archives)
@@ -61,7 +61,7 @@
o dev/perl.apache.org
o modperl/perl.apache.org
- Subject: [RELEASE CANDIDATE] Apache-Reload 0.10 RC\d+
+ Subject: [RELEASE CANDIDATE] Apache-Reload 0.11 RC\d+
(or maybe longer to give most people a chance to catch up). no need
to tag this package
@@ -71,8 +71,8 @@
3. when the package has been reported to be good, prepare a new
package to be released
- a. edit ./Changes:
- - remove -rc\d+
+ a. edit ./Changes
+ - remove -rc\d+ (from lib/Apache/Reload.pm and lib/Apache2/Reload.pm also)
- add release date
b. rerun:
@@ -96,7 +96,7 @@
5. Announce the package
a. post ... to the modperl, announce lists
- Subject: [ANNOUNCE] Apache-Reload 0.10
+ Subject: [ANNOUNCE] Apache-Reload 0.11
include
- MD5 sig (as it comes from CPAN upload announce).
- the latest Changes
@@ -108,7 +108,7 @@
b. edit ./Changes:
- start a new item with incremented version + '-dev'
- =item 0.11-dev
+ =item 0.12-dev
c. bump up version numbers in this file to make it easier to do the
next release.
@@ -116,4 +116,5 @@
$ perl -pi -e 's/(\d+)\.(\d+)/join(".", $1, $2+1)/eg' RELEASE
d. commit Changes
- % svn ci -m "start 0.11-dev cycle" Changes RELEASE lib/Apache/Reload.pm
+ % svn ci -m "start 0.11-dev cycle" Changes RELEASE \
+ lib/Apache/Reload.pm lib/Apache2/Reload.pm
Modified: trunk/libapache2-reload-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libapache2-reload-perl/debian/changelog?rev=64095&op=diff
==============================================================================
--- trunk/libapache2-reload-perl/debian/changelog (original)
+++ trunk/libapache2-reload-perl/debian/changelog Wed Oct 20 22:27:14 2010
@@ -1,4 +1,4 @@
-libapache2-reload-perl (0.10-3) UNRELEASED; urgency=low
+libapache2-reload-perl (0.11-1) UNRELEASED; urgency=low
[ gregor herrmann ]
* debian/copyright: point to /usr/share/common-licenses/Apache-2.0 instead
@@ -15,8 +15,9 @@
[ Nicholas Bamber ]
* Added myself to uploaders
+ * New upstream release
- -- gregor herrmann <gregoa at debian.org> Mon, 04 Aug 2008 18:56:53 -0300
+ -- Nicholas Bamber <nicholas at periapt.co.uk> Wed, 20 Oct 2010 23:28:36 +0100
libapache2-reload-perl (0.10-2) unstable; urgency=low
Modified: trunk/libapache2-reload-perl/lib/Apache/Reload.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libapache2-reload-perl/lib/Apache/Reload.pm?rev=64095&op=diff
==============================================================================
--- trunk/libapache2-reload-perl/lib/Apache/Reload.pm (original)
+++ trunk/libapache2-reload-perl/lib/Apache/Reload.pm Wed Oct 20 22:27:14 2010
@@ -17,9 +17,9 @@
use strict;
-$Apache::Reload::VERSION = '0.10';
-
-use vars qw(%INCS %Stat $TouchTime %UndefFields);
+$Apache::Reload::VERSION = '0.11';
+
+use vars qw(%INCS %Stat $TouchTime %UndefFields %Ignore);
%Stat = ($INC{"Apache/Reload.pm"} => time);
@@ -30,6 +30,13 @@
my ($package,$file) = (caller)[0,1];
$class->register_module($package, $file);
+}
+
+sub unimport {
+ my $class = shift;
+ my ($package,$file) = (caller)[0,1];
+
+ $class->unregister_module($package, $file);
}
sub package_to_module {
@@ -56,6 +63,13 @@
if (%{"${package}::FIELDS"}) {
$UndefFields{$module} = "${package}::FIELDS";
}
+}
+
+sub unregister_module {
+ my ($class, $package, $file) = @_;
+ my $module = package_to_module($package);
+
+ $Ignore{$module} = 1;
}
sub handler {
@@ -135,9 +149,14 @@
}
# remove the modules
if ($mtime > $Stat{$file}) {
- delete $INC{$key};
- push @changed, $key;
- }
+ if ($Ignore{$key}) {
+ warn "Apache::Reload: Not reloading $key\n";
+ }
+ else {
+ delete $INC{$key};
+ push @changed, $key;
+ }
+ }
$Stat{$file} = $mtime;
}
@@ -230,6 +249,15 @@
Note that these are split on whitespace, but the module list B<must>
be in quotes, otherwise Apache tries to parse the parameter list.
+=head2 Un-Register Modules Explicitly
+
+If ReloadAll is set to On, then you can explicity force a module not to be reloaded with
+
+ no Apache::Reload;
+
+A warning will appear in the error log that the file has changed, but will
+not be reloaded
+
=head2 Special "Touch" File
You can also set a file that you can touch() that causes the reloads to be
Modified: trunk/libapache2-reload-perl/lib/Apache2/Reload.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libapache2-reload-perl/lib/Apache2/Reload.pm?rev=64095&op=diff
==============================================================================
--- trunk/libapache2-reload-perl/lib/Apache2/Reload.pm (original)
+++ trunk/libapache2-reload-perl/lib/Apache2/Reload.pm Wed Oct 20 22:27:14 2010
@@ -20,7 +20,7 @@
use mod_perl2;
-our $VERSION = '0.10';
+our $VERSION = '0.11';
use Apache2::Const -compile => qw(OK);
@@ -85,6 +85,8 @@
$o = $o->base_server if ref($o) eq 'Apache2::Connection';
my $DEBUG = ref($o) && (lc($o->dir_config("ReloadDebug") || '') eq 'on');
+
+ my $ReloadByModuleName = ref($o) && (lc($o->dir_config("ReloadByModuleName") || '') eq 'on');
my $TouchFile = ref($o) && $o->dir_config("ReloadTouchFile");
@@ -138,6 +140,7 @@
my $file = $Apache2::Reload::INCS{$key};
next unless defined $file;
+ next if ref $file;
next if @watch_dirs && !grep { $file =~ /^$_/ } @watch_dirs;
warn "Apache2::Reload: Checking mtime of $key\n" if $DEBUG;
@@ -158,24 +161,29 @@
}
if ($mtime > $Stat{$file}) {
- push @changed, $key;
+ push @changed, [$key, $file];
}
$Stat{$file} = $mtime;
}
#First, let's unload all changed modules
- foreach my $module (@changed) {
+ foreach my $change (@changed) {
+ my ($module, $file) = @$change;
my $package = module_to_package($module);
ModPerl::Util::unload_package($package);
}
-
+
#Then, let's reload them all, so that module dependencies can satisfy
#themselves in the correct order.
- foreach my $module (@changed) {
- my $package = module_to_package($module);
- require $module;
- warn("Apache2::Reload: process $$ reloading $package from $module\n")
- if $DEBUG;
+ foreach my $change (@changed) {
+ my ($module, $file) = @$change;
+ my $name = $ReloadByModuleName ? $module : $file;
+ require $name;
+ if ($DEBUG) {
+ my $package = module_to_package($module);
+ warn sprintf("Apache2::Reload: process %d reloading %s from %s\n",
+ $$, $package, $name);
+ }
}
return Apache2::Const::OK;
@@ -206,6 +214,7 @@
PerlSetVar ReloadAll Off
PerlSetVar ReloadModules "ModPerl::* Apache2::*"
#PerlSetVar ReloadDebug On
+ #PerlSetVar ReloadByModuleName On
# Reload a single module from within itself:
package My::Apache2::Module;
@@ -226,16 +235,28 @@
also do the check for modified modules, when a special touch-file has
been modified.
-Note that C<Apache2::Reload> operates on the current context of
-C<@INC>. Which means, when called as a C<Perl*Handler> it will not
-see C<@INC> paths added or removed by C<ModPerl::Registry> scripts, as
-the value of C<@INC> is saved on server startup and restored to that
-value after each request. In other words, if you want
-C<Apache2::Reload> to work with modules that live in custom C<@INC>
-paths, you should modify C<@INC> when the server is started. Besides,
-C<'use lib'> in the startup script, you can also set the C<PERL5LIB>
-variable in the httpd's environment to include any non-standard 'lib'
-directories that you choose. For example, to accomplish that you can
+Require-hooks, i.e., entries in %INC which are references, are ignored. The
+hook should modify %INC itself, adding the path to the module file, for it to
+be reloaded.
+
+C<Apache2::Reload> inspects and reloads the B<file> associated with a given
+module. Changes to @INC are not recognized, as it is the file which is
+being re-required, not the module name.
+
+In version 0.10 and earlier the B<module name>, not the file, is re-required.
+Meaning it operated on the the current context of @INC. If you still want this
+behavior set this environment variable in I<httpd.conf>:
+
+ PerlSetVar ReloadByModuleName On
+
+This means, when called as a C<Perl*Handler>, C<Apache2::Reload> will not see
+C<@INC> paths added or removed by C<ModPerl::Registry> scripts, as the value of
+C<@INC> is saved on server startup and restored to that value after each
+request. In other words, if you want C<Apache2::Reload> to work with modules
+that live in custom C<@INC> paths, you should modify C<@INC> when the server is
+started. Besides, C<'use lib'> in the startup script, you can also set the
+C<PERL5LIB> variable in the httpd's environment to include any non-standard
+'lib' directories that you choose. For example, to accomplish that you can
include a line:
PERL5LIB=/home/httpd/perl/extra; export PERL5LIB
More information about the Pkg-perl-cvs-commits
mailing list