r13005 - in /branches/upstream/libhttp-server-simple-perl/current: ./ inc/Module/ inc/Module/Install/ lib/HTTP/Server/

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Fri Jan 18 22:22:52 UTC 2008


Author: gregoa-guest
Date: Fri Jan 18 22:22:52 2008
New Revision: 13005

URL: http://svn.debian.org/wsvn/?sc=1&rev=13005
Log:
[svn-upgrade] Integrating new upstream version, libhttp-server-simple-perl (0.28)

Modified:
    branches/upstream/libhttp-server-simple-perl/current/Changes
    branches/upstream/libhttp-server-simple-perl/current/META.yml
    branches/upstream/libhttp-server-simple-perl/current/Makefile.PL
    branches/upstream/libhttp-server-simple-perl/current/SIGNATURE
    branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install.pm
    branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Base.pm
    branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Can.pm
    branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Fetch.pm
    branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Makefile.pm
    branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Metadata.pm
    branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Win32.pm
    branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/WriteAll.pm
    branches/upstream/libhttp-server-simple-perl/current/lib/HTTP/Server/Simple.pm

Modified: branches/upstream/libhttp-server-simple-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libhttp-server-simple-perl/current/Changes?rev=13005&op=diff
==============================================================================
--- branches/upstream/libhttp-server-simple-perl/current/Changes (original)
+++ branches/upstream/libhttp-server-simple-perl/current/Changes Fri Jan 18 22:22:52 2008
@@ -1,3 +1,27 @@
+0.28 Tue Jan 15 09:33:58 EST 2008
+ * New restartability support from Mark Stosberg
+
+    After reviewing the code in HTTP::Server::Simple,
+    Catalyst::Engine::HTTP and HTTP::Server::Brick, I found and
+    implemented an updated signal handling approach that I like and
+    understand, and actually works.
+
+    The current code restarted immediately if a SIGHUP came in, no
+    matter what was happening, including if a request was in process of
+    being fulfilled.
+
+    The new code works more like "apachectl graceful". It waits for the
+    current request cycle to finish, and then restarts the server.
+
+    This code has to be integrated in the core, but its just about
+    the same amount of signal handling code that was there... it just
+    works better.  It's also written in such a way I think subclass/mixin
+    authors could rewrite just these parts if they wanted.
+
+    Also, it looks like a Net::Server based sub-class would already be
+    doing its own thing with SIGHUP handling, and should continue to
+    be unaffected.
+
 0.27
 
  * 0.26 release apparently didn't get to cpan correctly

Modified: branches/upstream/libhttp-server-simple-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libhttp-server-simple-perl/current/META.yml?rev=13005&op=diff
==============================================================================
--- branches/upstream/libhttp-server-simple-perl/current/META.yml (original)
+++ branches/upstream/libhttp-server-simple-perl/current/META.yml Fri Jan 18 22:22:52 2008
@@ -1,6 +1,10 @@
+--- 
 distribution_type: module
-generated_by: Module::Install version 0.64
+generated_by: Module::Install version 0.67
 license: perl
+meta-spec: 
+  url: http://module-build.sourceforge.net/META-spec-v1.3.html
+  version: 1.3
 name: HTTP-Server-Simple
 no_index: 
   directory: 
@@ -10,4 +14,5 @@
   CGI: 0
   Socket: 0
   Test::More: 0
-version: 0.27
+  URI::Escape: 0
+version: 0.28

Modified: branches/upstream/libhttp-server-simple-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libhttp-server-simple-perl/current/Makefile.PL?rev=13005&op=diff
==============================================================================
--- branches/upstream/libhttp-server-simple-perl/current/Makefile.PL (original)
+++ branches/upstream/libhttp-server-simple-perl/current/Makefile.PL Fri Jan 18 22:22:52 2008
@@ -5,7 +5,9 @@
 license('perl');
 requires ( Socket => 0,
 	   Test::More => 0,
-	   CGI => 0);
+	   CGI => 0,
+           URI::Escape => 0
+       );
 
    &WriteAll;
 

Modified: branches/upstream/libhttp-server-simple-perl/current/SIGNATURE
URL: http://svn.debian.org/wsvn/branches/upstream/libhttp-server-simple-perl/current/SIGNATURE?rev=13005&op=diff
==============================================================================
--- branches/upstream/libhttp-server-simple-perl/current/SIGNATURE (original)
+++ branches/upstream/libhttp-server-simple-perl/current/SIGNATURE Fri Jan 18 22:22:52 2008
@@ -1,12 +1,12 @@
 This file contains message digests of all files listed in MANIFEST,
