pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/ap-python As discussed in the mailing list:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c5b2bdc2b725
branches:  trunk
changeset: 463985:c5b2bdc2b725
user:      darcy <darcy%pkgsrc.org@localhost>
date:      Wed Dec 03 09:44:10 2003 +0000

description:
As discussed in the mailing list:

Moved to latest version 2.7.8.

Added patch that fixed flags when sending location header.

Added patch to cgihandler to append local directory so that relative URLs
would work.

Added patch to cgihandler to handle SystemExit so that pages would not
ISE when sys.exit(0) was used to exit from the script.

Added patch to break HTTP headers off from page correctly when CRLF and LF
is used inconsistently in a page.

diffstat:

 www/ap-python/Makefile         |  12 ++++++------
 www/ap-python/distinfo         |   9 ++++++---
 www/ap-python/patches/patch-ae |  14 ++++++++++++++
 www/ap-python/patches/patch-af |  23 +++++++++++++++++++++++
 www/ap-python/patches/patch-ag |  25 +++++++++++++++++++++++++
 5 files changed, 74 insertions(+), 9 deletions(-)

diffs (121 lines):

diff -r 120b3979d9dc -r c5b2bdc2b725 www/ap-python/Makefile
--- a/www/ap-python/Makefile    Wed Dec 03 09:33:17 2003 +0000
+++ b/www/ap-python/Makefile    Wed Dec 03 09:44:10 2003 +0000
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile,v 1.7 2003/07/17 22:55:26 grant Exp $
+# $NetBSD: Makefile,v 1.8 2003/12/03 09:44:10 darcy Exp $
 #
 
-DISTNAME=              mod_python-2.7.6
-PKGNAME=               ap-python-2.7.6
+DISTNAME=              mod_python-2.7.8
+PKGNAME=               ap-python-2.7.8
 CATEGORIES=            www
-MASTER_SITES=          http://www.modpython.org/dist/
-EXTRACT_SUFX=           .tgz
+MASTER_SITES=  http://www.modpython.org/dist/
+EXTRACT_SUFX=  .tgz
 
 MAINTAINER=            tech-pkg%NetBSD.org@localhost
 HOMEPAGE=              http://www.modpython.org/
@@ -17,7 +17,7 @@
 GNU_CONFIGURE=         yes
 CONFIGURE_ENV+=                PYTHON_BIN=${PYTHONBIN}
 MAKE_ENV+=             PYTHONBIN=${PYTHONBIN}
-PYTHON_VERSIONS_ACCEPTED=      20
+PYTHON_VERSIONS_ACCEPTED=      20 21 22 23
 
 post-install:
        ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/html/ap-mod_python
diff -r 120b3979d9dc -r c5b2bdc2b725 www/ap-python/distinfo
--- a/www/ap-python/distinfo    Wed Dec 03 09:33:17 2003 +0000
+++ b/www/ap-python/distinfo    Wed Dec 03 09:44:10 2003 +0000
@@ -1,8 +1,11 @@
-$NetBSD: distinfo,v 1.1.1.1 2002/02/05 21:05:58 drochner Exp $
+$NetBSD: distinfo,v 1.2 2003/12/03 09:44:10 darcy Exp $
 
-SHA1 (mod_python-2.7.6.tgz) = 37579015f2c2bf0c6106e8d301b8a09254221b54
-Size (mod_python-2.7.6.tgz) = 176449 bytes
+SHA1 (mod_python-2.7.8.tgz) = df92141135d75d6c6f4254cc015e712b627f539d
+Size (mod_python-2.7.8.tgz) = 176639 bytes
 SHA1 (patch-aa) = e1f3c0ea969ac3a512ac9b1ca171a3691cef1189
 SHA1 (patch-ab) = b79f50bed5ad6bda8f5e6aef111fbc9b9aedf943
 SHA1 (patch-ac) = 1c2a5c1d961e9710561c406b60518fbfef4cb2cb
 SHA1 (patch-ad) = 6ce2a424d581ebfc8763543451af566809b979a8
