Patchwork [1/6,v2] python: Fix cgi.py runtime issue

login
register
mail settings
Submitter Mark Hatle
Date Sept. 22, 2011, 1:55 a.m.
Message ID <ad8caef7798471d4c8d93980aef9ae7c2982bffd.1316656491.git.mark.hatle@windriver.com>
Download mbox | patch
Permalink /patch/11943/
State New, archived
Headers show

Comments

Mark Hatle - Sept. 22, 2011, 1:55 a.m.
By default cgi.py attempts to use /usr/local/bin/python as its
interpreter.  However, on my Linux systems, including OE-Core,
python is installed into {bindir}.  Adjust this one file based on
the comment at the top of the upstream file.

This resolves an issue where a runtime dependency discovered during
RPM packaging breaks the rootfs construction.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/recipes-devtools/python/python/cgi_py.patch |   23 ++++++++++++++++++++++
 meta/recipes-devtools/python/python_2.6.6.bb     |    3 +-
 2 files changed, 25 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-devtools/python/python/cgi_py.patch

Patch

diff --git a/meta/recipes-devtools/python/python/cgi_py.patch b/meta/recipes-devtools/python/python/cgi_py.patch
new file mode 100644
index 0000000..de504f9
--- /dev/null
+++ b/meta/recipes-devtools/python/python/cgi_py.patch
@@ -0,0 +1,23 @@ 
+Lib/cgi.py: Update the script as mentioned in the comment
+
+Upstream-Status: Inappropriate [distribution]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- Python-2.6.6/Lib/cgi.py.orig	2010-08-01 22:14:27.000000000 -0500
++++ Python-2.6.6/Lib/cgi.py	2011-09-21 15:28:40.478208631 -0500
+@@ -1,13 +1,4 @@
+-#! /usr/local/bin/python
+-
+-# NOTE: the above "/usr/local/bin/python" is NOT a mistake.  It is
+-# intentionally NOT "/usr/bin/env python".  On many systems
+-# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
+-# scripts, and /usr/local/bin is the default directory where Python is
+-# installed, so /usr/bin/env would be unable to find python.  Granted,
+-# binary installations by Linux vendors often install Python in
+-# /usr/bin.  So let those vendors patch cgi.py to match their choice
+-# of installation.
++#! /usr/bin/env python
+ 
+ """Support module for CGI (Common Gateway Interface) scripts.
+ 
diff --git a/meta/recipes-devtools/python/python_2.6.6.bb b/meta/recipes-devtools/python/python_2.6.6.bb
index c9c1a13..aa7ec3c 100644
--- a/meta/recipes-devtools/python/python_2.6.6.bb
+++ b/meta/recipes-devtools/python/python_2.6.6.bb
@@ -1,7 +1,7 @@ 
 require python.inc
 DEPENDS = "python-native db gdbm openssl readline sqlite3 zlib"
 DEPENDS_sharprom = "python-native db readline zlib gdbm openssl"
-PR = "${INC_PR}.9"
+PR = "${INC_PR}.10"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=38fdd546420fab09ac6bd3d8a1c83eb6"
 
 DISTRO_SRC_URI ?= "file://sitecustomize.py"
@@ -20,6 +20,7 @@  SRC_URI = "\
   ${DISTRO_SRC_URI} \
   file://multilib.patch \
   file://security_issue_2254_fix.patch \
+  file://cgi_py.patch \
 "
 
 SRC_URI[md5sum] = "cf4e6881bb84a7ce6089e4a307f71f14"