-signed via the Module::Signature module, version 0.41.
+signed via the Module::Signature module, version 0.55.
 
 To verify the content in this distribution, first make sure you have
 Module::Signature installed, then type:
 
     % cpansign -v
 
-It would check each file's integrity, as well as the signature's
+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.
@@ -14,21 +14,21 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-SHA1 ffccf55176240d36823f76139f3940e375371c1d Changes
+SHA1 675ffe663efe035cc65047502345938904d9d0e1 Changes
 SHA1 0ac508c50476dcc2bf8fe3094cb341425291e1ee MANIFEST
-SHA1 646abfae04e983d8f7c0d1b04b5395ccab31a202 META.yml
-SHA1 490f3fd115e09cb05b725580e5ed5cdd58241049 Makefile.PL
+SHA1 de5abaa8229fa5378d21eeb328081c8f14a7b488 META.yml
+SHA1 3a02ba613b11b07dd1fa97e2a6b962ee3e039c98 Makefile.PL
 SHA1 ed0c107672daac3bc9e266876666e1059dbe44b7 README
 SHA1 4ea1e9072ca87399184a46233df52a21e285604d ex/sample_server
-SHA1 9b2f9d83bcf77860f53a0c07c90a4a59ad9f5df1 inc/Module/Install.pm
-SHA1 abe32855d75ab13747cf65765af9947b7a8c3057 inc/Module/Install/Base.pm
-SHA1 95b81d1e91bd634467bf633571eff4420e9c04eb inc/Module/Install/Can.pm
-SHA1 1fe98c63cf9d7271c8cb4183ba230f152df69e26 inc/Module/Install/Fetch.pm
-SHA1 2249171a2b72cd73ff2c0a06597d29f86e5df456 inc/Module/Install/Makefile.pm
-SHA1 381bb98ea3877bba49ae85e7a7ea130645fd3dbf inc/Module/Install/Metadata.pm
-SHA1 0c2118868ef82ac517eb6d9c3bd93e6eb9bbf83e inc/Module/Install/Win32.pm
-SHA1 e827d6d43771032fa3df35c0ad5e5698d0e54cda inc/Module/Install/WriteAll.pm
-SHA1 67b1efef4b807f9780e3449e5dc053b8a1df1ff3 lib/HTTP/Server/Simple.pm
+SHA1 78edb89a439463e44c33a72bbee84c54d0dc8aaf inc/Module/Install.pm
+SHA1 8ea4e37df83fd0c1c050be5c8da75545c3828d9b inc/Module/Install/Base.pm
+SHA1 1da6031583c32f0d1ec073b8376102fc51427dcc inc/Module/Install/Can.pm
+SHA1 b779375b90c16af2f31f38a1dd2b5df223c7f2fb inc/Module/Install/Fetch.pm
+SHA1 2054450e1e9c1dd8056362bf4a64ae70d5d71476 inc/Module/Install/Makefile.pm
+SHA1 5d6189b2cad15cf9932a28faafd55130c8247e83 inc/Module/Install/Metadata.pm
+SHA1 02af973fae2ac3531fa6b704574b2b8cb2a08148 inc/Module/Install/Win32.pm
+SHA1 3a2eab96e91cca8d99938cda7791759ae9d97b3a inc/Module/Install/WriteAll.pm
+SHA1 1ed5f4a8a4aa0a6bf5cc9a7be817a913dbed174e lib/HTTP/Server/Simple.pm
 SHA1 40f24374f2b5845a3025e14ca4b91bd58298de03 lib/HTTP/Server/Simple/CGI.pm
 SHA1 47ef836a1cdd03add505dd4c90819cafb61dc565 lib/HTTP/Server/Simple/CGI/Environment.pm
 SHA1 db064af54cab345a71daec576e32e64b8fb1033d t/00smoke.t
@@ -37,9 +37,9 @@
 SHA1 a7024d0d8e7b80d26f75a3551a1406a797b382f8 t/03podcoverage.t
 SHA1 bc9dc786924d61aa0dc8747c1d68f47cf421ec37 t/04cgi.t
 -----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.3 (GNU/Linux)
+Version: GnuPG v1.4.6 (GNU/Linux)
 