+SHA1 (patch-ae) = 2010c3b1522d61332bee60d052770e5addb115d1
+SHA1 (patch-af) = cd658639b5443ae63185611768b91f167bb06c7d
+SHA1 (patch-ag) = 0377336cdb8f40429d36277c23070a174a924c5b
diff -r 120b3979d9dc -r c5b2bdc2b725 www/ap-python/patches/patch-ae
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/ap-python/patches/patch-ae    Wed Dec 03 09:44:10 2003 +0000
@@ -0,0 +1,14 @@
+$NetBSD: patch-ae,v 1.1 2003/12/03 09:44:10 darcy Exp $
+
+--- lib/python/mod_python/apache.py.orig       2002-04-19 14:20:40.000000000 -0400
++++ lib/python/mod_python/apache.py
+@@ -552,6 +552,9 @@
+                     elif string.lower(h) == "content-type":
+                         self.req.content_type = v
+                         self.req.headers_out[h] = v
++                    elif h.lower() == "location":
++                        self.req.status = HTTP_MOVED_TEMPORARILY
++                        self.req.headers_out["location"] = v
+                     else:
+                         self.req.headers_out.add(h, v)
+                 self.req.send_http_header()
diff -r 120b3979d9dc -r c5b2bdc2b725 www/ap-python/patches/patch-af
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/ap-python/patches/patch-af    Wed Dec 03 09:44:10 2003 +0000
@@ -0,0 +1,23 @@
+$NetBSD: patch-af,v 1.1 2003/12/03 09:44:10 darcy Exp $
+
+--- lib/python/mod_python/cgihandler.py.orig   2000-12-05 22:05:37.000000000 -0500
++++ lib/python/mod_python/cgihandler.py
+@@ -108,6 +108,7 @@
+             # thread safe, this is why we must obtain the lock.
+             cwd = os.getcwd()
+             os.chdir(dir)
++            sys.path.append (dir)
+ 
+             # simulate cgi environment
+             env, si, so = apache.setup_cgi(req)
+@@ -119,7 +120,9 @@
+                 raise apache.SERVER_RETURN, apache.HTTP_NOT_FOUND
+ 
+             # this executes the module
+-            imp.load_module(module_name, fd, path, desc)
++            try: imp.load_module(module_name, fd, path, desc)
++            except SystemExit, e:
++                if not e or not e.args or e.args[0]: raise
+ 
+             return apache.OK
+ 
diff -r 120b3979d9dc -r c5b2bdc2b725 www/ap-python/patches/patch-ag
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/ap-python/patches/patch-ag    Wed Dec 03 09:44:10 2003 +0000
@@ -0,0 +1,25 @@
+$NetBSD: patch-ag,v 1.1 2003/12/03 09:44:10 darcy Exp $
+
+--- lib/python/mod_python/apache.py.orig       2002-04-19 14:20:40.000000000 -0400
++++ lib/python/mod_python/apache.py
+@@ -529,17 +529,9 @@
+             # are headers over yet?
+             headers_over = 0
+ 
+-            # first try RFC-compliant CRLF
+-            ss = string.split(self.headers, '\r\n\r\n', 1)
+-            if len(ss) < 2:
+-                # second try with \n\n
+-                ss = string.split(self.headers, '\n\n', 1)
+-                if len(ss) >= 2:
+-                    headers_over = 1
+-            else:
+-                headers_over = 1
+-                    
+-            if headers_over:
++            # split the headers from the body.
++            ss = string.split(self.headers.replace('\r\n', '\n'), '\n\n', 1)
++            if len(ss) == 2:
+                 # headers done, process them
+                 string.replace(ss[0], '\r\n', '\n')
+                 lines = string.split(ss[0], '\n')



Home | Main Index | Thread Index | Old Index