1 diff -purN Python-2.6.4.orig/Lib/cgi.py Python-2.6.4/Lib/cgi.py
2 --- Python-2.6.4.orig/Lib/cgi.py 2010-01-27 09:00:02.000000000 +0100
3 +++ Python-2.6.4/Lib/cgi.py 2010-01-27 09:02:58.000000000 +0100
5 -#! /usr/local/bin/python
8 # NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
9 # intentionally NOT "/usr/bin/env python". On many systems
10 diff -purN Python-2.6.4.orig/Makefile.pre.in Python-2.6.4/Makefile.pre.in
11 --- Python-2.6.4.orig/Makefile.pre.in 2010-01-27 09:00:02.000000000 +0100
12 +++ Python-2.6.4/Makefile.pre.in 2010-01-27 09:00:24.000000000 +0100
13 @@ -175,6 +175,7 @@ UNICODE_OBJS= @UNICODE_OBJS@
16 BUILDPYTHON= python$(BUILDEXE)
17 +HOSTPYTHON= ./$(BUILDPYTHON)
19 # The task to run while instrument when building the profile-opt target
20 PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
21 @@ -206,6 +207,8 @@ GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
23 PGEN= Parser/pgen$(EXE)
30 @@ -394,8 +397,8 @@ platform: $(BUILDPYTHON)
31 # Build the shared modules
32 sharedmods: $(BUILDPYTHON)
33 @case $$MAKEFLAGS in \
34 - *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
35 - *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
36 + *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
37 + *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
40 # Build static library
41 @@ -517,7 +520,7 @@ Modules/python.o: $(srcdir)/Modules/pyth
43 $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
44 -@$(INSTALL) -d Include
45 - -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
46 + -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
49 $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
50 @@ -886,24 +889,24 @@ libinstall: build_all $(srcdir)/Lib/$(PL
53 $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
54 - PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
55 - ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
56 + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
57 + $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
59 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
60 - PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
61 - ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
62 + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
63 + $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
65 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
66 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
67 - ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
68 + $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
69 -d $(LIBDEST)/site-packages -f \
70 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
71 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
72 - ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
73 + $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
74 -d $(LIBDEST)/site-packages -f \
75 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
76 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
77 - ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
78 + $(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
80 # Create the PLATDIR source directory, if one wasn't distributed..
81 $(srcdir)/Lib/$(PLATDIR):
82 @@ -1001,8 +1004,9 @@ libainstall: all
83 # Install the dynamically loadable modules
84 # This goes into $(exec_prefix)
86 - $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
87 - --prefix=$(prefix) \
88 + CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' CROSS_COMPILE='$(CROSS_COMPILE)' \
89 + $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
90 + --prefix=$(prefix) \
91 --install-scripts=$(BINDIR) \
92 --install-platlib=$(DESTSHARED) \
94 diff -purN Python-2.6.4.orig/Modules/Setup.dist Python-2.6.4/Modules/Setup.dist
95 --- Python-2.6.4.orig/Modules/Setup.dist 2010-01-27 09:00:02.000000000 +0100
96 +++ Python-2.6.4/Modules/Setup.dist 2010-01-27 10:30:15.000000000 +0100
97 @@ -152,7 +152,7 @@ GLHACK=-Dclear=__GLclear
98 # modules are to be built as shared libraries (see above for more
99 # detail; also note that *static* reverses this effect):
104 # GNU readline. Unlike previous Python incarnations, GNU readline is
105 # now incorporated in an optional module, configured in the Setup file
106 @@ -162,16 +162,16 @@ GLHACK=-Dclear=__GLclear
107 # it, depending on your system -- see the GNU readline instructions.
108 # It's okay for this to be a shared library, too.
110 -#readline readline.c -lreadline -ltermcap
111 +readline readline.c -lreadline #-ltermcap
114 # Modules that should always be present (non UNIX dependent):
116 #array arraymodule.c # array objects
117 #cmath cmathmodule.c # -lm # complex math library functions
118 -#math mathmodule.c # -lm # math library functions, e.g. sin()
119 +math mathmodule.c # -lm # math library functions, e.g. sin()
120 #_struct _struct.c # binary structure packing/unpacking
121 -#time timemodule.c # -lm # time operations and variables
122 +time timemodule.c # -lm # time operations and variables
123 #operator operator.c # operator.add() and similar goodies
124 #_weakref _weakref.c # basic weak reference support
125 #_testcapi _testcapimodule.c # Python C API test module
126 @@ -182,7 +182,7 @@ GLHACK=-Dclear=__GLclear
127 #_functools _functoolsmodule.c # Tools for working with functions and callable objects
128 #_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator
129 #_pickle _pickle.c # pickle accelerator
130 -#datetime datetimemodule.c # date/time type
131 +datetime datetimemodule.c # date/time type
132 #_bisect _bisectmodule.c # Bisection algorithms
134 #unicodedata unicodedata.c # static Unicode character database
135 @@ -198,7 +198,7 @@ GLHACK=-Dclear=__GLclear
136 #fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
137 #spwd spwdmodule.c # spwd(3)
138 #grp grpmodule.c # grp(3)
139 -#select selectmodule.c # select(2); not on ancient System V
140 +select selectmodule.c # select(2); not on ancient System V
142 # Memory-mapped files (also works on Win32).
144 @@ -207,7 +207,7 @@ GLHACK=-Dclear=__GLclear
147 # Socket module helper for socket(2)
148 -#_socket socketmodule.c
149 +_socket socketmodule.c
151 # Socket module helper for SSL support; you must comment out the other
152 # socket line above, and possibly edit the SSL variable:
153 @@ -302,7 +302,7 @@ GLHACK=-Dclear=__GLclear
154 # A Linux specific module -- off by default; this may also work on
157 -#linuxaudiodev linuxaudiodev.c
158 +linuxaudiodev linuxaudiodev.c
161 # George Neville-Neil's timing module:
162 @@ -390,7 +390,7 @@ GLHACK=-Dclear=__GLclear
164 # First, look at Setup.config; configure may have set this for you.
166 -#dbm dbmmodule.c # dbm(3) may require -lndbm or similar
167 +dbm dbmmodule.c -DHAVE_NDBM_H -lgdbm_compat -lgdbm # dbm(3) may require -lndbm or similar
169 # Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm:
171 diff -purN Python-2.6.4.orig/configure Python-2.6.4/configure
172 --- Python-2.6.4.orig/configure 2010-01-27 09:00:02.000000000 +0100
173 +++ Python-2.6.4/configure 2010-01-27 09:00:24.000000000 +0100
174 @@ -17190,151 +17190,17 @@ fi
179 -# On Tru64, chflags seems to be present, but calling it will
181 -{ echo "$as_me:$LINENO: checking for chflags" >&5
182 -echo $ECHO_N "checking for chflags... $ECHO_C" >&6; }
183 -if test "$cross_compiling" = yes; then
184 - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
185 -See \`config.log' for more details." >&5
186 -echo "$as_me: error: cannot run test program while cross compiling
187 -See \`config.log' for more details." >&2;}
188 - { (exit 1); exit 1; }; }
190 - cat >conftest.$ac_ext <<_ACEOF
193 -cat confdefs.h >>conftest.$ac_ext
194 -cat >>conftest.$ac_ext <<_ACEOF
195 -/* end confdefs.h. */
197 -#include <sys/stat.h>
199 -int main(int argc, char*argv[])
201 - if(chflags(argv[0], 0) != 0)
207 -rm -f conftest$ac_exeext
208 -if { (ac_try="$ac_link"
210 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
211 - *) ac_try_echo=$ac_try;;
213 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
214 - (eval "$ac_link") 2>&5
216 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
217 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
218 - { (case "(($ac_try" in
219 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
220 - *) ac_try_echo=$ac_try;;
222 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
223 - (eval "$ac_try") 2>&5
225 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
226 - (exit $ac_status); }; }; then
228 -cat >>confdefs.h <<\_ACEOF
229 -#define HAVE_CHFLAGS 1
232 - { echo "$as_me:$LINENO: result: yes" >&5
233 -echo "${ECHO_T}yes" >&6; }
235 - echo "$as_me: program exited with status $ac_status" >&5
236 -echo "$as_me: failed program was:" >&5
237 -sed 's/^/| /' conftest.$ac_ext >&5
240 -{ echo "$as_me:$LINENO: result: no" >&5
241 -echo "${ECHO_T}no" >&6; }
244 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
249 -{ echo "$as_me:$LINENO: checking for lchflags" >&5
250 -echo $ECHO_N "checking for lchflags... $ECHO_C" >&6; }
251 -if test "$cross_compiling" = yes; then
252 - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
253 -See \`config.log' for more details." >&5
254 -echo "$as_me: error: cannot run test program while cross compiling
255 -See \`config.log' for more details." >&2;}
256 - { (exit 1); exit 1; }; }
258 - cat >conftest.$ac_ext <<_ACEOF
261 -cat confdefs.h >>conftest.$ac_ext
262 -cat >>conftest.$ac_ext <<_ACEOF
263 -/* end confdefs.h. */
265 -#include <sys/stat.h>
267 -int main(int argc, char*argv[])
269 - if(lchflags(argv[0], 0) != 0)
275 -rm -f conftest$ac_exeext
276 -if { (ac_try="$ac_link"
278 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
279 - *) ac_try_echo=$ac_try;;
281 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
282 - (eval "$ac_link") 2>&5
284 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
285 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
286 - { (case "(($ac_try" in
287 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
288 - *) ac_try_echo=$ac_try;;
290 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
291 - (eval "$ac_try") 2>&5
293 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
294 - (exit $ac_status); }; }; then
296 -cat >>confdefs.h <<\_ACEOF
297 -#define HAVE_LCHFLAGS 1
300 - { echo "$as_me:$LINENO: result: yes" >&5
301 -echo "${ECHO_T}yes" >&6; }
303 - echo "$as_me: program exited with status $ac_status" >&5
304 -echo "$as_me: failed program was:" >&5
305 -sed 's/^/| /' conftest.$ac_ext >&5
308 -{ echo "$as_me:$LINENO: result: no" >&5
309 -echo "${ECHO_T}no" >&6; }
312 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
316 +#cat >>confdefs.h <<_ACEOF
317 +##define HAVE_CHFLAGS 0
318 +##define HAVE_LCHFLAGS 0
321 case $ac_sys_system/$ac_sys_release in
323 _CUR_CFLAGS="${CFLAGS}"
324 _CUR_LDFLAGS="${LDFLAGS}"
325 CFLAGS="${CFLAGS} -Wl,-search_paths_first"
326 - LDFLAGS="${LDFLAGS} -Wl,-search_paths_first -L/usr/local/lib"
327 + LDFLAGS="${LDFLAGS} -Wl,-search_paths_first -L/usr/lib"
331 @@ -24749,95 +24615,11 @@ else
332 echo "${ECHO_T}no" >&6; }
335 -{ echo "$as_me:$LINENO: checking for %zd printf() format support" >&5
336 -echo $ECHO_N "checking for %zd printf() format support... $ECHO_C" >&6; }
337 -if test "$cross_compiling" = yes; then
338 - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
339 -See \`config.log' for more details." >&5
340 -echo "$as_me: error: cannot run test program while cross compiling
341 -See \`config.log' for more details." >&2;}
342 - { (exit 1); exit 1; }; }
344 - cat >conftest.$ac_ext <<_ACEOF
347 -cat confdefs.h >>conftest.$ac_ext
348 -cat >>conftest.$ac_ext <<_ACEOF
349 -/* end confdefs.h. */
354 -#ifdef HAVE_SYS_TYPES_H
355 -#include <sys/types.h>
359 -typedef ssize_t Py_ssize_t;
360 -#elif SIZEOF_VOID_P == SIZEOF_LONG
361 -typedef long Py_ssize_t;
363 -typedef int Py_ssize_t;
370 - if(sprintf(buffer, "%zd", (size_t)123) < 0)
373 - if (strcmp(buffer, "123"))
376 - if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0)
379 - if (strcmp(buffer, "-123"))
385 -rm -f conftest$ac_exeext
386 -if { (ac_try="$ac_link"
388 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
389 - *) ac_try_echo=$ac_try;;
391 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
392 - (eval "$ac_link") 2>&5
394 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
395 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
396 - { (case "(($ac_try" in
397 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
398 - *) ac_try_echo=$ac_try;;
400 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
401 - (eval "$ac_try") 2>&5
403 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
404 - (exit $ac_status); }; }; then
405 - { echo "$as_me:$LINENO: result: yes" >&5
406 -echo "${ECHO_T}yes" >&6; }
408 cat >>confdefs.h <<\_ACEOF
409 #define PY_FORMAT_SIZE_T "z"
413 - echo "$as_me: program exited with status $ac_status" >&5
414 -echo "$as_me: failed program was:" >&5
415 -sed 's/^/| /' conftest.$ac_ext >&5
418 -{ echo "$as_me:$LINENO: result: no" >&5
419 -echo "${ECHO_T}no" >&6; }
421 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
426 { echo "$as_me:$LINENO: checking for socklen_t" >&5
427 diff -purN Python-2.6.4.orig/setup.py Python-2.6.4/setup.py
428 --- Python-2.6.4.orig/setup.py 2010-01-27 09:00:02.000000000 +0100
429 +++ Python-2.6.4/setup.py 2010-01-27 09:00:24.000000000 +0100
430 @@ -273,15 +273,15 @@ class PyBuildExt(build_ext):
432 imp.load_dynamic(ext.name, ext_filename)
433 except ImportError, why:
434 - self.failed.append(ext.name)
435 - self.announce('*** WARNING: renaming "%s" since importing it'
436 - ' failed: %s' % (ext.name, why), level=3)
437 - assert not self.inplace
438 - basename, tail = os.path.splitext(ext_filename)
439 - newname = basename + "_failed" + tail
440 - if os.path.exists(newname):
442 - os.rename(ext_filename, newname)
443 + #self.failed.append(ext.name)
446 + #assert not self.inplace
447 + #basename, tail = os.path.splitext(ext_filename)
448 + #newname = basename + "_failed" + tail
449 + #if os.path.exists(newname):
450 + # os.remove(newname)
451 + #os.rename(ext_filename, newname)
453 # XXX -- This relies on a Vile HACK in
454 # distutils.command.build_ext.build_extension(). The
455 @@ -289,11 +289,11 @@ class PyBuildExt(build_ext):
457 # If there is a failure, _built_objects may not be there,
458 # so catch the AttributeError and move on.
460 - for filename in self._built_objects:
461 - os.remove(filename)
462 - except AttributeError:
463 - self.announce('unable to remove files (ignored)')
465 + # for filename in self._built_objects:
466 + # os.remove(filename)
467 + #except AttributeError:
468 + # self.announce('unable to remove files (ignored)')
470 exc_type, why, tb = sys.exc_info()
471 self.announce('*** WARNING: importing extension "%s" '