-iD8DBQFFsTVyEi9d9xCOQEYRArnCAJ9vAxXaLPqMky5VTMc2mhdKiVA+7gCdG7Ql
-6BmF5YI5Vj8kAZModSP8ByM=
-=eCK+
+iD8DBQFHjMRyEi9d9xCOQEYRAg5UAKC6K4D3TqcEiAoGSMZW7WtAZtdz2wCgieho
+SnitUjgps/2KV99Xuv1Dchc=
+=sEH7
 -----END PGP SIGNATURE-----

Modified: branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install.pm?rev=13005&op=diff
==============================================================================
--- branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install.pm (original)
+++ branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install.pm Fri Jan 18 22:22:52 2008
@@ -28,7 +28,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.64';
+    $VERSION = '0.67';
 }
 
 # Whether or not inc::Module::Install is actually loaded, the

Modified: branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Base.pm?rev=13005&op=diff
==============================================================================
--- branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Base.pm (original)
+++ branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Base.pm Fri Jan 18 22:22:52 2008
@@ -1,7 +1,7 @@
 #line 1
 package Module::Install::Base;
 
-$VERSION = '0.64';
+$VERSION = '0.67';
 
 # Suspend handler for "redefined" warnings
 BEGIN {

Modified: branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Can.pm?rev=13005&op=diff
==============================================================================
--- branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Can.pm (original)
+++ branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Can.pm Fri Jan 18 22:22:52 2008
@@ -11,7 +11,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.64';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Fetch.pm?rev=13005&op=diff
==============================================================================
--- branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Fetch.pm (original)
+++ branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Fetch.pm Fri Jan 18 22:22:52 2008
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.64';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Makefile.pm?rev=13005&op=diff
==============================================================================
--- branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Makefile.pm (original)
+++ branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Makefile.pm Fri Jan 18 22:22:52 2008
@@ -7,7 +7,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.64';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }
@@ -17,192 +17,221 @@
 my %seen = ();
 
 sub prompt {
-    shift;
-
-    # Infinite loop protection
-    my @c = caller();
-    if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
-        die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
-    }
-
-    # In automated testing, always use defaults
-    if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) {
-        local $ENV{PERL_MM_USE_DEFAULT} = 1;
-        goto &ExtUtils::MakeMaker::prompt;
-    } else {
-        goto &ExtUtils::MakeMaker::prompt;
-    }
+	shift;
+
+	# Infinite loop protection
+	my @c = caller();
+	if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
+		die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
+	}
+
+	# In automated testing, always use defaults
+	if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) {
+		local $ENV{PERL_MM_USE_DEFAULT} = 1;
+		goto &ExtUtils::MakeMaker::prompt;
+	} else {
+		goto &ExtUtils::MakeMaker::prompt;
+	}
 }
 
 sub makemaker_args {
-    my $self = shift;
-    my $args = ($self->{makemaker_args} ||= {});
-    %$args = ( %$args, @_ ) if @_;
-    $args;
+	my $self = shift;
+	my $args = ($self->{makemaker_args} ||= {});
+	%$args = ( %$args, @_ ) if @_;
+	$args;
 }
 
 # For mm args that take multiple space-seperated args,
 # append an argument to the current list.
 sub makemaker_append {
-    my $self = shift;
-    my $name = shift;
-    my $args = $self->makemaker_args;
-    $args->{name} = defined $args->{$name}
-    	? join( ' ', $args->{name}, @_ )
-    	: join( ' ', @_ );
+	my $self = sShift;
+	my $name = shift;
+	my $args = $self->makemaker_args;
+	$args->{name} = defined $args->{$name}
+		? join( ' ', $args->{name}, @_ )
+		: join( ' ', @_ );
 }
 
 sub build_subdirs {
-    my $self    = shift;
-    my $subdirs = $self->makemaker_args->{DIR} ||= [];
-    for my $subdir (@_) {
-        push @$subdirs, $subdir;
-    }
+	my $self    = shift;
+	my $subdirs = $self->makemaker_args->{DIR} ||= [];
+	for my $subdir (@_) {
+		push @$subdirs, $subdir;
+	}
 }
 
 sub clean_files {
-    my $self  = shift;
-    my $clean = $self->makemaker_args->{clean} ||= {};
-    %$clean = (
-        %$clean, 
-        FILES => join(' ', grep length, $clean->{FILES}, @_),
-    );
+	my $self  = shift;
+	my $clean = $self->makemaker_args->{clean} ||= {};
+	%$clean = (
+		%$clean, 
+		FILES => join(' ', grep length, $clean->{FILES}, @_),
+	);
 }
 
 sub realclean_files {
-    my $self  = shift;
-    my $realclean = $self->makemaker_args->{realclean} ||= {};
-    %$realclean = (
-        %$realclean, 
-        FILES => join(' ', grep length, $realclean->{FILES}, @_),
-    );
+	my $self  = shift;
+	my $realclean = $self->makemaker_args->{realclean} ||= {};
+	%$realclean = (
+		%$realclean, 
+		FILES => join(' ', grep length, $realclean->{FILES}, @_),
+	);
 }
 
 sub libs {
-    my $self = shift;
-    my $libs = ref $_[0] ? shift : [ shift ];
-    $self->makemaker_args( LIBS => $libs );
+	my $self = shift;
+	my $libs = ref $_[0] ? shift : [ shift ];
+	$self->makemaker_args( LIBS => $libs );
 }
 
 sub inc {
-    my $self = shift;
-    $self->makemaker_args( INC => shift );
+	my $self = shift;
+	$self->makemaker_args( INC => shift );
+}
+
+my %test_dir = ();
+
+sub _wanted_t {
+	/\.t$/ and -f $_ and $test_dir{$File::Find::dir} = 1;
+}
+
+sub tests_recursive {
+	my $self = shift;
+	if ( $self->tests ) {
+		die "tests_recursive will not work if tests are already defined";
+	}
+	my $dir = shift || 't';
+	unless ( -d $dir ) {
+		die "tests_recursive dir '$dir' does not exist";
+	}
+	require File::Find;
+	%test_dir = ();
+	File::Find::find( \&_wanted_t, $dir );
+	$self->tests( join ' ', map { "$_/*.t" } sort keys %test_dir );
 }
 
 sub write {
-    my $self = shift;
-    die "&Makefile->write() takes no arguments\n" if @_;
-
-    my $args = $self->makemaker_args;
-    $args->{DISTNAME} = $self->name;
-    $args->{NAME}     = $self->module_name || $self->name || $self->determine_NAME($args);
-    $args->{VERSION}  = $self->version || $self->determine_VERSION($args);
-    $args->{NAME}     =~ s/-/::/g;
-    if ( $self->tests ) {
-        $args->{test} = { TESTS => $self->tests };
-    }
-    if ($] >= 5.005) {
-        $args->{ABSTRACT} = $self->abstract;
-        $args->{AUTHOR}   = $self->author;
-    }
-    if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
-        $args->{NO_META} = 1;
-    }
-    if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) {
-        $args->{SIGN} = 1;
-    }
-    unless ( $self->is_admin ) {
-        delete $args->{SIGN};
-    }
-
-    # merge both kinds of requires into prereq_pm
-    my $prereq = ($args->{PREREQ_PM} ||= {});
-    %$prereq = ( %$prereq, map { @$_ } map { @$_ } grep $_,
-                 ($self->build_requires, $self->requires) );
-
-    # merge both kinds of requires into prereq_pm
-    my $subdirs = ($args->{DIR} ||= []);
-    if ($self->bundles) {
-        foreach my $bundle (@{ $self->bundles }) {
-            my ($file, $dir) = @$bundle;
-            push @$subdirs, $dir if -d $dir;
-            delete $prereq->{$file};
-        }
-    }
-
-    if ( my $perl_version = $self->perl_version ) {
-        eval "use $perl_version; 1"
-            or die "ERROR: perl: Version $] is installed, "
-                . "but we need version >= $perl_version";
-    }
-
-    my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_})} keys %$args;
-    if ($self->admin->preop) {
-        $args{dist} = $self->admin->preop;
-    }
-
-    my $mm = ExtUtils::MakeMaker::WriteMakefile(%args);
-    $self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile');
+	my $self = shift;
+	die "&Makefile->write() takes no arguments\n" if @_;
+
+	my $args = $self->makemaker_args;
+	$args->{DISTNAME} = $self->name;
+	$args->{NAME}     = $self->module_name || $self->name || $self->determine_NAME($args);
+	$args->{VERSION}  = $self->version || $self->determine_VERSION($args);
+	$args->{NAME}     =~ s/-/::/g;
+	if ( $self->tests ) {
+		$args->{test} = { TESTS => $self->tests };
+	}
+	if ($] >= 5.005) {
+		$args->{ABSTRACT} = $self->abstract;
+		$args->{AUTHOR}   = $self->author;
+	}
+	if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
+		$args->{NO_META} = 1;
+	}
+	if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) {
+		$args->{SIGN} = 1;
+	}
+	unless ( $self->is_admin ) {
+		delete $args->{SIGN};
+	}
+
+	# merge both kinds of requires into prereq_pm
+	my $prereq = ($args->{PREREQ_PM} ||= {});
+	%$prereq = ( %$prereq,
+		map { @$_ }
+		map { @$_ }
+		grep $_,
+		($self->build_requires, $self->requires)
+	);
+
+	# merge both kinds of requires into prereq_pm
+	my $subdirs = ($args->{DIR} ||= []);
+	if ($self->bundles) {
+		foreach my $bundle (@{ $self->bundles }) {
+			my ($file, $dir) = @$bundle;
+			push @$subdirs, $dir if -d $dir;
+			delete $prereq->{$file};
+		}
+	}
+
+	if ( my $perl_version = $self->perl_version ) {
+		eval "use $perl_version; 1"
+			or die "ERROR: perl: Version $] is installed, "
+			. "but we need version >= $perl_version";
+	}
+
+	$args->{INSTALLDIRS} = $self->installdirs;
+
+	my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_})} keys %$args;
+
+	my $user_preop = delete $args{dist}->{PREOP};
+	if (my $preop = $self->admin->preop($user_preop)) {
+		$args{dist} = $preop;
+	}
+
+	my $mm = ExtUtils::MakeMaker::WriteMakefile(%args);
+	$self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile');
 }
 
 sub fix_up_makefile {
-    my $self          = shift;
-    my $makefile_name = shift;
-    my $top_class     = ref($self->_top) || '';
-    my $top_version   = $self->_top->VERSION || '';
-
-    my $preamble = $self->preamble 
-        ? "# Preamble by $top_class $top_version\n"
-            . $self->preamble
-        : '';
-    my $postamble = "# Postamble by $top_class $top_version\n"
-        . ($self->postamble || '');
-
-    local *MAKEFILE;
-    open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
-    my $makefile = do { local $/; <MAKEFILE> };
-    close MAKEFILE or die $!;
-
-    $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
-    $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
-    $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
-    $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m;
-    $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m;
-
-    # Module::Install will never be used to build the Core Perl
-    # Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks
-    # PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist
-    $makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m;
-    #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m;
-
-    # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well.
-    $makefile =~ s/("?)-I\$\(PERL_LIB\)\1//g;
-
-    # XXX - This is currently unused; not sure if it breaks other MM-users
-    # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
-
-    open  MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
-    print MAKEFILE  "$preamble$makefile$postamble" or die $!;
-    close MAKEFILE  or die $!;
-
-    1;
+	my $self          = shift;
+	my $makefile_name = shift;
+	my $top_class     = ref($self->_top) || '';
+	my $top_version   = $self->_top->VERSION || '';
+
+	my $preamble = $self->preamble 
+		? "# Preamble by $top_class $top_version\n"
+			. $self->preamble
+		: '';
+	my $postamble = "# Postamble by $top_class $top_version\n"
+		. ($self->postamble || '');
+
+	local *MAKEFILE;
+	open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+	my $makefile = do { local $/; <MAKEFILE> };
+	close MAKEFILE or die $!;
+
+	$makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
+	$makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
+	$makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
+	$makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m;
+	$makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m;
+
+	# Module::Install will never be used to build the Core Perl
+	# Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks
+	# PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist
+	$makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m;
+	#$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m;
+
+	# Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well.
+	$makefile =~ s/("?)-I\$\(PERL_LIB\)\1//g;
+
+	# XXX - This is currently unused; not sure if it breaks other MM-users
+	# $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
+
+	open  MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+	print MAKEFILE  "$preamble$makefile$postamble" or die $!;
+	close MAKEFILE  or die $!;
+
+	1;
 }
 
 sub preamble {
-    my ($self, $text) = @_;
-    $self->{preamble} = $text . $self->{preamble} if defined $text;
-    $self->{preamble};
+	my ($self, $text) = @_;
+	$self->{preamble} = $text . $self->{preamble} if defined $text;
+	$self->{preamble};
 }
 
 sub postamble {
-    my ($self, $text) = @_;
-    $self->{postamble} ||= $self->admin->postamble;
-    $self->{postamble} .= $text if defined $text;
-    $self->{postamble}
+	my ($self, $text) = @_;
+	$self->{postamble} ||= $self->admin->postamble;
+	$self->{postamble} .= $text if defined $text;
+	$self->{postamble}
 }
 
 1;
 
 __END__
 
-#line 334
+#line 363

Modified: branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Metadata.pm?rev=13005&op=diff
==============================================================================
--- branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Metadata.pm (original)
+++ branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Metadata.pm Fri Jan 18 22:22:52 2008
@@ -6,14 +6,14 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.64';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }
 
 my @scalar_keys = qw{
     name module_name abstract author version license
-    distribution_type perl_version tests
+    distribution_type perl_version tests installdirs
 };
 
 my @tuple_keys = qw{
@@ -56,9 +56,23 @@
     };
 }
 
+# configure_requires is currently a null-op
+sub configure_requires { 1 }
+
+# Aliases for build_requires that will have alternative
+# meanings in some future version of META.yml.
+sub test_requires      { shift->build_requires(@_)  }
+sub install_requires   { shift->build_requires(@_)  }
+
+# Aliases for installdirs options
+sub install_as_core    { $_[0]->installdirs('perl')   }
+sub install_as_cpan    { $_[0]->installdirs('site')   }
+sub install_as_site    { $_[0]->installdirs('site')   }
+sub install_as_vendor  { $_[0]->installdirs('vendor') }
+
 sub sign {
     my $self = shift;
-    return $self->{'values'}{'sign'} if defined wantarray and !@_;
+    return $self->{'values'}{'sign'} if defined wantarray and ! @_;
     $self->{'values'}{'sign'} = ( @_ ? $_[0] : 1 );
     return $self;
 }
@@ -279,9 +293,11 @@
 
     if (
         $self->_slurp($file) =~ m/
-        =head \d \s+
-        (?:licen[cs]e|licensing|copyright|legal)\b
-        (.*?)
+        (
+            =head \d \s+
+            (?:licen[cs]e|licensing|copyright|legal)\b
+            .*?
+        )
         (=head\\d.*|=cut.*|)
         \z
     /ixms
@@ -289,19 +305,24 @@
     {
         my $license_text = $1;
         my @phrases      = (
-            'under the same (?:terms|license) as perl itself' => 'perl',
-            'GNU public license'                              => 'gpl',
-            'GNU lesser public license'                       => 'gpl',
-            'BSD license'                                     => 'bsd',
-            'Artistic license'                                => 'artistic',
-            'GPL'                                             => 'gpl',
-            'LGPL'                                            => 'lgpl',
-            'BSD'                                             => 'bsd',
-            'Artistic'                                        => 'artistic',
+            'under the same (?:terms|license) as perl itself' => 'perl',        1,
+            'GNU public license'                              => 'gpl',         1,
+            'GNU lesser public license'                       => 'gpl',         1,
+            'BSD license'                                     => 'bsd',         1,
+            'Artistic license'                                => 'artistic',    1,
+            'GPL'                                             => 'gpl',         1,
+            'LGPL'                                            => 'lgpl',        1,
+            'BSD'                                             => 'bsd',         1,
+            'Artistic'                                        => 'artistic',    1,
+            'MIT'                                             => 'mit',         1,
+            'proprietary'                                     => 'proprietary', 0,
         );
-        while ( my ( $pattern, $license ) = splice( @phrases, 0, 2 ) ) {
+        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 ) {
+                        warn "LEGAL WARNING: 'All rights reserved' may invalidate Open Source licenses. Consider removing it.";
+		}
                 $self->license($license);
                 return 1;
             }

Modified: branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Win32.pm?rev=13005&op=diff
==============================================================================
--- branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Win32.pm (original)
+++ branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/Win32.pm Fri Jan 18 22:22:52 2008
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.64';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/WriteAll.pm?rev=13005&op=diff
==============================================================================
--- branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/WriteAll.pm (original)
+++ branches/upstream/libhttp-server-simple-perl/current/inc/Module/Install/WriteAll.pm Fri Jan 18 22:22:52 2008
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.64';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: branches/upstream/libhttp-server-simple-perl/current/lib/HTTP/Server/Simple.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libhttp-server-simple-perl/current/lib/HTTP/Server/Simple.pm?rev=13005&op=diff
==============================================================================
--- branches/upstream/libhttp-server-simple-perl/current/lib/HTTP/Server/Simple.pm (original)
+++ branches/upstream/libhttp-server-simple-perl/current/lib/HTTP/Server/Simple.pm Fri Jan 18 22:22:52 2008
@@ -7,7 +7,7 @@
 use URI::Escape;
 
 use vars qw($VERSION $bad_request_doc);
-$VERSION = '0.27';
+$VERSION = '0.28';
 
 
 =head1 NAME
@@ -58,13 +58,12 @@
 
 =item HUP
 
-When you C<kill -HUP> the server, it does its best to rexec
-itself.  Please note that in order to provide restart-on-SIGHUP,
-HTTP::Server::Simple sets a SIGHUP handler during initialisation. If
-your request handling code forks you need to make sure you reset this
-or unexpected things will happen if somebody sends a HUP to all running
-processes spawned by your app (e.g. by "kill -HUP <script>")
-
+When you C<kill -HUP> the server, it lets the current request finish being
+processed, then uses the C<restart> method to re-exec itself. Please note that
+in order to provide restart-on-SIGHUP, HTTP::Server::Simple sets a SIGHUP
+handler during initialisation. If your request handling code forks you need to
+make sure you reset this or unexpected things will happen if somebody sends a
+HUP to all running processes spawned by your app (e.g. by "kill -HUP <script>")
 
 =item PIPE
 
@@ -182,34 +181,14 @@
 
 my $server_class_id = 0;
 
+use vars '$SERVER_SHOULD_RUN';
+$SERVER_SHOULD_RUN = 1;
+
 sub run {
     my $self   = shift;
     my $server = $self->net_server;
 
-    # Handle SIGHUP
-
     local $SIG{CHLD} = 'IGNORE';    # reap child processes
-    local $SIG{HUP} = sub {
-
-        # XXX TODO: Autrijus says this code was incorrect when he wrote
-        # it and we should move to the sample code from perldoc perlipc
-        close HTTPDaemon;
-
-        # and then, on systems implementing fork(), we make sure
-        # we are running with a new pid, so another -HUP will still
-        # work on the new process.
-        require Config;
-        if ( $Config::Config{d_fork} and my $pid = fork() ) {
-
-            # finally, allow ^C on the parent process to terminate
-            # the children.
-            waitpid( $pid, 0 );
-            exit;
-        }
-
-        # do the exec. if $0 is not executable, try running it with $^X.
-        exec {$0}( ( ( -x $0 ) ? () : ($^X) ), $0, @ARGV );
-    } if exists $SIG{'HUP'};
 
     # $pkg is generated anew for each invocation to "run"
     # Just so we can use different net_server() implementations
@@ -230,6 +209,8 @@
         *{"$pkg\::run"} = $self->_default_run;
     }
 
+    local $SIG{HUP} = sub { $SERVER_SHOULD_RUN = 0; };
+
     $pkg->run( port => $self->port );
 }
 
@@ -252,7 +233,7 @@
 
         $self->print_banner;
 
-        while (1) {
+        while ($SERVER_SHOULD_RUN) {
             local $SIG{PIPE} = 'IGNORE';    # If we don't ignore SIGPIPE, a
                  # client closing the connection before we
                  # finish sending will cause the server to exit
@@ -270,8 +251,37 @@
                 close $remote;
             }
         }
+
+        # Got here? Time to restart, due to SIGHUP
+        $self->restart;
     };
 }
+
+=head2 restart
+
+Restarts the server. Usually called by a HUP signal, not directly.
+
+=cut
+
+sub restart {
+    my $self = shift;
+
+    close HTTPDaemon;
+
+    $SIG{CHLD} = 'DEFAULT';
+    wait;
+
+    ### if the standalone server was invoked with perl -I .. we will loose
+    ### those include dirs upon re-exec. So add them to PERL5LIB, so they
+    ### are available again for the exec'ed process --kane
+    use Config;
+    $ENV{PERL5LIB} .= join $Config{path_sep}, @INC;
+
+    # Server simple
+    # do the exec. if $0 is not executable, try running it with $^X.
+    exec {$0}( ( ( -x $0 ) ? () : ($^X) ), $0, @ARGV );
+}
+
 
 sub _process_request {
     my $self = shift;




More information about the Pkg-perl-cvs-commits mailing list