summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorNitin A Kamble <nitin.a.kamble@intel.com>2011-10-14 07:06:13 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-10-31 22:03:20 +0000
commit01103b2f299fd9aa05ecae40760c2011f235f710 (patch)
tree43ebed3560003af61dccfefeb2d3da4932ad7167 /meta
parent0d18f03b225ffaffb1e17b40ff909f4948880647 (diff)
downloadpoky-01103b2f299fd9aa05ecae40760c2011f235f710.tar.gz
python, python-native: upgrade from 2.6.6 to 2.7.2
Rebased these patches to the newer code modified: python-native/nohostlibs.patch modified: python/01-use-proper-tools-for-cross-build.patch modified: python/06-avoid_usr_lib_termcap_path_in_linking.patch modified: python/06-ctypes-libffi-fix-configure.patch modified: python/multilib.patch Deleted these patches are the are now upstream deleted: python/02-remove-test-for-cross.patch deleted: python/security_issue_2254_fix.patch Added this patch to python-native new file: python-native/multilib.patch Updated site config file for python modified: ../../site/common-linux : add ac_cv_have_long_long_format for python avoid this error in python: Include/pyport.h:243:13: error: #error "This platform's pyconfig.h needs to define PY_FORMAT_LONG_LONG" Updated default python version modified: ../../conf/distro/include/default-versions.inc (From OE-Core rev: b284e9a512860b8a8380be80f96cebce6b92ff80) Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/conf/distro/include/default-versions.inc6
-rw-r--r--meta/recipes-devtools/python/python-2.7-manifest.inc (renamed from meta/recipes-devtools/python/python-2.6-manifest.inc)0
-rw-r--r--meta/recipes-devtools/python/python-native/multilib.patch240
-rw-r--r--meta/recipes-devtools/python/python-native/nohostlibs.patch36
-rw-r--r--meta/recipes-devtools/python/python-native_2.7.2.bb (renamed from meta/recipes-devtools/python/python-native_2.6.6.bb)13
-rw-r--r--meta/recipes-devtools/python/python.inc17
-rw-r--r--meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch80
-rw-r--r--meta/recipes-devtools/python/python/02-remove-test-for-cross.patch108
-rw-r--r--meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch12
-rw-r--r--meta/recipes-devtools/python/python/06-ctypes-libffi-fix-configure.patch42
-rw-r--r--meta/recipes-devtools/python/python/multilib.patch126
-rw-r--r--meta/recipes-devtools/python/python/security_issue_2254_fix.patch184
-rw-r--r--meta/recipes-devtools/python/python_2.7.2.bb (renamed from meta/recipes-devtools/python/python_2.6.6.bb)10
-rw-r--r--meta/site/common-linux3
14 files changed, 423 insertions, 454 deletions
diff --git a/meta/conf/distro/include/default-versions.inc b/meta/conf/distro/include/default-versions.inc
index e3ef1e6661..90ff005089 100644
--- a/meta/conf/distro/include/default-versions.inc
+++ b/meta/conf/distro/include/default-versions.inc
@@ -4,9 +4,9 @@
4PREFERRED_VERSION_pulseaudio ?= "0.9.23" 4PREFERRED_VERSION_pulseaudio ?= "0.9.23"
5 5
6# Force the python versions in one place 6# Force the python versions in one place
7PYTHON_BASEVERSION ?= "2.6" 7PYTHON_BASEVERSION ?= "2.7"
8PREFERRED_VERSION_python ?= "2.6.6" 8PREFERRED_VERSION_python ?= "2.7.2"
9PREFERRED_VERSION_python-native ?= "2.6.6" 9PREFERRED_VERSION_python-native ?= "2.7.2"
10 10
11# Force the older version of liberation-fonts until we fix the fontforge issue 11# Force the older version of liberation-fonts until we fix the fontforge issue
12PREFERRED_VERSION_liberation-fonts ?= "1.04" 12PREFERRED_VERSION_liberation-fonts ?= "1.04"
diff --git a/meta/recipes-devtools/python/python-2.6-manifest.inc b/meta/recipes-devtools/python/python-2.7-manifest.inc
index e3ebe4141e..e3ebe4141e 100644
--- a/meta/recipes-devtools/python/python-2.6-manifest.inc
+++ b/meta/recipes-devtools/python/python-2.7-manifest.inc
diff --git a/meta/recipes-devtools/python/python-native/multilib.patch b/meta/recipes-devtools/python/python-native/multilib.patch
new file mode 100644
index 0000000000..f8d7aee84b
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/multilib.patch
@@ -0,0 +1,240 @@
1commit 248279e54467a8cd5cde98fc124d1d1384703513
2Author: Yu Ke <ke.yu@intel.com>
3Date: Tue Jun 28 21:21:29 2011 +0800
4
5 SUSE patch for the lib64 issue
6
7 see detail in http://bugs.python.org/issue1294959
8
9 also rebased a bit for Yocto python 2.6.6
10
11 Picked-by: Yu Ke <ke.yu@intel.com>
12
13
142011/09/29
15The python recipe building was failing because python-native
16could not handle sys.lib var. sys.lib var is defined in the
17multilib patch hence added this multilib.patch for python-native
18recipe.
19Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
20
21Index: Python-2.7.2/Include/pythonrun.h
22===================================================================
23--- Python-2.7.2.orig/Include/pythonrun.h
24+++ Python-2.7.2/Include/pythonrun.h
25@@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void);
26 /* In their own files */
27 PyAPI_FUNC(const char *) Py_GetVersion(void);
28 PyAPI_FUNC(const char *) Py_GetPlatform(void);
29+PyAPI_FUNC(const char *) Py_GetLib(void);
30 PyAPI_FUNC(const char *) Py_GetCopyright(void);
31 PyAPI_FUNC(const char *) Py_GetCompiler(void);
32 PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
33Index: Python-2.7.2/Lib/distutils/command/install.py
34===================================================================
35--- Python-2.7.2.orig/Lib/distutils/command/install.py
36+++ Python-2.7.2/Lib/distutils/command/install.py
37@@ -22,6 +22,8 @@ from site import USER_BASE
38 from site import USER_SITE
39
40
41+libname = sys.lib
42+
43 if sys.version < "2.2":
44 WINDOWS_SCHEME = {
45 'purelib': '$base',
46@@ -42,7 +44,7 @@ else:
47 INSTALL_SCHEMES = {
48 'unix_prefix': {
49 'purelib': '$base/lib/python$py_version_short/site-packages',
50- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
51+ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
52 'headers': '$base/include/python$py_version_short/$dist_name',
53 'scripts': '$base/bin',
54 'data' : '$base',
55Index: Python-2.7.2/Lib/pydoc.py
56===================================================================
57--- Python-2.7.2.orig/Lib/pydoc.py
58+++ Python-2.7.2/Lib/pydoc.py
59@@ -352,7 +352,7 @@ class Doc:
60
61 docloc = os.environ.get("PYTHONDOCS",
62 "http://docs.python.org/library")
63- basedir = os.path.join(sys.exec_prefix, "lib",
64+ basedir = os.path.join(sys.exec_prefix, sys.lib,
65 "python"+sys.version[0:3])
66 if (isinstance(object, type(os)) and
67 (object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
68Index: Python-2.7.2/Lib/site.py
69===================================================================
70--- Python-2.7.2.orig/Lib/site.py
71+++ Python-2.7.2/Lib/site.py
72@@ -300,13 +300,19 @@ def getsitepackages():
73 if sys.platform in ('os2emx', 'riscos'):
74 sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
75 elif os.sep == '/':
76- sitepackages.append(os.path.join(prefix, "lib",
77+ sitepackages.append(os.path.join(prefix, sys.lib,
78 "python" + sys.version[:3],
79 "site-packages"))
80- sitepackages.append(os.path.join(prefix, "lib", "site-python"))
81+ if sys.lib != "lib":
82+ sitepackages.append(os.path.join(prefix, "lib",
83+ "python" + sys.version[:3],
84+ "site-packages"))
85+ sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
86+ if sys.lib != "lib":
87+ sitepackages.append(os.path.join(prefix, "lib", "site-python"))
88 else:
89 sitepackages.append(prefix)
90- sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
91+ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
92 if sys.platform == "darwin":
93 # for framework builds *only* we add the standard Apple
94 # locations.
95Index: Python-2.7.2/Lib/test/test_dl.py
96===================================================================
97--- Python-2.7.2.orig/Lib/test/test_dl.py
98+++ Python-2.7.2/Lib/test/test_dl.py
99@@ -5,10 +5,11 @@
100 import unittest
101 from test.test_support import verbose, import_module
102 dl = import_module('dl', deprecated=True)
103+import sys
104
105 sharedlibs = [
106- ('/usr/lib/libc.so', 'getpid'),
107- ('/lib/libc.so.6', 'getpid'),
108+ ('/usr/'+sys.lib+'/libc.so', 'getpid'),
109+ ('/'+sys.lib+'/libc.so.6', 'getpid'),
110 ('/usr/bin/cygwin1.dll', 'getpid'),
111 ('/usr/lib/libc.dylib', 'getpid'),
112 ]
113Index: Python-2.7.2/Lib/trace.py
114===================================================================
115--- Python-2.7.2.orig/Lib/trace.py
116+++ Python-2.7.2/Lib/trace.py
117@@ -762,10 +762,10 @@ def main(argv=None):
118 # should I also call expanduser? (after all, could use $HOME)
119
120 s = s.replace("$prefix",
121- os.path.join(sys.prefix, "lib",
122+ os.path.join(sys.prefix, sys.lib,
123 "python" + sys.version[:3]))
124 s = s.replace("$exec_prefix",
125- os.path.join(sys.exec_prefix, "lib",
126+ os.path.join(sys.exec_prefix, sys.lib,
127 "python" + sys.version[:3]))
128 s = os.path.normpath(s)
129 ignore_dirs.append(s)
130Index: Python-2.7.2/Makefile.pre.in
131===================================================================
132--- Python-2.7.2.orig/Makefile.pre.in
133+++ Python-2.7.2/Makefile.pre.in
134@@ -81,6 +81,7 @@ PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAG
135
136 # Machine-dependent subdirectories
137 MACHDEP= @MACHDEP@
138+LIB= @LIB@
139
140 # Install prefix for architecture-independent files
141 prefix= @prefix@
142@@ -97,7 +98,7 @@ LIBDIR= @libdir@
143 MANDIR= @mandir@
144 INCLUDEDIR= @includedir@
145 CONFINCLUDEDIR= $(exec_prefix)/include
146-SCRIPTDIR= $(prefix)/lib
147+SCRIPTDIR= $(prefix)/@LIB@
148
149 # Detailed destination directories
150 BINLIBDEST= $(LIBDIR)/python$(VERSION)
151@@ -532,6 +533,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
152 -DEXEC_PREFIX='"$(exec_prefix)"' \
153 -DVERSION='"$(VERSION)"' \
154 -DVPATH='"$(VPATH)"' \
155+ -DLIB='"$(LIB)"' \
156 -o $@ $(srcdir)/Modules/getpath.c
157
158 Modules/python.o: $(srcdir)/Modules/python.c
159@@ -566,7 +568,7 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
160 Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
161
162 Python/getplatform.o: $(srcdir)/Python/getplatform.c
163- $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
164+ $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
165
166 Python/importdl.o: $(srcdir)/Python/importdl.c
167 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
168Index: Python-2.7.2/Modules/getpath.c
169===================================================================
170--- Python-2.7.2.orig/Modules/getpath.c
171+++ Python-2.7.2/Modules/getpath.c
172@@ -116,9 +116,11 @@
173 #define EXEC_PREFIX PREFIX
174 #endif
175
176+#define LIB_PYTHON LIB "/python" VERSION
177+
178 #ifndef PYTHONPATH
179-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
180- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
181+#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
182+ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
183 #endif
184
185 #ifndef LANDMARK
186@@ -129,7 +131,7 @@ static char prefix[MAXPATHLEN+1];
187 static char exec_prefix[MAXPATHLEN+1];
188 static char progpath[MAXPATHLEN+1];
189 static char *module_search_path = NULL;
190-static char lib_python[] = "lib/python" VERSION;
191+static char lib_python[] = LIB_PYTHON;
192
193 static void
194 reduce(char *dir)
195Index: Python-2.7.2/Python/getplatform.c
196===================================================================
197--- Python-2.7.2.orig/Python/getplatform.c
198+++ Python-2.7.2/Python/getplatform.c
199@@ -10,3 +10,13 @@ Py_GetPlatform(void)
200 {
201 return PLATFORM;
202 }
203+
204+#ifndef LIB
205+#define LIB "lib"
206+#endif
207+
208+const char *
209+Py_GetLib(void)
210+{
211+ return LIB;
212+}
213Index: Python-2.7.2/Python/sysmodule.c
214===================================================================
215--- Python-2.7.2.orig/Python/sysmodule.c
216+++ Python-2.7.2/Python/sysmodule.c
217@@ -1416,6 +1416,8 @@ _PySys_Init(void)
218 PyString_FromString(Py_GetCopyright()));
219 SET_SYS_FROM_STRING("platform",
220 PyString_FromString(Py_GetPlatform()));
221+ SET_SYS_FROM_STRING("lib",
222+ PyString_FromString(Py_GetLib()));
223 SET_SYS_FROM_STRING("executable",
224 PyString_FromString(Py_GetProgramFullPath()));
225 SET_SYS_FROM_STRING("prefix",
226Index: Python-2.7.2/configure.in
227===================================================================
228--- Python-2.7.2.orig/configure.in
229+++ Python-2.7.2/configure.in
230@@ -629,6 +629,10 @@ SunOS*)
231 ;;
232 esac
233
234+AC_SUBST(LIB)
235+AC_MSG_CHECKING(LIB)
236+LIB=`basename ${libdir}`
237+AC_MSG_RESULT($LIB)
238
239 AC_SUBST(LIBRARY)
240 AC_MSG_CHECKING(LIBRARY)
diff --git a/meta/recipes-devtools/python/python-native/nohostlibs.patch b/meta/recipes-devtools/python/python-native/nohostlibs.patch
index aed45c9913..09c3fb808a 100644
--- a/meta/recipes-devtools/python/python-native/nohostlibs.patch
+++ b/meta/recipes-devtools/python/python-native/nohostlibs.patch
@@ -1,10 +1,14 @@
1Upstream-Status: Inappropriate [embedded specific] 1Upstream-Status: Inappropriate [embedded specific]
2 2
3Index: Python-2.6.6/setup.py 32011/09/29
4rebased for python-2.7.2
5Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
6
7Index: Python-2.7.2/setup.py
4=================================================================== 8===================================================================
5--- Python-2.6.6.orig/setup.py 9--- Python-2.7.2.orig/setup.py
6+++ Python-2.6.6/setup.py 10+++ Python-2.7.2/setup.py
7@@ -356,8 +356,8 @@ class PyBuildExt(build_ext): 11@@ -369,8 +369,8 @@ class PyBuildExt(build_ext):
8 12
9 def detect_modules(self): 13 def detect_modules(self):
10 # Ensure that /usr/local is always used 14 # Ensure that /usr/local is always used
@@ -12,16 +16,22 @@ Index: Python-2.6.6/setup.py
12- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') 16- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
13+ #add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') 17+ #add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
14+ #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') 18+ #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
19 self.add_multiarch_paths()
15 20
16 # Add paths specified in the environment variables LDFLAGS and 21 # Add paths specified in the environment variables LDFLAGS and
17 # CPPFLAGS for header and library files. 22@@ -407,15 +407,15 @@ class PyBuildExt(build_ext):
18@@ -393,10 +393,10 @@ class PyBuildExt(build_ext):
19 for directory in reversed(options.dirs): 23 for directory in reversed(options.dirs):
20 add_dir_to_list(dir_list, directory) 24 add_dir_to_list(dir_list, directory)
21 25
22- if os.path.normpath(sys.prefix) != '/usr': 26- if os.path.normpath(sys.prefix) != '/usr' \
27- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
28+ #if os.path.normpath(sys.prefix) != '/usr' \
29+ #and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
30 # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
31 # (PYTHONFRAMEWORK is set) to avoid # linking problems when
32 # building a framework with different architectures than
33 # the one that is currently installed (issue #7473)
23- add_dir_to_list(self.compiler.library_dirs, 34- add_dir_to_list(self.compiler.library_dirs,
24+
25+ add_dir_to_list(self.compiler.library_dirs, 35+ add_dir_to_list(self.compiler.library_dirs,
26 sysconfig.get_config_var("LIBDIR")) 36 sysconfig.get_config_var("LIBDIR"))
27- add_dir_to_list(self.compiler.include_dirs, 37- add_dir_to_list(self.compiler.include_dirs,
@@ -29,7 +39,7 @@ Index: Python-2.6.6/setup.py
29 sysconfig.get_config_var("INCLUDEDIR")) 39 sysconfig.get_config_var("INCLUDEDIR"))
30 40
31 try: 41 try:
32@@ -407,11 +407,8 @@ class PyBuildExt(build_ext): 42@@ -426,11 +426,8 @@ class PyBuildExt(build_ext):
33 # lib_dirs and inc_dirs are used to search for files; 43 # lib_dirs and inc_dirs are used to search for files;
34 # if a file is found in one of those directories, it can 44 # if a file is found in one of those directories, it can
35 # be assumed that no additional -I,-L directives are needed. 45 # be assumed that no additional -I,-L directives are needed.
@@ -43,13 +53,15 @@ Index: Python-2.6.6/setup.py
43 exts = [] 53 exts = []
44 missing = [] 54 missing = []
45 55
46@@ -661,8 +658,7 @@ class PyBuildExt(build_ext): 56@@ -676,9 +673,8 @@ class PyBuildExt(build_ext):
47 pass # Issue 7384: Already linked against curses or tinfo. 57 pass # Issue 7384: Already linked against curses or tinfo.
48 elif curses_library: 58 elif curses_library:
49 readline_libs.append(curses_library) 59 readline_libs.append(curses_library)
50- elif self.compiler.find_library_file(lib_dirs + 60- elif self.compiler.find_library_file(lib_dirs +
51- ['/usr/lib/termcap'], 61- ['/usr/lib/termcap'],
62- 'termcap'):
52+ elif self.compiler.find_library_file(lib_dirs, 63+ elif self.compiler.find_library_file(lib_dirs,
53 'termcap'): 64+ 'termcap'):
54 readline_libs.append('termcap') 65 readline_libs.append('termcap')
55 exts.append( Extension('readline', ['readline.c'], 66 exts.append( Extension('readline', ['readline.c'],
67 library_dirs=['/usr/lib/termcap'],
diff --git a/meta/recipes-devtools/python/python-native_2.6.6.bb b/meta/recipes-devtools/python/python-native_2.7.2.bb
index e0a4fb36d9..6b90d5b891 100644
--- a/meta/recipes-devtools/python/python-native_2.6.6.bb
+++ b/meta/recipes-devtools/python/python-native_2.7.2.bb
@@ -1,11 +1,8 @@
1require python.inc 1require python.inc
2DEPENDS = "openssl-native bzip2-full-native zlib-native readline-native sqlite3-native" 2DEPENDS = "openssl-native bzip2-full-native zlib-native readline-native sqlite3-native"
3PR = "${INC_PR}.4" 3PR = "${INC_PR}.0"
4 4
5LIC_FILES_CHKSUM = "file://LICENSE;md5=38fdd546420fab09ac6bd3d8a1c83eb6" 5SRC_URI += "file://04-default-is-optimized.patch \
6
7SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \
8 file://04-default-is-optimized.patch \
9 file://05-enable-ctypes-cross-build.patch \ 6 file://05-enable-ctypes-cross-build.patch \
10 file://06-ctypes-libffi-fix-configure.patch \ 7 file://06-ctypes-libffi-fix-configure.patch \
11 file://10-distutils-fix-swig-parameter.patch \ 8 file://10-distutils-fix-swig-parameter.patch \
@@ -13,12 +10,10 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \
13 file://12-distutils-prefix-is-inside-staging-area.patch \ 10 file://12-distutils-prefix-is-inside-staging-area.patch \
14 file://debug.patch \ 11 file://debug.patch \
15 file://unixccompiler.patch \ 12 file://unixccompiler.patch \
16 file://nohostlibs.patch" 13 file://nohostlibs.patch \
14 file://multilib.patch "
17S = "${WORKDIR}/Python-${PV}" 15S = "${WORKDIR}/Python-${PV}"
18 16
19SRC_URI[md5sum] = "cf4e6881bb84a7ce6089e4a307f71f14"
20SRC_URI[sha256sum] = "134c5e0736bae2e5570d0b915693374f11108ded63c35a23a35d282737d2ce83"
21
22inherit native 17inherit native
23 18
24EXTRA_OEMAKE = '\ 19EXTRA_OEMAKE = '\
diff --git a/meta/recipes-devtools/python/python.inc b/meta/recipes-devtools/python/python.inc
index a6cc91789c..3e970a7161 100644
--- a/meta/recipes-devtools/python/python.inc
+++ b/meta/recipes-devtools/python/python.inc
@@ -1,13 +1,18 @@
1DESCRIPTION = "The Python Programming Language" 1DESCRIPTION = "The Python Programming Language"
2HOMEPAGE = "http://www.python.org" 2HOMEPAGE = "http://www.python.org"
3LICENSE = "PSF" 3LICENSE = "PSFv2"
4SECTION = "devel/python" 4SECTION = "devel/python"
5# bump this on every change in contrib/python/generate-manifest-2.6.py 5# bump this on every change in contrib/python/generate-manifest-2.7.py
6INC_PR = "r2" 6INC_PR = "r0"
7 7
8DEFAULT_PREFERENCE = "-26" 8LIC_FILES_CHKSUM = "file://LICENSE;md5=2dffb81509b47974467ea23409909b1c"
9 9
10PYTHON_MAJMIN = "2.6" 10SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2"
11
12SRC_URI[md5sum] = "ba7b2f11ffdbf195ee0d111b9455a5bd"
13SRC_URI[sha256sum] = "5057eb067eb5b5a6040dbd0e889e06550bde9ec041dadaa855ee9490034cbdab"
14
15PYTHON_MAJMIN = "2.7"
11 16
12inherit autotools 17inherit autotools
13 18
@@ -30,5 +35,3 @@ EXTRA_OECONF_linuxstdbase = "\
30 --enable-shared \ 35 --enable-shared \
31 ac_cv_sizeof_off_t=8 \ 36 ac_cv_sizeof_off_t=8 \
32" 37"
33
34PARALLEL_MAKE = ""
diff --git a/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch b/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch
index 6c769ac7d3..27afc030b2 100644
--- a/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch
+++ b/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch
@@ -4,11 +4,11 @@ Upstream-Status: Inappropriate [embedded specific]
4# built cross-tools (this will not work), so we introduce HOSTPYTHON and HOSTPGEN. 4# built cross-tools (this will not work), so we introduce HOSTPYTHON and HOSTPGEN.
5# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de> 5# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
6 6
7Index: Python-2.6.6/Makefile.pre.in 7Index: Python-2.7.2/Makefile.pre.in
8=================================================================== 8===================================================================
9--- Python-2.6.6.orig/Makefile.pre.in 9--- Python-2.7.2.orig/Makefile.pre.in
10+++ Python-2.6.6/Makefile.pre.in 10+++ Python-2.7.2/Makefile.pre.in
11@@ -175,6 +175,7 @@ UNICODE_OBJS= @UNICODE_OBJS@ 11@@ -182,6 +182,7 @@ UNICODE_OBJS= @UNICODE_OBJS@
12 12
13 PYTHON= python$(EXE) 13 PYTHON= python$(EXE)
14 BUILDPYTHON= python$(BUILDEXE) 14 BUILDPYTHON= python$(BUILDEXE)
@@ -16,7 +16,7 @@ Index: Python-2.6.6/Makefile.pre.in
16 16
17 # The task to run while instrument when building the profile-opt target 17 # The task to run while instrument when building the profile-opt target
18 PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck 18 PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
19@@ -205,7 +206,7 @@ GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar 19@@ -214,7 +215,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
20 ########################################################################## 20 ##########################################################################
21 # Parser 21 # Parser
22 PGEN= Parser/pgen$(EXE) 22 PGEN= Parser/pgen$(EXE)
@@ -25,39 +25,48 @@ Index: Python-2.6.6/Makefile.pre.in
25 POBJS= \ 25 POBJS= \
26 Parser/acceler.o \ 26 Parser/acceler.o \
27 Parser/grammar1.o \ 27 Parser/grammar1.o \
28@@ -394,8 +395,8 @@ platform: $(BUILDPYTHON) 28@@ -401,14 +402,14 @@ $(BUILDPYTHON): Modules/python.o $(LIBRA
29 $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
30
31 platform: $(BUILDPYTHON)
32- $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
33+ $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
34
35
29 # Build the shared modules 36 # Build the shared modules
30 sharedmods: $(BUILDPYTHON) 37 sharedmods: $(BUILDPYTHON)
31 @case $$MAKEFLAGS in \ 38 @case $$MAKEFLAGS in \
32- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \ 39- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
33- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ 40- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
34+ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \ 41+ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
35+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \ 42+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
36 esac 43 esac
37 44
38 # Build static library 45 # Build static library
39@@ -517,7 +518,7 @@ Modules/python.o: $(srcdir)/Modules/pyth 46@@ -542,7 +543,7 @@ Modules/python.o: $(srcdir)/Modules/pyth
40 47 $(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp
41 $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT) 48 Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT)
42 -@$(INSTALL) -d Include 49 -@$(INSTALL) -d Include
43- -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) 50- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
44+ -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) 51+ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
52 -touch Parser/pgen.stamp
45 53
46 $(PGEN): $(PGENOBJS) 54 $(PGEN): $(PGENOBJS)
47 $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) 55@@ -926,25 +927,25 @@ libinstall: build_all $(srcdir)/Lib/$(PL
48@@ -887,23 +888,23 @@ libinstall: build_all $(srcdir)/Lib/$(PL
49 done 56 done
50 $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt 57 $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
51 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ 58 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
52- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ 59- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
53+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ 60+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
54 -d $(LIBDEST) -f \ 61 -d $(LIBDEST) -f \
55 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST) 62 -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
63 $(DESTDIR)$(LIBDEST)
56 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ 64 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
57- ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ 65- ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
58+ $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ 66+ $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
59 -d $(LIBDEST) -f \ 67 -d $(LIBDEST) -f \
60 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST) 68 -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
69 $(DESTDIR)$(LIBDEST)
61 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ 70 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
62- ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ 71- ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
63+ $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ 72+ $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
@@ -74,20 +83,20 @@ Index: Python-2.6.6/Makefile.pre.in
74 83
75 # Create the PLATDIR source directory, if one wasn't distributed.. 84 # Create the PLATDIR source directory, if one wasn't distributed..
76 $(srcdir)/Lib/$(PLATDIR): 85 $(srcdir)/Lib/$(PLATDIR):
77@@ -1001,7 +1002,7 @@ libainstall: all 86@@ -1049,7 +1050,7 @@ libainstall: all python-config
78 # Install the dynamically loadable modules 87 # Install the dynamically loadable modules
79 # This goes into $(exec_prefix) 88 # This goes into $(exec_prefix)
80 sharedinstall: 89 sharedinstall: sharedmods
81- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \ 90- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
82+ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \ 91+ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
83 --prefix=$(prefix) \ 92 --prefix=$(prefix) \
84 --install-scripts=$(BINDIR) \ 93 --install-scripts=$(BINDIR) \
85 --install-platlib=$(DESTSHARED) \ 94 --install-platlib=$(DESTSHARED) \
86Index: Python-2.6.6/setup.py 95Index: Python-2.7.2/setup.py
87=================================================================== 96===================================================================
88--- Python-2.6.6.orig/setup.py 97--- Python-2.7.2.orig/setup.py
89+++ Python-2.6.6/setup.py 98+++ Python-2.7.2/setup.py
90@@ -322,6 +322,7 @@ class PyBuildExt(build_ext): 99@@ -313,6 +313,7 @@ class PyBuildExt(build_ext):
91 self.failed.append(ext.name) 100 self.failed.append(ext.name)
92 self.announce('*** WARNING: renaming "%s" since importing it' 101 self.announce('*** WARNING: renaming "%s" since importing it'
93 ' failed: %s' % (ext.name, why), level=3) 102 ' failed: %s' % (ext.name, why), level=3)
@@ -95,18 +104,18 @@ Index: Python-2.6.6/setup.py
95 assert not self.inplace 104 assert not self.inplace
96 basename, tail = os.path.splitext(ext_filename) 105 basename, tail = os.path.splitext(ext_filename)
97 newname = basename + "_failed" + tail 106 newname = basename + "_failed" + tail
98@@ -356,8 +357,8 @@ class PyBuildExt(build_ext): 107@@ -369,8 +370,8 @@ class PyBuildExt(build_ext):
99 108
100 def detect_modules(self): 109 def detect_modules(self):
101 # Ensure that /usr/local is always used 110 # Ensure that /usr/local is always used
102- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') 111- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
103- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') 112- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
104+ # add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') 113+ #add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
105+ # add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') 114+ #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
115 self.add_multiarch_paths()
106 116
107 # Add paths specified in the environment variables LDFLAGS and 117 # Add paths specified in the environment variables LDFLAGS and
108 # CPPFLAGS for header and library files. 118@@ -475,6 +476,9 @@ class PyBuildExt(build_ext):
109@@ -456,6 +457,9 @@ class PyBuildExt(build_ext):
110 119
111 # XXX Omitted modules: gl, pure, dl, SGI-specific modules 120 # XXX Omitted modules: gl, pure, dl, SGI-specific modules
112 121
@@ -116,3 +125,14 @@ Index: Python-2.6.6/setup.py
116 # 125 #
117 # The following modules are all pretty straightforward, and compile 126 # The following modules are all pretty straightforward, and compile
118 # on pretty much any POSIXish platform. 127 # on pretty much any POSIXish platform.
128@@ -677,8 +681,8 @@ class PyBuildExt(build_ext):
129 elif curses_library:
130 readline_libs.append(curses_library)
131 elif self.compiler.find_library_file(lib_dirs +
132- ['/usr/lib/termcap'],
133- 'termcap'):
134+ ['/usr/lib/termcap'],
135+ 'termcap'):
136 readline_libs.append('termcap')
137 exts.append( Extension('readline', ['readline.c'],
138 library_dirs=['/usr/lib/termcap'],
diff --git a/meta/recipes-devtools/python/python/02-remove-test-for-cross.patch b/meta/recipes-devtools/python/python/02-remove-test-for-cross.patch
deleted file mode 100644
index 9b164d5df7..0000000000
--- a/meta/recipes-devtools/python/python/02-remove-test-for-cross.patch
+++ /dev/null
@@ -1,108 +0,0 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3# OpenEmbedded prepopulates the autotools site cache, so if this
4# would be using AC_TRY_CACHE, we could patch it in a more sane way
5# Alas, I don't have enough autotalent to do that.
6#
7# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
8Index: Python-2.6.1/configure.in
9===================================================================
10--- Python-2.6.5.orig/configure.in 2010-07-06 04:37:09.000000000 -0700
11+++ Python-2.6.5/configure.in 2010-07-06 04:40:18.000000000 -0700
12@@ -2697,50 +2697,6 @@
13 AC_CHECK_LIB(resolv, inet_aton)
14 )
15
16-# On Tru64, chflags seems to be present, but calling it will
17-# exit Python
18-AC_CACHE_CHECK([for chflags], [ac_cv_have_chflags], [dnl
19-AC_TRY_RUN([[
20-#include <sys/stat.h>
21-#include <unistd.h>
22-int main(int argc, char*argv[])
23-{
24- if(chflags(argv[0], 0) != 0)
25- return 1;
26- return 0;
27-}
28-]], ac_cv_have_chflags=yes,
29- ac_cv_have_chflags=no,
30- ac_cv_have_chflags=cross)
31-])
32-if test "$ac_cv_have_chflags" = cross ; then
33- AC_CHECK_FUNC([chflags], [ac_cv_have_chflags="yes"], [ac_cv_have_chflags="no"])
34-fi
35-if test "$ac_cv_have_chflags" = yes ; then
36- AC_DEFINE(HAVE_CHFLAGS, 1, Define to 1 if you have the `chflags' function.)
37-fi
38-
39-AC_CACHE_CHECK([for lchflags], [ac_cv_have_lchflags], [dnl
40-AC_TRY_RUN([[
41-#include <sys/stat.h>
42-#include <unistd.h>
43-int main(int argc, char*argv[])
44-{
45- if(lchflags(argv[0], 0) != 0)
46- return 1;
47- return 0;
48-}
49-]], ac_cv_have_lchflags=yes,
50- ac_cv_have_lchflags=no,
51- ac_cv_have_lchflags=cross)
52-])
53-if test "$ac_cv_have_lchflags" = cross ; then
54- AC_CHECK_FUNC([lchflags], [ac_cv_have_lchflags="yes"], [ac_cv_have_lchflags="no"])
55-fi
56-if test "$ac_cv_have_lchflags" = yes ; then
57- AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.)
58-fi
59-
60 dnl Check if system zlib has *Copy() functions
61 dnl
62 dnl On MacOSX the linker will search for dylibs on the entire linker path
63@@ -3844,45 +3800,6 @@
64 AC_MSG_RESULT(no)
65 fi
66
67-AC_MSG_CHECKING(for %zd printf() format support)
68-AC_TRY_RUN([#include <stdio.h>
69-#include <stddef.h>
70-#include <string.h>
71-
72-#ifdef HAVE_SYS_TYPES_H
73-#include <sys/types.h>
74-#endif
75-
76-#ifdef HAVE_SSIZE_T
77-typedef ssize_t Py_ssize_t;
78-#elif SIZEOF_VOID_P == SIZEOF_LONG
79-typedef long Py_ssize_t;
80-#else
81-typedef int Py_ssize_t;
82-#endif
83-
84-int main()
85-{
86- char buffer[256];
87-
88- if(sprintf(buffer, "%zd", (size_t)123) < 0)
89- return 1;
90-
91- if (strcmp(buffer, "123"))
92- return 1;
93-
94- if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0)
95- return 1;
96-
97- if (strcmp(buffer, "-123"))
98- return 1;
99-
100- return 0;
101-}],
102-[AC_MSG_RESULT(yes)
103- AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
104- AC_MSG_RESULT(no))
105-
106 AC_CHECK_TYPE(socklen_t,,
107 AC_DEFINE(socklen_t,int,
108 Define to `int' if <sys/socket.h> does not define.),[
diff --git a/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch b/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch
index b39b22f496..f8ab0e71e9 100644
--- a/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch
+++ b/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch
@@ -9,11 +9,15 @@ This Patch fixes this issue in the python build environment.
911 Oct 2010 911 Oct 2010
10Nitin A Kamble <nitin.a.kamble@intel.com> 10Nitin A Kamble <nitin.a.kamble@intel.com>
11 11
12Index: Python-2.6.6/setup.py 122011/09/29
13Rebased for python 2.7.2
14Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
15
16Index: Python-2.7.2/setup.py
13=================================================================== 17===================================================================
14--- Python-2.6.6.orig/setup.py 18--- Python-2.7.2.orig/setup.py
15+++ Python-2.6.6/setup.py 19+++ Python-2.7.2/setup.py
16@@ -665,12 +665,10 @@ class PyBuildExt(build_ext): 20@@ -680,12 +680,10 @@ class PyBuildExt(build_ext):
17 pass # Issue 7384: Already linked against curses or tinfo. 21 pass # Issue 7384: Already linked against curses or tinfo.
18 elif curses_library: 22 elif curses_library:
19 readline_libs.append(curses_library) 23 readline_libs.append(curses_library)
diff --git a/meta/recipes-devtools/python/python/06-ctypes-libffi-fix-configure.patch b/meta/recipes-devtools/python/python/06-ctypes-libffi-fix-configure.patch
index 8de5694cb4..abd63d2a96 100644
--- a/meta/recipes-devtools/python/python/06-ctypes-libffi-fix-configure.patch
+++ b/meta/recipes-devtools/python/python/06-ctypes-libffi-fix-configure.patch
@@ -14,29 +14,16 @@ Acked-by: Martin Jansa <Martin.Jansa@gmail.com>
14Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> 14Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
15Signed-off-by: Saul Wold <sgw@linux.intel.com> 15Signed-off-by: Saul Wold <sgw@linux.intel.com>
16 16
17diff -pruN Python-2.6.4.orig//Modules/_ctypes/libffi/configure.ac Python-2.6.4/Modules/_ctypes/libffi/configure.ac 17
18--- Python-2.6.4.orig//Modules/_ctypes/libffi/configure.ac 2009-04-28 22:01:18.000000000 +0200 182011/09/29
19+++ Python-2.6.4/Modules/_ctypes/libffi/configure.ac 2010-04-20 22:46:02.000000000 +0200 19Rebased for python 2.7.2
20@@ -23,6 +23,7 @@ AM_INIT_AUTOMAKE 20Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
21 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS]) 21
22 m4_define([_AC_ARG_VAR_PRECIOUS],[]) 22
23 AC_PROG_CC 23Index: Python-2.7.2/Modules/_ctypes/libffi/Makefile.am
24+m4_undefine([_AC_ARG_VAR_PRECIOUS]) 24===================================================================
25 m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) 25--- Python-2.7.2.orig/Modules/_ctypes/libffi/Makefile.am
26 26+++ Python-2.7.2/Modules/_ctypes/libffi/Makefile.am
27 AC_SUBST(CFLAGS)
28@@ -366,7 +367,7 @@ test -d src/$TARGETDIR || mkdir src/$TAR
29
30 AC_CONFIG_LINKS(include/ffitarget.h:src/$TARGETDIR/ffitarget.h)
31
32-AC_CONFIG_FILES(include/ffi.h)
33+AC_CONFIG_FILES(include/ffi.h include/Makefile Makefile)
34
35 AC_CONFIG_LINKS(include/ffi_common.h:include/ffi_common.h)
36
37diff -pruN Python-2.6.4.orig//Modules/_ctypes/libffi/Makefile.am Python-2.6.4/Modules/_ctypes/libffi/Makefile.am
38--- Python-2.6.4.orig//Modules/_ctypes/libffi/Makefile.am 2008-03-04 21:09:11.000000000 +0100
39+++ Python-2.6.4/Modules/_ctypes/libffi/Makefile.am 2010-04-20 22:54:03.000000000 +0200
40@@ -2,7 +2,7 @@ 27@@ -2,7 +2,7 @@
41 28
42 AUTOMAKE_OPTIONS = foreign subdir-objects 29 AUTOMAKE_OPTIONS = foreign subdir-objects
@@ -45,14 +32,13 @@ diff -pruN Python-2.6.4.orig//Modules/_ctypes/libffi/Makefile.am Python-2.6.4/Mo
45+SUBDIRS = include 32+SUBDIRS = include
46 33
47 EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \ 34 EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \
48 src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \ 35 src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \
49@@ -32,8 +32,6 @@ EXTRA_DIST = LICENSE ChangeLog.v1 Change 36@@ -34,8 +34,6 @@ EXTRA_DIST = LICENSE ChangeLog.v1 Change
50 src/frv/ffi.c src/frv/eabi.S src/frv/ffitarget.h src/dlmalloc.c \ 37 libtool-version ChangeLog.libffi m4/libtool.m4 \
51 libtool-version ChangeLog.libffi 38 m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4
52 39
53-info_TEXINFOS = doc/libffi.texi 40-info_TEXINFOS = doc/libffi.texi
54- 41-
55 ## ################################################################ 42 ## ################################################################
56 43
57 ## 44 ##
58
diff --git a/meta/recipes-devtools/python/python/multilib.patch b/meta/recipes-devtools/python/python/multilib.patch
index 33a334189e..babff1280e 100644
--- a/meta/recipes-devtools/python/python/multilib.patch
+++ b/meta/recipes-devtools/python/python/multilib.patch
@@ -10,10 +10,14 @@ Date: Tue Jun 28 21:21:29 2011 +0800
10 10
11 Picked-by: Yu Ke <ke.yu@intel.com> 11 Picked-by: Yu Ke <ke.yu@intel.com>
12 12
13Index: Python-2.6.6/Include/pythonrun.h 132011/09/29
14Rebased for python 2.7.2
15Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
16
17Index: Python-2.7.2/Include/pythonrun.h
14=================================================================== 18===================================================================
15--- Python-2.6.6.orig/Include/pythonrun.h 19--- Python-2.7.2.orig/Include/pythonrun.h
16+++ Python-2.6.6/Include/pythonrun.h 20+++ Python-2.7.2/Include/pythonrun.h
17@@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void); 21@@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void);
18 /* In their own files */ 22 /* In their own files */
19 PyAPI_FUNC(const char *) Py_GetVersion(void); 23 PyAPI_FUNC(const char *) Py_GetVersion(void);
@@ -22,10 +26,10 @@ Index: Python-2.6.6/Include/pythonrun.h
22 PyAPI_FUNC(const char *) Py_GetCopyright(void); 26 PyAPI_FUNC(const char *) Py_GetCopyright(void);
23 PyAPI_FUNC(const char *) Py_GetCompiler(void); 27 PyAPI_FUNC(const char *) Py_GetCompiler(void);
24 PyAPI_FUNC(const char *) Py_GetBuildInfo(void); 28 PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
25Index: Python-2.6.6/Lib/distutils/command/install.py 29Index: Python-2.7.2/Lib/distutils/command/install.py
26=================================================================== 30===================================================================
27--- Python-2.6.6.orig/Lib/distutils/command/install.py 31--- Python-2.7.2.orig/Lib/distutils/command/install.py
28+++ Python-2.6.6/Lib/distutils/command/install.py 32+++ Python-2.7.2/Lib/distutils/command/install.py
29@@ -22,6 +22,8 @@ from site import USER_BASE 33@@ -22,6 +22,8 @@ from site import USER_BASE
30 from site import USER_SITE 34 from site import USER_SITE
31 35
@@ -44,11 +48,11 @@ Index: Python-2.6.6/Lib/distutils/command/install.py
44 'headers': '$base/include/python$py_version_short/$dist_name', 48 'headers': '$base/include/python$py_version_short/$dist_name',
45 'scripts': '$base/bin', 49 'scripts': '$base/bin',
46 'data' : '$base', 50 'data' : '$base',
47Index: Python-2.6.6/Lib/distutils/sysconfig.py 51Index: Python-2.7.2/Lib/distutils/sysconfig.py
48=================================================================== 52===================================================================
49--- Python-2.6.6.orig/Lib/distutils/sysconfig.py 53--- Python-2.7.2.orig/Lib/distutils/sysconfig.py
50+++ Python-2.6.6/Lib/distutils/sysconfig.py 54+++ Python-2.7.2/Lib/distutils/sysconfig.py
51@@ -119,8 +119,11 @@ def get_python_lib(plat_specific=0, stan 55@@ -114,8 +114,11 @@ def get_python_lib(plat_specific=0, stan
52 prefix = plat_specific and EXEC_PREFIX or PREFIX 56 prefix = plat_specific and EXEC_PREFIX or PREFIX
53 57
54 if os.name == "posix": 58 if os.name == "posix":
@@ -62,11 +66,11 @@ Index: Python-2.6.6/Lib/distutils/sysconfig.py
62 if standard_lib: 66 if standard_lib:
63 return libpython 67 return libpython
64 else: 68 else:
65Index: Python-2.6.6/Lib/pydoc.py 69Index: Python-2.7.2/Lib/pydoc.py
66=================================================================== 70===================================================================
67--- Python-2.6.6.orig/Lib/pydoc.py 71--- Python-2.7.2.orig/Lib/pydoc.py
68+++ Python-2.6.6/Lib/pydoc.py 72+++ Python-2.7.2/Lib/pydoc.py
69@@ -349,7 +349,7 @@ class Doc: 73@@ -352,7 +352,7 @@ class Doc:
70 74
71 docloc = os.environ.get("PYTHONDOCS", 75 docloc = os.environ.get("PYTHONDOCS",
72 "http://docs.python.org/library") 76 "http://docs.python.org/library")
@@ -75,40 +79,40 @@ Index: Python-2.6.6/Lib/pydoc.py
75 "python"+sys.version[0:3]) 79 "python"+sys.version[0:3])
76 if (isinstance(object, type(os)) and 80 if (isinstance(object, type(os)) and
77 (object.__name__ in ('errno', 'exceptions', 'gc', 'imp', 81 (object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
78Index: Python-2.6.6/Lib/site.py 82Index: Python-2.7.2/Lib/site.py
79=================================================================== 83===================================================================
80--- Python-2.6.6.orig/Lib/site.py 84--- Python-2.7.2.orig/Lib/site.py
81+++ Python-2.6.6/Lib/site.py 85+++ Python-2.7.2/Lib/site.py
82@@ -265,13 +265,19 @@ def addsitepackages(known_paths): 86@@ -300,13 +300,19 @@ def getsitepackages():
83 if sys.platform in ('os2emx', 'riscos'): 87 if sys.platform in ('os2emx', 'riscos'):
84 sitedirs.append(os.path.join(prefix, "Lib", "site-packages")) 88 sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
85 elif os.sep == '/': 89 elif os.sep == '/':
86- sitedirs.append(os.path.join(prefix, "lib", 90- sitepackages.append(os.path.join(prefix, "lib",
87+ sitedirs.append(os.path.join(prefix, sys.lib, 91+ sitepackages.append(os.path.join(prefix, sys.lib,
88 "python" + sys.version[:3], 92 "python" + sys.version[:3],
89 "site-packages")) 93 "site-packages"))
90- sitedirs.append(os.path.join(prefix, "lib", "site-python")) 94- sitepackages.append(os.path.join(prefix, "lib", "site-python"))
91+ if sys.lib != "lib": 95+ if sys.lib != "lib":
92+ sitedirs.append(os.path.join(prefix, "lib", 96+ sitepackages.append(os.path.join(prefix, "lib",
93+ "python" + sys.version[:3], 97+ "python" + sys.version[:3],
94+ "site-packages")) 98+ "site-packages"))
95+ sitedirs.append(os.path.join(prefix, sys.lib, "site-python")) 99+ sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
96+ if sys.lib != "lib": 100+ if sys.lib != "lib":
97+ sitedirs.append(os.path.join(prefix, "lib", "site-python")) 101+ sitepackages.append(os.path.join(prefix, "lib", "site-python"))
98 else: 102 else:
99 sitedirs.append(prefix) 103 sitepackages.append(prefix)
100- sitedirs.append(os.path.join(prefix, "lib", "site-packages")) 104- sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
101+ sitedirs.append(os.path.join(prefix, sys.lib, "site-packages")) 105+ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
102
103 if sys.platform == "darwin": 106 if sys.platform == "darwin":
104 # for framework builds *only* we add the standard Apple 107 # for framework builds *only* we add the standard Apple
105Index: Python-2.6.6/Lib/test/test_dl.py 108 # locations.
109Index: Python-2.7.2/Lib/test/test_dl.py
106=================================================================== 110===================================================================
107--- Python-2.6.6.orig/Lib/test/test_dl.py 111--- Python-2.7.2.orig/Lib/test/test_dl.py
108+++ Python-2.6.6/Lib/test/test_dl.py 112+++ Python-2.7.2/Lib/test/test_dl.py
109@@ -4,10 +4,11 @@ 113@@ -5,10 +5,11 @@
110 """ 114 import unittest
111 from test.test_support import verbose,TestSkipped, import_module 115 from test.test_support import verbose, import_module
112 dl = import_module('dl', deprecated=True) 116 dl = import_module('dl', deprecated=True)
113+import sys 117+import sys
114 118
@@ -120,11 +124,11 @@ Index: Python-2.6.6/Lib/test/test_dl.py
120 ('/usr/bin/cygwin1.dll', 'getpid'), 124 ('/usr/bin/cygwin1.dll', 'getpid'),
121 ('/usr/lib/libc.dylib', 'getpid'), 125 ('/usr/lib/libc.dylib', 'getpid'),
122 ] 126 ]
123Index: Python-2.6.6/Lib/trace.py 127Index: Python-2.7.2/Lib/trace.py
124=================================================================== 128===================================================================
125--- Python-2.6.6.orig/Lib/trace.py 129--- Python-2.7.2.orig/Lib/trace.py
126+++ Python-2.6.6/Lib/trace.py 130+++ Python-2.7.2/Lib/trace.py
127@@ -759,10 +759,10 @@ def main(argv=None): 131@@ -762,10 +762,10 @@ def main(argv=None):
128 # should I also call expanduser? (after all, could use $HOME) 132 # should I also call expanduser? (after all, could use $HOME)
129 133
130 s = s.replace("$prefix", 134 s = s.replace("$prefix",
@@ -137,11 +141,11 @@ Index: Python-2.6.6/Lib/trace.py
137 "python" + sys.version[:3])) 141 "python" + sys.version[:3]))
138 s = os.path.normpath(s) 142 s = os.path.normpath(s)
139 ignore_dirs.append(s) 143 ignore_dirs.append(s)
140Index: Python-2.6.6/Makefile.pre.in 144Index: Python-2.7.2/Makefile.pre.in
141=================================================================== 145===================================================================
142--- Python-2.6.6.orig/Makefile.pre.in 146--- Python-2.7.2.orig/Makefile.pre.in
143+++ Python-2.6.6/Makefile.pre.in 147+++ Python-2.7.2/Makefile.pre.in
144@@ -75,6 +75,7 @@ PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAG 148@@ -81,6 +81,7 @@ PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAG
145 149
146 # Machine-dependent subdirectories 150 # Machine-dependent subdirectories
147 MACHDEP= @MACHDEP@ 151 MACHDEP= @MACHDEP@
@@ -149,7 +153,7 @@ Index: Python-2.6.6/Makefile.pre.in
149 153
150 # Install prefix for architecture-independent files 154 # Install prefix for architecture-independent files
151 prefix= @prefix@ 155 prefix= @prefix@
152@@ -91,7 +92,7 @@ LIBDIR= @libdir@ 156@@ -97,7 +98,7 @@ LIBDIR= @libdir@
153 MANDIR= @mandir@ 157 MANDIR= @mandir@
154 INCLUDEDIR= @includedir@ 158 INCLUDEDIR= @includedir@
155 CONFINCLUDEDIR= $(exec_prefix)/include 159 CONFINCLUDEDIR= $(exec_prefix)/include
@@ -158,7 +162,7 @@ Index: Python-2.6.6/Makefile.pre.in
158 162
159 # Detailed destination directories 163 # Detailed destination directories
160 BINLIBDEST= $(LIBDIR)/python$(VERSION) 164 BINLIBDEST= $(LIBDIR)/python$(VERSION)
161@@ -509,6 +510,7 @@ Modules/getpath.o: $(srcdir)/Modules/get 165@@ -533,6 +534,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
162 -DEXEC_PREFIX='"$(exec_prefix)"' \ 166 -DEXEC_PREFIX='"$(exec_prefix)"' \
163 -DVERSION='"$(VERSION)"' \ 167 -DVERSION='"$(VERSION)"' \
164 -DVPATH='"$(VPATH)"' \ 168 -DVPATH='"$(VPATH)"' \
@@ -166,8 +170,8 @@ Index: Python-2.6.6/Makefile.pre.in
166 -o $@ $(srcdir)/Modules/getpath.c 170 -o $@ $(srcdir)/Modules/getpath.c
167 171
168 Modules/python.o: $(srcdir)/Modules/python.c 172 Modules/python.o: $(srcdir)/Modules/python.c
169@@ -540,7 +542,7 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES) 173@@ -567,7 +569,7 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
170 Python/compile.o Python/symtable.o: $(GRAMMAR_H) $(AST_H) 174 Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
171 175
172 Python/getplatform.o: $(srcdir)/Python/getplatform.c 176 Python/getplatform.o: $(srcdir)/Python/getplatform.c
173- $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c 177- $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
@@ -175,10 +179,10 @@ Index: Python-2.6.6/Makefile.pre.in
175 179
176 Python/importdl.o: $(srcdir)/Python/importdl.c 180 Python/importdl.o: $(srcdir)/Python/importdl.c
177 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c 181 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
178Index: Python-2.6.6/Modules/getpath.c 182Index: Python-2.7.2/Modules/getpath.c
179=================================================================== 183===================================================================
180--- Python-2.6.6.orig/Modules/getpath.c 184--- Python-2.7.2.orig/Modules/getpath.c
181+++ Python-2.6.6/Modules/getpath.c 185+++ Python-2.7.2/Modules/getpath.c
182@@ -116,9 +116,11 @@ 186@@ -116,9 +116,11 @@
183 #define EXEC_PREFIX PREFIX 187 #define EXEC_PREFIX PREFIX
184 #endif 188 #endif
@@ -202,10 +206,10 @@ Index: Python-2.6.6/Modules/getpath.c
202 206
203 static void 207 static void
204 reduce(char *dir) 208 reduce(char *dir)
205Index: Python-2.6.6/Python/getplatform.c 209Index: Python-2.7.2/Python/getplatform.c
206=================================================================== 210===================================================================
207--- Python-2.6.6.orig/Python/getplatform.c 211--- Python-2.7.2.orig/Python/getplatform.c
208+++ Python-2.6.6/Python/getplatform.c 212+++ Python-2.7.2/Python/getplatform.c
209@@ -10,3 +10,13 @@ Py_GetPlatform(void) 213@@ -10,3 +10,13 @@ Py_GetPlatform(void)
210 { 214 {
211 return PLATFORM; 215 return PLATFORM;
@@ -220,11 +224,11 @@ Index: Python-2.6.6/Python/getplatform.c
220+{ 224+{
221+ return LIB; 225+ return LIB;
222+} 226+}
223Index: Python-2.6.6/Python/sysmodule.c 227Index: Python-2.7.2/Python/sysmodule.c
224=================================================================== 228===================================================================
225--- Python-2.6.6.orig/Python/sysmodule.c 229--- Python-2.7.2.orig/Python/sysmodule.c
226+++ Python-2.6.6/Python/sysmodule.c 230+++ Python-2.7.2/Python/sysmodule.c
227@@ -1379,6 +1379,8 @@ _PySys_Init(void) 231@@ -1416,6 +1416,8 @@ _PySys_Init(void)
228 PyString_FromString(Py_GetCopyright())); 232 PyString_FromString(Py_GetCopyright()));
229 SET_SYS_FROM_STRING("platform", 233 SET_SYS_FROM_STRING("platform",
230 PyString_FromString(Py_GetPlatform())); 234 PyString_FromString(Py_GetPlatform()));
@@ -233,11 +237,11 @@ Index: Python-2.6.6/Python/sysmodule.c
233 SET_SYS_FROM_STRING("executable", 237 SET_SYS_FROM_STRING("executable",
234 PyString_FromString(Py_GetProgramFullPath())); 238 PyString_FromString(Py_GetProgramFullPath()));
235 SET_SYS_FROM_STRING("prefix", 239 SET_SYS_FROM_STRING("prefix",
236Index: Python-2.6.6/configure.in 240Index: Python-2.7.2/configure.in
237=================================================================== 241===================================================================
238--- Python-2.6.6.orig/configure.in 242--- Python-2.7.2.orig/configure.in
239+++ Python-2.6.6/configure.in 243+++ Python-2.7.2/configure.in
240@@ -613,6 +613,10 @@ SunOS*) 244@@ -629,6 +629,10 @@ SunOS*)
241 ;; 245 ;;
242 esac 246 esac
243 247
diff --git a/meta/recipes-devtools/python/python/security_issue_2254_fix.patch b/meta/recipes-devtools/python/python/security_issue_2254_fix.patch
deleted file mode 100644
index f0328585d5..0000000000
--- a/meta/recipes-devtools/python/python/security_issue_2254_fix.patch
+++ /dev/null
@@ -1,184 +0,0 @@
1Upstream-Status: Backport
2http://svn.python.org/view?view=revision&revision=71303
3
4Issue #2254: Fix CGIHTTPServer information disclosure. Relative paths are
5 now collapsed within the url properly before looking in cgi_directories.
6Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
72011/07/19
8
9Index: Python-2.6.6/Lib/CGIHTTPServer.py
10===================================================================
11--- Python-2.6.6.orig/Lib/CGIHTTPServer.py
12+++ Python-2.6.6/Lib/CGIHTTPServer.py
13@@ -70,27 +70,20 @@ class CGIHTTPRequestHandler(SimpleHTTPSe
14 return SimpleHTTPServer.SimpleHTTPRequestHandler.send_head(self)
15
16 def is_cgi(self):
17- """Test whether self.path corresponds to a CGI script,
18- and return a boolean.
19+ """Test whether self.path corresponds to a CGI script.
20
21- This function sets self.cgi_info to a tuple (dir, rest)
22- when it returns True, where dir is the directory part before
23- the CGI script name. Note that rest begins with a
24- slash if it is not empty.
25-
26- The default implementation tests whether the path
27- begins with one of the strings in the list
28- self.cgi_directories (and the next character is a '/'
29- or the end of the string).
30+ Returns True and updates the cgi_info attribute to the tuple
31+ (dir, rest) if self.path requires running a CGI script.
32+ Returns False otherwise.
33+
34+ The default implementation tests whether the normalized url
35+ path begins with one of the strings in self.cgi_directories
36+ (and the next character is a '/' or the end of the string).
37 """
38-
39- path = self.path
40-
41- for x in self.cgi_directories:
42- i = len(x)
43- if path[:i] == x and (not path[i:] or path[i] == '/'):
44- self.cgi_info = path[:i], path[i+1:]
45- return True
46+ splitpath = _url_collapse_path_split(self.path)
47+ if splitpath[0] in self.cgi_directories:
48+ self.cgi_info = splitpath
49+ return True
50 return False
51
52 cgi_directories = ['/cgi-bin', '/htbin']
53@@ -299,6 +292,46 @@ class CGIHTTPRequestHandler(SimpleHTTPSe
54 self.log_message("CGI script exited OK")
55
56
57+# TODO(gregory.p.smith): Move this into an appropriate library.
58+def _url_collapse_path_split(path):
59+ """
60+ Given a URL path, remove extra '/'s and '.' path elements and collapse
61+ any '..' references.
62+
63+ Implements something akin to RFC-2396 5.2 step 6 to parse relative paths.
64+
65+ Returns: A tuple of (head, tail) where tail is everything after the final /
66+ and head is everything before it. Head will always start with a '/' and,
67+ if it contains anything else, never have a trailing '/'.
68+
69+ Raises: IndexError if too many '..' occur within the path.
70+ """
71+ # Similar to os.path.split(os.path.normpath(path)) but specific to URL
72+ # path semantics rather than local operating system semantics.
73+ path_parts = []
74+ for part in path.split('/'):
75+ if part == '.':
76+ path_parts.append('')
77+ else:
78+ path_parts.append(part)
79+ # Filter out blank non trailing parts before consuming the '..'.
80+ path_parts = [part for part in path_parts[:-1] if part] + path_parts[-1:]
81+ if path_parts:
82+ tail_part = path_parts.pop()
83+ else:
84+ tail_part = ''
85+ head_parts = []
86+ for part in path_parts:
87+ if part == '..':
88+ head_parts.pop()
89+ else:
90+ head_parts.append(part)
91+ if tail_part and tail_part == '..':
92+ head_parts.pop()
93+ tail_part = ''
94+ return ('/' + '/'.join(head_parts), tail_part)
95+
96+
97 nobody = None
98
99 def nobody_uid():
100Index: Python-2.6.6/Lib/test/test_httpservers.py
101===================================================================
102--- Python-2.6.6.orig/Lib/test/test_httpservers.py
103+++ Python-2.6.6/Lib/test/test_httpservers.py
104@@ -7,6 +7,7 @@ Josip Dzolonga, and Michael Otteneder fo
105 from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
106 from SimpleHTTPServer import SimpleHTTPRequestHandler
107 from CGIHTTPServer import CGIHTTPRequestHandler
108+import CGIHTTPServer
109
110 import os
111 import sys
112@@ -324,6 +325,45 @@ class CGIHTTPServerTestCase(BaseTestCase
113 finally:
114 BaseTestCase.tearDown(self)
115
116+ def test_url_collapse_path_split(self):
117+ test_vectors = {
118+ '': ('/', ''),
119+ '..': IndexError,
120+ '/.//..': IndexError,
121+ '/': ('/', ''),
122+ '//': ('/', ''),
123+ '/\\': ('/', '\\'),
124+ '/.//': ('/', ''),
125+ 'cgi-bin/file1.py': ('/cgi-bin', 'file1.py'),
126+ '/cgi-bin/file1.py': ('/cgi-bin', 'file1.py'),
127+ 'a': ('/', 'a'),
128+ '/a': ('/', 'a'),
129+ '//a': ('/', 'a'),
130+ './a': ('/', 'a'),
131+ './C:/': ('/C:', ''),
132+ '/a/b': ('/a', 'b'),
133+ '/a/b/': ('/a/b', ''),
134+ '/a/b/c/..': ('/a/b', ''),
135+ '/a/b/c/../d': ('/a/b', 'd'),
136+ '/a/b/c/../d/e/../f': ('/a/b/d', 'f'),
137+ '/a/b/c/../d/e/../../f': ('/a/b', 'f'),
138+ '/a/b/c/../d/e/.././././..//f': ('/a/b', 'f'),
139+ '../a/b/c/../d/e/.././././..//f': IndexError,
140+ '/a/b/c/../d/e/../../../f': ('/a', 'f'),
141+ '/a/b/c/../d/e/../../../../f': ('/', 'f'),
142+ '/a/b/c/../d/e/../../../../../f': IndexError,
143+ '/a/b/c/../d/e/../../../../f/..': ('/', ''),
144+ }
145+ for path, expected in test_vectors.iteritems():
146+ if isinstance(expected, type) and issubclass(expected, Exception):
147+ self.assertRaises(expected,
148+ CGIHTTPServer._url_collapse_path_split, path)
149+ else:
150+ actual = CGIHTTPServer._url_collapse_path_split(path)
151+ self.assertEquals(expected, actual,
152+ msg='path = %r\nGot: %r\nWanted: %r' % (
153+ path, actual, expected))
154+
155 def test_headers_and_content(self):
156 res = self.request('/cgi-bin/file1.py')
157 self.assertEquals(('Hello World\n', 'text/html', 200), \
158@@ -348,6 +388,12 @@ class CGIHTTPServerTestCase(BaseTestCase
159 self.assertEquals(('Hello World\n', 'text/html', 200), \
160 (res.read(), res.getheader('Content-type'), res.status))
161
162+ def test_no_leading_slash(self):
163+ # http://bugs.python.org/issue2254
164+ res = self.request('cgi-bin/file1.py')
165+ self.assertEquals(('Hello World\n', 'text/html', 200),
166+ (res.read(), res.getheader('Content-type'), res.status))
167+
168
169 def test_main(verbose=None):
170 cwd = os.getcwd()
171Index: Python-2.6.6/Misc/NEWS
172===================================================================
173--- Python-2.6.6.orig/Misc/NEWS
174+++ Python-2.6.6/Misc/NEWS
175@@ -137,6 +137,9 @@ C-API
176 Library
177 -------
178
179+- Issue #2254: Fix CGIHTTPServer information disclosure. Relative paths are
180+ now collapsed within the url properly before looking in cgi_directories.
181+
182 - Issue #8447: Make distutils.sysconfig follow symlinks in the path to
183 the interpreter executable. This fixes a failure of test_httpservers
184 on OS X.
diff --git a/meta/recipes-devtools/python/python_2.6.6.bb b/meta/recipes-devtools/python/python_2.7.2.bb
index 77c0ff47b3..af14adbbb3 100644
--- a/meta/recipes-devtools/python/python_2.6.6.bb
+++ b/meta/recipes-devtools/python/python_2.7.2.bb
@@ -1,15 +1,12 @@
1require python.inc 1require python.inc
2DEPENDS = "python-native db gdbm openssl readline sqlite3 zlib" 2DEPENDS = "python-native db gdbm openssl readline sqlite3 zlib"
3DEPENDS_sharprom = "python-native db readline zlib gdbm openssl" 3DEPENDS_sharprom = "python-native db readline zlib gdbm openssl"
4PR = "${INC_PR}.11" 4PR = "${INC_PR}.0"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=38fdd546420fab09ac6bd3d8a1c83eb6"
6 5
7DISTRO_SRC_URI ?= "file://sitecustomize.py" 6DISTRO_SRC_URI ?= "file://sitecustomize.py"
8DISTRO_SRC_URI_linuxstdbase = "" 7DISTRO_SRC_URI_linuxstdbase = ""
9SRC_URI = "\ 8SRC_URI += "\
10 http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \
11 file://01-use-proper-tools-for-cross-build.patch \ 9 file://01-use-proper-tools-for-cross-build.patch \
12 file://02-remove-test-for-cross.patch \
13 file://03-fix-tkinter-detection.patch \ 10 file://03-fix-tkinter-detection.patch \
14 file://04-default-is-optimized.patch \ 11 file://04-default-is-optimized.patch \
15 file://05-enable-ctypes-cross-build.patch \ 12 file://05-enable-ctypes-cross-build.patch \
@@ -19,13 +16,10 @@ SRC_URI = "\
19 file://99-ignore-optimization-flag.patch \ 16 file://99-ignore-optimization-flag.patch \
20 ${DISTRO_SRC_URI} \ 17 ${DISTRO_SRC_URI} \
21 file://multilib.patch \ 18 file://multilib.patch \
22 file://security_issue_2254_fix.patch \
23 file://cgi_py.patch \ 19 file://cgi_py.patch \
24 file://remove_sqlite_rpath.patch \ 20 file://remove_sqlite_rpath.patch \
25" 21"
26 22
27SRC_URI[md5sum] = "cf4e6881bb84a7ce6089e4a307f71f14"
28SRC_URI[sha256sum] = "134c5e0736bae2e5570d0b915693374f11108ded63c35a23a35d282737d2ce83"
29S = "${WORKDIR}/Python-${PV}" 23S = "${WORKDIR}/Python-${PV}"
30 24
31inherit autotools 25inherit autotools
diff --git a/meta/site/common-linux b/meta/site/common-linux
index 947ed5b7d3..f441abb73a 100644
--- a/meta/site/common-linux
+++ b/meta/site/common-linux
@@ -43,3 +43,6 @@ ac_cv_conv_longlong_to_float=${ac_cv_conv_longlong_to_float=yes}
43 43
44# TCL 44# TCL
45tcl_cv_api_serial=${tcl_cv_api_serial=termios} 45tcl_cv_api_serial=${tcl_cv_api_serial=termios}
46
47# python
48ac_cv_have_long_long_format=yes