OpenPKG CVS Repository http://cvs.openpkg.org/ ____________________________________________________________________________
Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-src Date: 07-Jul-2006 00:41:24 Branch: HEAD Handle: 2006070623412301 Modified files: openpkg-src/perl-www perl-www.patch perl-www.spec Log: support exec'd and and mod_perl CGI Summary: Revision Changes Path 1.16 +33 -9 openpkg-src/perl-www/perl-www.patch 1.301 +1 -1 openpkg-src/perl-www/perl-www.spec ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-src/perl-www/perl-www.patch ============================================================================ $ cvs diff -u -r1.15 -r1.16 perl-www.patch --- openpkg-src/perl-www/perl-www.patch 6 Jul 2006 12:34:41 -0000 1.15 +++ openpkg-src/perl-www/perl-www.patch 6 Jul 2006 22:41:23 -0000 1.16 @@ -26,14 +26,25 @@ Make over CGI::Gurumeditation <thl> o send proper HTTP status header and content type o make extensive attempts to expire immediately and get rid of cached data in browser and proxies + o support exec'd and and mod_perl CGI o visually come closer to Amiga in terms of color, border width, font and text o http://en.wikipedia.org/wiki/Image:Guru_meditation.gif o cleanup code replacing endless concats/escapes with qq{} Index: CGI-GuruMeditation-0.05/GuruMeditation.pm --- CGI-GuruMeditation-0.05/GuruMeditation.pm.orig Tue Feb 22 21:04:08 2005 -+++ CGI-GuruMeditation-0.05/GuruMeditation.pm Thu Jul 6 13:33:39 2006 -@@ -54,9 +54,15 @@ ++++ CGI-GuruMeditation-0.05/GuruMeditation.pm Fri Jul 7 00:25:26 2006 +@@ -35,6 +35,9 @@ + # optionally remember program name + $CGI::GuruMeditation::name = $name; + ++ # no operation outside CGI environment ++ return unless ($ENV{GATEWAY_INTERFACE} =~ m|^CGI|); ++ + # setup termination handler + $SIG{__DIE__} = sub { + my ($msg) = @_; +@@ -54,9 +57,15 @@ } # determine title @@ -52,7 +63,7 @@ # properly escape characters for HTML inclusion sub escape_html { -@@ -71,91 +77,95 @@ +@@ -71,91 +80,108 @@ $txt =~ s/([^\n])$/$1\n/s; return $txt; } @@ -67,11 +78,23 @@ + # generate HTTP page header + my $O = ""; -+ $O .= "HTTP/1.0 500 Internal Server Error\n"; -+ $O .= "Content-Type: text/html; charset=ISO-8859-1\n"; -+ $O .= "Expires: 0\n"; -+ $O .= "Cache-Control: no-cache\n"; # browser -+ $O .= "Pragma: no-cache\n"; # proxy ++ if ($ENV{MOD_PERL}) { ++ use Apache::Constants qw(HTTP_INTERNAL_SERVER_ERROR); ++ my $r = Apache->request; ++ $r->status(HTTP_INTERNAL_SERVER_ERROR); ++ $r->header_out("Expires", "0"); ++ $r->no_cache(1); ++ $r->content_type("text/html; charset=ISO-8859-1"); ++ $r->send_http_header(); ++ } ++ else { ++ $O .= "Status: 500 Internal Server Error\n"; ++ $O .= "Cache-Control: no-cache\n"; ++ $O .= "Expires: 0\n"; ++ $O .= "Pragma: no-cache\n"; ++ $O .= "Content-Type: text/html; charset=ISO-8859-1\n"; ++ $O .= "\n"; ++ } + # generate HTML page header - $O .= @@ -225,7 +248,8 @@ + </body> + </html> + }; -+ $O =~ s/^[ ]{12}//gm; ++ $O =~ s/^[ ]{12}//gm; # get rid of constant indentation ++ $O =~ s/\n(<html>)/\1/s; # get rid of leading newline # send response and die gracefully $|++; @@ . patch -p0 <<'@@ .' Index: openpkg-src/perl-www/perl-www.spec ============================================================================ $ cvs diff -u -r1.300 -r1.301 perl-www.spec --- openpkg-src/perl-www/perl-www.spec 6 Jul 2006 12:34:41 -0000 1.300 +++ openpkg-src/perl-www/perl-www.spec 6 Jul 2006 22:41:24 -0000 1.301 @@ -95,7 +95,7 @@ Group: Language License: GPL/Artistic Version: %{V_perl} -Release: 20060706 +Release: 20060707 # list of sources Source0: http://www.cpan.org/modules/by-module/URI/URI-%{V_uri}.tar.gz @@ . ______________________________________________________________________ The OpenPKG Project www.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org