import python2-2.7.17-1.el8
This commit is contained in:
commit
b5fe3c635f
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
SOURCES/Python-2.7.17-noexe.tar.xz
|
1
.python2.metadata
Normal file
1
.python2.metadata
Normal file
@ -0,0 +1 @@
|
||||
e63124a9a86b4b52c09384915a0842adf00b9d45 SOURCES/Python-2.7.17-noexe.tar.xz
|
28
SOURCES/00001-pydocnogui.patch
Normal file
28
SOURCES/00001-pydocnogui.patch
Normal file
@ -0,0 +1,28 @@
|
||||
diff -up Python-2.7.3/Lib/pydoc.py.no_gui Python-2.7.3/Lib/pydoc.py
|
||||
--- Python-2.7.3/Lib/pydoc.py.no_gui 2012-04-09 19:07:31.000000000 -0400
|
||||
+++ Python-2.7.3/Lib/pydoc.py 2013-02-19 13:48:44.480054515 -0500
|
||||
@@ -19,9 +19,6 @@ of all available modules.
|
||||
local machine to generate documentation web pages. Port number 0 can be
|
||||
used to get an arbitrary unused port.
|
||||
|
||||
-For platforms without a command line, "pydoc -g" starts the HTTP server
|
||||
-and also pops up a little window for controlling it.
|
||||
-
|
||||
Run "pydoc -w <name>" to write out the HTML documentation for a module
|
||||
to a file named "<name>.html".
|
||||
|
||||
@@ -2346,13 +2340,10 @@ def cli():
|
||||
Start an HTTP server on the given port on the local machine. Port
|
||||
number 0 can be used to get an arbitrary unused port.
|
||||
|
||||
-%s -g
|
||||
- Pop up a graphical interface for finding and serving documentation.
|
||||
-
|
||||
%s -w <name> ...
|
||||
Write out the HTML documentation for a module to a file in the current
|
||||
directory. If <name> contains a '%s', it is treated as a filename; if
|
||||
it names a directory, documentation is written for all the contents.
|
||||
-""" % (cmd, os.sep, cmd, cmd, cmd, cmd, os.sep)
|
||||
+""" % (cmd, os.sep, cmd, cmd, cmd, os.sep)
|
||||
|
||||
if __name__ == '__main__': cli()
|
21
SOURCES/00010-2.7.13-binutils-no-dep.patch
Normal file
21
SOURCES/00010-2.7.13-binutils-no-dep.patch
Normal file
@ -0,0 +1,21 @@
|
||||
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
|
||||
index ab10ec5..923d1b7 100644
|
||||
--- a/Lib/ctypes/util.py
|
||||
+++ b/Lib/ctypes/util.py
|
||||
@@ -140,11 +140,15 @@ elif os.name == "posix":
|
||||
# assuming GNU binutils / ELF
|
||||
if not f:
|
||||
return None
|
||||
- cmd = 'if ! type objdump >/dev/null 2>&1; then exit; fi;' \
|
||||
+ cmd = 'if ! type objdump >/dev/null 2>&1; then exit 10; fi;' \
|
||||
'objdump -p -j .dynamic 2>/dev/null "$1"'
|
||||
proc = subprocess.Popen((cmd, '_get_soname', f), shell=True,
|
||||
stdout=subprocess.PIPE)
|
||||
[dump, _] = proc.communicate()
|
||||
+ if proc.returncode == 10:
|
||||
+ return os.path.basename(f) # This is good for GLibc, I think,
|
||||
+ # and a dep on binutils is big (for
|
||||
+ # live CDs).
|
||||
res = re.search(br'\sSONAME\s+([^\s]+)', dump)
|
||||
if not res:
|
||||
return None
|
198
SOURCES/00055-systemtap.patch
Normal file
198
SOURCES/00055-systemtap.patch
Normal file
@ -0,0 +1,198 @@
|
||||
diff -up Python-2.7rc1/configure.ac.systemtap Python-2.7rc1/configure.ac
|
||||
--- Python-2.7rc1/configure.ac.systemtap 2010-06-06 10:53:15.514975012 -0400
|
||||
+++ Python-2.7rc1/configure.ac 2010-06-06 10:53:15.520974361 -0400
|
||||
@@ -2616,6 +2616,38 @@ if test "$with_valgrind" != no; then
|
||||
)
|
||||
fi
|
||||
|
||||
+# Check for dtrace support
|
||||
+AC_MSG_CHECKING(for --with-dtrace)
|
||||
+AC_ARG_WITH(dtrace,
|
||||
+ AC_HELP_STRING(--with(out)-dtrace, disable/enable dtrace support))
|
||||
+
|
||||
+if test ! -z "$with_dtrace"
|
||||
+then
|
||||
+ if dtrace -G -o /dev/null -s $srcdir/Include/pydtrace.d 2>/dev/null
|
||||
+ then
|
||||
+ AC_DEFINE(WITH_DTRACE, 1,
|
||||
+ [Define if you want to compile in Dtrace support])
|
||||
+ with_dtrace="Sun"
|
||||
+ DTRACEOBJS="Python/dtrace.o"
|
||||
+ DTRADEHDRS=""
|
||||
+ elif dtrace -h -o /dev/null -s $srcdir/Include/pydtrace.d
|
||||
+ then
|
||||
+ AC_DEFINE(WITH_DTRACE, 1,
|
||||
+ [Define if you want to compile in Dtrace support])
|
||||
+ with_dtrace="Apple"
|
||||
+ DTRACEOBJS=""
|
||||
+ DTRADEHDRS="pydtrace.h"
|
||||
+ else
|
||||
+ with_dtrace="no"
|
||||
+ fi
|
||||
+else
|
||||
+ with_dtrace="no"
|
||||
+fi
|
||||
+
|
||||
+AC_MSG_RESULT($with_dtrace)
|
||||
+AC_SUBST(DTRACEOBJS)
|
||||
+AC_SUBST(DTRACEHDRS)
|
||||
+
|
||||
# Check for --with-wctype-functions
|
||||
AC_MSG_CHECKING(for --with-wctype-functions)
|
||||
AC_ARG_WITH(wctype-functions,
|
||||
diff -up Python-2.7rc1/Include/pydtrace.d.systemtap Python-2.7rc1/Include/pydtrace.d
|
||||
--- Python-2.7rc1/Include/pydtrace.d.systemtap 2010-06-06 10:53:15.520974361 -0400
|
||||
+++ Python-2.7rc1/Include/pydtrace.d 2010-06-06 10:53:15.520974361 -0400
|
||||
@@ -0,0 +1,10 @@
|
||||
+provider python {
|
||||
+ probe function__entry(const char *, const char *, int);
|
||||
+ probe function__return(const char *, const char *, int);
|
||||
+};
|
||||
+
|
||||
+#pragma D attributes Evolving/Evolving/Common provider python provider
|
||||
+#pragma D attributes Private/Private/Common provider python module
|
||||
+#pragma D attributes Private/Private/Common provider python function
|
||||
+#pragma D attributes Evolving/Evolving/Common provider python name
|
||||
+#pragma D attributes Evolving/Evolving/Common provider python args
|
||||
diff -up Python-2.7rc1/Makefile.pre.in.systemtap Python-2.7rc1/Makefile.pre.in
|
||||
--- Python-2.7rc1/Makefile.pre.in.systemtap 2010-06-06 10:53:15.488978775 -0400
|
||||
+++ Python-2.7rc1/Makefile.pre.in 2010-06-06 11:05:30.411100568 -0400
|
||||
@@ -298,6 +298,7 @@ PYTHON_OBJS= \
|
||||
Python/formatter_unicode.o \
|
||||
Python/formatter_string.o \
|
||||
Python/$(DYNLOADFILE) \
|
||||
+ @DTRACEOBJS@ \
|
||||
$(LIBOBJS) \
|
||||
$(MACHDEP_OBJS) \
|
||||
$(THREADOBJ)
|
||||
@@ -599,6 +600,18 @@ Python/formatter_unicode.o: $(srcdir)/Py
|
||||
Python/formatter_string.o: $(srcdir)/Python/formatter_string.c \
|
||||
$(STRINGLIB_HEADERS)
|
||||
|
||||
+# Only needed with --with-dtrace
|
||||
+buildinclude:
|
||||
+ mkdir -p Include
|
||||
+
|
||||
+Include/pydtrace.h: buildinclude $(srcdir)/Include/pydtrace.d
|
||||
+ dtrace -o $@ $(DFLAGS) -C -h -s $(srcdir)/Include/pydtrace.d
|
||||
+
|
||||
+Python/ceval.o: Include/pydtrace.h
|
||||
+
|
||||
+Python/dtrace.o: buildinclude $(srcdir)/Include/pydtrace.d Python/ceval.o
|
||||
+ dtrace -o $@ $(DFLAGS) -C -G -s $(srcdir)/Include/pydtrace.d Python/ceval.o
|
||||
+
|
||||
############################################################################
|
||||
# Header files
|
||||
|
||||
@@ -1251,7 +1264,7 @@ Python/thread.o: @THREADHEADERS@
|
||||
.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
|
||||
.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
|
||||
.PHONY: frameworkaltinstallunixtools recheck clean clobber distclean
|
||||
-.PHONY: smelly funny patchcheck altmaninstall commoninstall
|
||||
+.PHONY: smelly funny patchcheck altmaninstall commoninstall buildinclude
|
||||
.PHONY: gdbhooks
|
||||
|
||||
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
|
||||
diff -up Python-2.7rc1/pyconfig.h.in.systemtap Python-2.7rc1/pyconfig.h.in
|
||||
--- Python-2.7rc1/pyconfig.h.in.systemtap 2010-05-08 07:04:18.000000000 -0400
|
||||
+++ Python-2.7rc1/pyconfig.h.in 2010-06-06 10:53:15.521974070 -0400
|
||||
@@ -1074,6 +1074,9 @@
|
||||
/* Define if you want documentation strings in extension modules */
|
||||
#undef WITH_DOC_STRINGS
|
||||
|
||||
+/* Define if you want to compile in Dtrace support */
|
||||
+#undef WITH_DTRACE
|
||||
+
|
||||
/* Define if you want to use the new-style (Openstep, Rhapsody, MacOS) dynamic
|
||||
linker (dyld) instead of the old-style (NextStep) dynamic linker (rld).
|
||||
Dyld is necessary to support frameworks. */
|
||||
diff -up Python-2.7rc1/Python/ceval.c.systemtap Python-2.7rc1/Python/ceval.c
|
||||
--- Python-2.7rc1/Python/ceval.c.systemtap 2010-05-09 10:46:46.000000000 -0400
|
||||
+++ Python-2.7rc1/Python/ceval.c 2010-06-06 11:08:40.683100500 -0400
|
||||
@@ -19,6 +19,10 @@
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
+#ifdef WITH_DTRACE
|
||||
+#include "pydtrace.h"
|
||||
+#endif
|
||||
+
|
||||
#ifndef WITH_TSC
|
||||
|
||||
#define READ_TIMESTAMP(var)
|
||||
@@ -671,6 +675,55 @@ PyEval_EvalCode(PyCodeObject *co, PyObje
|
||||
NULL);
|
||||
}
|
||||
|
||||
+#ifdef WITH_DTRACE
|
||||
+static void
|
||||
+dtrace_entry(PyFrameObject *f)
|
||||
+{
|
||||
+ const char *filename;
|
||||
+ const char *fname;
|
||||
+ int lineno;
|
||||
+
|
||||
+ filename = PyString_AsString(f->f_code->co_filename);
|
||||
+ fname = PyString_AsString(f->f_code->co_name);
|
||||
+ lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
|
||||
+
|
||||
+ PYTHON_FUNCTION_ENTRY((char *)filename, (char *)fname, lineno);
|
||||
+
|
||||
+ /*
|
||||
+ * Currently a USDT tail-call will not receive the correct arguments.
|
||||
+ * Disable the tail call here.
|
||||
+ */
|
||||
+#if defined(__sparc)
|
||||
+ asm("nop");
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+dtrace_return(PyFrameObject *f)
|
||||
+{
|
||||
+ const char *filename;
|
||||
+ const char *fname;
|
||||
+ int lineno;
|
||||
+
|
||||
+ filename = PyString_AsString(f->f_code->co_filename);
|
||||
+ fname = PyString_AsString(f->f_code->co_name);
|
||||
+ lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
|
||||
+ PYTHON_FUNCTION_RETURN((char *)filename, (char *)fname, lineno);
|
||||
+
|
||||
+ /*
|
||||
+ * Currently a USDT tail-call will not receive the correct arguments.
|
||||
+ * Disable the tail call here.
|
||||
+ */
|
||||
+#if defined(__sparc)
|
||||
+ asm("nop");
|
||||
+#endif
|
||||
+}
|
||||
+#else
|
||||
+#define PYTHON_FUNCTION_ENTRY_ENABLED() 0
|
||||
+#define PYTHON_FUNCTION_RETURN_ENABLED() 0
|
||||
+#define dtrace_entry(f)
|
||||
+#define dtrace_return(f)
|
||||
+#endif
|
||||
|
||||
/* Interpreter main loop */
|
||||
|
||||
@@ -909,6 +962,9 @@ PyEval_EvalFrameEx(PyFrameObject *f, int
|
||||
}
|
||||
}
|
||||
|
||||
+ if (PYTHON_FUNCTION_ENTRY_ENABLED())
|
||||
+ dtrace_entry(f);
|
||||
+
|
||||
co = f->f_code;
|
||||
names = co->co_names;
|
||||
consts = co->co_consts;
|
||||
@@ -3000,6 +3056,9 @@ fast_yield:
|
||||
|
||||
/* pop frame */
|
||||
exit_eval_frame:
|
||||
+ if (PYTHON_FUNCTION_RETURN_ENABLED())
|
||||
+ dtrace_return(f);
|
||||
+
|
||||
Py_LeaveRecursiveCall();
|
||||
tstate->frame = f->f_back;
|
||||
|
193
SOURCES/00102-2.7.13-lib64.patch
Normal file
193
SOURCES/00102-2.7.13-lib64.patch
Normal file
@ -0,0 +1,193 @@
|
||||
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
|
||||
index b9f1c6c..7b23714 100644
|
||||
--- a/Lib/distutils/command/install.py
|
||||
+++ b/Lib/distutils/command/install.py
|
||||
@@ -42,14 +42,14 @@ else:
|
||||
INSTALL_SCHEMES = {
|
||||
'unix_prefix': {
|
||||
'purelib': '$base/lib/python$py_version_short/site-packages',
|
||||
- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
|
||||
+ 'platlib': '$platbase/lib64/python$py_version_short/site-packages',
|
||||
'headers': '$base/include/python$py_version_short/$dist_name',
|
||||
'scripts': '$base/bin',
|
||||
'data' : '$base',
|
||||
},
|
||||
'unix_home': {
|
||||
'purelib': '$base/lib/python',
|
||||
- 'platlib': '$base/lib/python',
|
||||
+ 'platlib': '$base/lib64/python',
|
||||
'headers': '$base/include/python/$dist_name',
|
||||
'scripts': '$base/bin',
|
||||
'data' : '$base',
|
||||
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
|
||||
index 031f809..ec5d584 100644
|
||||
--- a/Lib/distutils/sysconfig.py
|
||||
+++ b/Lib/distutils/sysconfig.py
|
||||
@@ -120,8 +120,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
|
||||
prefix = plat_specific and EXEC_PREFIX or PREFIX
|
||||
|
||||
if os.name == "posix":
|
||||
+ if plat_specific or standard_lib:
|
||||
+ lib = "lib64"
|
||||
+ else:
|
||||
+ lib = "lib"
|
||||
libpython = os.path.join(prefix,
|
||||
- "lib", "python" + get_python_version())
|
||||
+ lib, "python" + get_python_version())
|
||||
if standard_lib:
|
||||
return libpython
|
||||
else:
|
||||
diff --git a/Lib/site.py b/Lib/site.py
|
||||
index c360802..868b7cb 100644
|
||||
--- a/Lib/site.py
|
||||
+++ b/Lib/site.py
|
||||
@@ -288,12 +288,16 @@ def getsitepackages():
|
||||
if sys.platform in ('os2emx', 'riscos'):
|
||||
sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
|
||||
elif os.sep == '/':
|
||||
+ sitepackages.append(os.path.join(prefix, "lib64",
|
||||
+ "python" + sys.version[:3],
|
||||
+ "site-packages"))
|
||||
sitepackages.append(os.path.join(prefix, "lib",
|
||||
"python" + sys.version[:3],
|
||||
"site-packages"))
|
||||
sitepackages.append(os.path.join(prefix, "lib", "site-python"))
|
||||
else:
|
||||
sitepackages.append(prefix)
|
||||
+ sitepackages.append(os.path.join(prefix, "lib64", "site-packages"))
|
||||
sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
|
||||
return sitepackages
|
||||
|
||||
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
|
||||
index b4384ee..349f688 100644
|
||||
--- a/Lib/test/test_site.py
|
||||
+++ b/Lib/test/test_site.py
|
||||
@@ -254,17 +254,20 @@ class HelperFunctionsTests(unittest.TestCase):
|
||||
self.assertEqual(dirs[0], wanted)
|
||||
elif os.sep == '/':
|
||||
# OS X, Linux, FreeBSD, etc
|
||||
- self.assertEqual(len(dirs), 2)
|
||||
- wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
|
||||
+ self.assertEqual(len(dirs), 3)
|
||||
+ wanted = os.path.join('xoxo', 'lib64', 'python' + sys.version[:3],
|
||||
'site-packages')
|
||||
self.assertEqual(dirs[0], wanted)
|
||||
- wanted = os.path.join('xoxo', 'lib', 'site-python')
|
||||
+ wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
|
||||
+ 'site-packages')
|
||||
self.assertEqual(dirs[1], wanted)
|
||||
+ wanted = os.path.join('xoxo', 'lib', 'site-python')
|
||||
+ self.assertEqual(dirs[2], wanted)
|
||||
else:
|
||||
# other platforms
|
||||
self.assertEqual(len(dirs), 2)
|
||||
self.assertEqual(dirs[0], 'xoxo')
|
||||
- wanted = os.path.join('xoxo', 'lib', 'site-packages')
|
||||
+ wanted = os.path.join('xoxo', 'lib64', 'site-packages')
|
||||
self.assertEqual(dirs[1], wanted)
|
||||
|
||||
def test_no_home_directory(self):
|
||||
diff --git a/Makefile.pre.in b/Makefile.pre.in
|
||||
index 4f59dd3..877698c 100644
|
||||
--- a/Makefile.pre.in
|
||||
+++ b/Makefile.pre.in
|
||||
@@ -110,7 +110,7 @@ LIBDIR= @libdir@
|
||||
MANDIR= @mandir@
|
||||
INCLUDEDIR= @includedir@
|
||||
CONFINCLUDEDIR= $(exec_prefix)/include
|
||||
-SCRIPTDIR= $(prefix)/lib
|
||||
+SCRIPTDIR= $(prefix)/lib64
|
||||
|
||||
# Detailed destination directories
|
||||
BINLIBDEST= $(LIBDIR)/python$(VERSION)
|
||||
diff --git a/Modules/Setup.dist b/Modules/Setup.dist
|
||||
index 2cf35a9..c4c88cb 100644
|
||||
--- a/Modules/Setup.dist
|
||||
+++ b/Modules/Setup.dist
|
||||
@@ -231,7 +231,7 @@ crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
|
||||
# Some more UNIX dependent modules -- off by default, since these
|
||||
# are not supported by all UNIX systems:
|
||||
|
||||
-nis nismodule.c -lnsl -ltirpc -I/usr/include/tirpc -I/usr/include/nsl -L/usr/lib/nsl
|
||||
+nis nismodule.c -lnsl -ltirpc -I/usr/include/tirpc -I/usr/include/nsl -L/usr/lib64/nsl
|
||||
termios termios.c # Steen Lumholt's termios module
|
||||
resource resource.c # Jeremy Hylton's rlimit interface
|
||||
|
||||
@@ -416,7 +416,7 @@ gdbm gdbmmodule.c -lgdbm
|
||||
# Edit the variables DB and DBLIBVERto point to the db top directory
|
||||
# and the subdirectory of PORT where you built it.
|
||||
DBINC=/usr/include/libdb
|
||||
-DBLIB=/usr/lib
|
||||
+DBLIB=/usr/lib64
|
||||
_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb
|
||||
|
||||
# Historical Berkeley DB 1.85
|
||||
@@ -462,7 +462,7 @@ cPickle cPickle.c
|
||||
# Andrew Kuchling's zlib module.
|
||||
# This require zlib 1.1.3 (or later).
|
||||
# See http://www.gzip.org/zlib/
|
||||
-zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
|
||||
+zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib64 -lz
|
||||
|
||||
# Interface to the Expat XML parser
|
||||
# More information on Expat can be found at www.libexpat.org.
|
||||
diff --git a/Modules/getpath.c b/Modules/getpath.c
|
||||
index fd33a01..c5c86fd 100644
|
||||
--- a/Modules/getpath.c
|
||||
+++ b/Modules/getpath.c
|
||||
@@ -108,7 +108,7 @@ static char prefix[MAXPATHLEN+1];
|
||||
static char exec_prefix[MAXPATHLEN+1];
|
||||
static char progpath[MAXPATHLEN+1];
|
||||
static char *module_search_path = NULL;
|
||||
-static char lib_python[] = "lib/python" VERSION;
|
||||
+static char lib_python[] = "lib64/python" VERSION;
|
||||
|
||||
static void
|
||||
reduce(char *dir)
|
||||
@@ -548,7 +548,7 @@ calculate_path(void)
|
||||
fprintf(stderr,
|
||||
"Could not find platform dependent libraries <exec_prefix>\n");
|
||||
strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
|
||||
- joinpath(exec_prefix, "lib/lib-dynload");
|
||||
+ joinpath(exec_prefix, "lib64/lib-dynload");
|
||||
}
|
||||
/* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 0288a6b..7905f6f 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -456,7 +456,7 @@ class PyBuildExt(build_ext):
|
||||
def detect_modules(self):
|
||||
# Ensure that /usr/local is always used
|
||||
if not cross_compiling:
|
||||
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||
+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
|
||||
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||
if cross_compiling:
|
||||
self.add_gcc_paths()
|
||||
@@ -782,11 +782,11 @@ class PyBuildExt(build_ext):
|
||||
elif curses_library:
|
||||
readline_libs.append(curses_library)
|
||||
elif self.compiler.find_library_file(lib_dirs +
|
||||
- ['/usr/lib/termcap'],
|
||||
+ ['/usr/lib64/termcap'],
|
||||
'termcap'):
|
||||
readline_libs.append('termcap')
|
||||
exts.append( Extension('readline', ['readline.c'],
|
||||
- library_dirs=['/usr/lib/termcap'],
|
||||
+ library_dirs=['/usr/lib64/termcap'],
|
||||
extra_link_args=readline_extra_link_args,
|
||||
libraries=readline_libs) )
|
||||
else:
|
||||
@@ -821,8 +821,8 @@ class PyBuildExt(build_ext):
|
||||
if krb5_h:
|
||||
ssl_incs += krb5_h
|
||||
ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
|
||||
- ['/usr/local/ssl/lib',
|
||||
- '/usr/contrib/ssl/lib/'
|
||||
+ ['/usr/local/ssl/lib64',
|
||||
+ '/usr/contrib/ssl/lib64/'
|
||||
] )
|
||||
|
||||
if (ssl_incs is not None and
|
13
SOURCES/00104-lib64-fix-for-test_install.patch
Normal file
13
SOURCES/00104-lib64-fix-for-test_install.patch
Normal file
@ -0,0 +1,13 @@
|
||||
--- Python-2.7.2/Lib/distutils/tests/test_install.py.lib64 2011-09-08 17:51:57.851405376 -0400
|
||||
+++ Python-2.7.2/Lib/distutils/tests/test_install.py 2011-09-08 18:40:46.754205096 -0400
|
||||
@@ -41,8 +41,9 @@ class InstallTestCase(support.TempdirMan
|
||||
self.assertEqual(got, expected)
|
||||
|
||||
libdir = os.path.join(destination, "lib", "python")
|
||||
+ platlibdir = os.path.join(destination, "lib64", "python")
|
||||
check_path(cmd.install_lib, libdir)
|
||||
- check_path(cmd.install_platlib, libdir)
|
||||
+ check_path(cmd.install_platlib, platlibdir)
|
||||
check_path(cmd.install_purelib, libdir)
|
||||
check_path(cmd.install_headers,
|
||||
os.path.join(destination, "include", "python", "foopkg"))
|
50
SOURCES/00111-no-static-lib.patch
Normal file
50
SOURCES/00111-no-static-lib.patch
Normal file
@ -0,0 +1,50 @@
|
||||
diff -up Python-2.7.6/Makefile.pre.in.no-static-lib Python-2.7.6/Makefile.pre.in
|
||||
--- Python-2.7.6/Makefile.pre.in.no-static-lib 2014-01-29 13:58:32.933226720 +0100
|
||||
+++ Python-2.7.6/Makefile.pre.in 2014-01-29 14:10:25.002247272 +0100
|
||||
@@ -437,7 +437,7 @@ coverage:
|
||||
|
||||
|
||||
# Build the interpreter
|
||||
-$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
|
||||
+$(BUILDPYTHON): Modules/python.o $(LDLIBRARY)
|
||||
$(LINKCC) $(CFLAGS) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
|
||||
Modules/python.o \
|
||||
$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
|
||||
@@ -464,18 +464,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.tx
|
||||
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
|
||||
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
|
||||
|
||||
-# Build static library
|
||||
-# avoid long command lines, same as LIBRARY_OBJS
|
||||
-$(LIBRARY): $(LIBRARY_OBJS)
|
||||
- -rm -f $@
|
||||
- $(AR) $(ARFLAGS) $@ Modules/getbuildinfo.o
|
||||
- $(AR) $(ARFLAGS) $@ $(PARSER_OBJS)
|
||||
- $(AR) $(ARFLAGS) $@ $(OBJECT_OBJS)
|
||||
- $(AR) $(ARFLAGS) $@ $(PYTHON_OBJS)
|
||||
- $(AR) $(ARFLAGS) $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
|
||||
- $(AR) $(ARFLAGS) $@ $(MODOBJS)
|
||||
- $(RANLIB) $@
|
||||
-
|
||||
libpython$(VERSION).so: $(LIBRARY_OBJS)
|
||||
if test $(INSTSONAME) != $(LDLIBRARY); then \
|
||||
$(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
|
||||
@@ -1097,18 +1085,6 @@ libainstall: all python-config
|
||||
else true; \
|
||||
fi; \
|
||||
done
|
||||
- @if test -d $(LIBRARY); then :; else \
|
||||
- if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
|
||||
- if test "$(SO)" = .dll; then \
|
||||
- $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
|
||||
- else \
|
||||
- $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
|
||||
- $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
|
||||
- fi; \
|
||||
- else \
|
||||
- echo Skip install of $(LIBRARY) - use make frameworkinstall; \
|
||||
- fi; \
|
||||
- fi
|
||||
$(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
|
||||
$(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
|
||||
$(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
|
324
SOURCES/00112-2.7.13-debug-build.patch
Normal file
324
SOURCES/00112-2.7.13-debug-build.patch
Normal file
@ -0,0 +1,324 @@
|
||||
From 898f93aa206e577dfe854c59bc62d0cea09cd5ed Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Orsava <torsava@redhat.com>
|
||||
Date: Tue, 10 Jan 2017 16:19:50 +0100
|
||||
Subject: [PATCH] Patch to support building both optimized vs debug stacks DSO
|
||||
ABIs,
|
||||
|
||||
sharing the same .py and .pyc files, using "_d.so" to signify a debug build of
|
||||
an extension module.
|
||||
---
|
||||
Lib/distutils/command/build_ext.py | 7 ++++-
|
||||
Lib/distutils/sysconfig.py | 5 ++--
|
||||
Lib/distutils/tests/test_install.py | 3 +-
|
||||
Makefile.pre.in | 56 ++++++++++++++++++++-----------------
|
||||
Misc/python-config.in | 2 +-
|
||||
Modules/makesetup | 2 +-
|
||||
Python/dynload_shlib.c | 11 ++++++--
|
||||
Python/sysmodule.c | 6 ++++
|
||||
configure.ac | 14 ++++++++--
|
||||
9 files changed, 69 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py
|
||||
index 2c68be3..029d144 100644
|
||||
--- a/Lib/distutils/command/build_ext.py
|
||||
+++ b/Lib/distutils/command/build_ext.py
|
||||
@@ -677,7 +677,10 @@ class build_ext (Command):
|
||||
so_ext = get_config_var('SO')
|
||||
if os.name == 'nt' and self.debug:
|
||||
return os.path.join(*ext_path) + '_d' + so_ext
|
||||
- return os.path.join(*ext_path) + so_ext
|
||||
+
|
||||
+ # Similarly, extensions in debug mode are named 'module_d.so', to
|
||||
+ # avoid adding the _d to the SO config variable:
|
||||
+ return os.path.join(*ext_path) + (sys.pydebug and "_d" or "") + so_ext
|
||||
|
||||
def get_export_symbols (self, ext):
|
||||
"""Return the list of symbols that a shared extension has to
|
||||
@@ -762,6 +765,8 @@ class build_ext (Command):
|
||||
template = "python%d.%d"
|
||||
pythonlib = (template %
|
||||
(sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
|
||||
+ if sys.pydebug:
|
||||
+ pythonlib += '_d'
|
||||
return ext.libraries + [pythonlib]
|
||||
else:
|
||||
return ext.libraries
|
||||
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
|
||||
index 3e7f077..ec5d584 100644
|
||||
--- a/Lib/distutils/sysconfig.py
|
||||
+++ b/Lib/distutils/sysconfig.py
|
||||
@@ -90,7 +90,8 @@ def get_python_inc(plat_specific=0, prefix=None):
|
||||
# Include is located in the srcdir
|
||||
inc_dir = os.path.join(srcdir, "Include")
|
||||
return inc_dir
|
||||
- return os.path.join(prefix, "include", "python" + get_python_version())
|
||||
+ return os.path.join(prefix, "include",
|
||||
+ "python" + get_python_version() + (sys.pydebug and '-debug' or ''))
|
||||
elif os.name == "nt":
|
||||
return os.path.join(prefix, "include")
|
||||
elif os.name == "os2":
|
||||
@@ -248,7 +249,7 @@ def get_makefile_filename():
|
||||
if python_build:
|
||||
return os.path.join(project_base, "Makefile")
|
||||
lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
|
||||
- return os.path.join(lib_dir, "config", "Makefile")
|
||||
+ return os.path.join(lib_dir, "config" + (sys.pydebug and "-debug" or ""), "Makefile")
|
||||
|
||||
|
||||
def parse_config_h(fp, g=None):
|
||||
diff --git a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py
|
||||
index 78fac46..d1d0931 100644
|
||||
--- a/Lib/distutils/tests/test_install.py
|
||||
+++ b/Lib/distutils/tests/test_install.py
|
||||
@@ -20,8 +20,9 @@ from distutils.tests import support
|
||||
|
||||
|
||||
def _make_ext_name(modname):
|
||||
- if os.name == 'nt' and sys.executable.endswith('_d.exe'):
|
||||
+ if sys.pydebug:
|
||||
modname += '_d'
|
||||
+
|
||||
return modname + sysconfig.get_config_var('SO')
|
||||
|
||||
|
||||
diff --git a/Makefile.pre.in b/Makefile.pre.in
|
||||
index 997a2fc..467e782 100644
|
||||
--- a/Makefile.pre.in
|
||||
+++ b/Makefile.pre.in
|
||||
@@ -116,8 +116,8 @@ SCRIPTDIR= $(prefix)/lib64
|
||||
# Detailed destination directories
|
||||
BINLIBDEST= $(LIBDIR)/python$(VERSION)
|
||||
LIBDEST= $(SCRIPTDIR)/python$(VERSION)
|
||||
-INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
|
||||
-CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
|
||||
+INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
|
||||
+CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
|
||||
LIBP= $(LIBDIR)/python$(VERSION)
|
||||
|
||||
# Symbols used for using shared libraries
|
||||
@@ -131,6 +131,12 @@ DESTSHARED= $(BINLIBDEST)/lib-dynload
|
||||
EXE= @EXEEXT@
|
||||
BUILDEXE= @BUILDEXEEXT@
|
||||
|
||||
+# DEBUG_EXT is used by ELF files (names and SONAMEs); it will be "_d" for a debug build
|
||||
+# DEBUG_SUFFIX is used by filesystem paths; it will be "-debug" for a debug build
|
||||
+# Both will be empty in an optimized build
|
||||
+DEBUG_EXT= @DEBUG_EXT@
|
||||
+DEBUG_SUFFIX= @DEBUG_SUFFIX@
|
||||
+
|
||||
# Short name and location for Mac OS X Python framework
|
||||
UNIVERSALSDK=@UNIVERSALSDK@
|
||||
PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
|
||||
@@ -197,8 +203,8 @@ LIBOBJDIR= Python/
|
||||
LIBOBJS= @LIBOBJS@
|
||||
UNICODE_OBJS= @UNICODE_OBJS@
|
||||
|
||||
-PYTHON= python$(EXE)
|
||||
-BUILDPYTHON= python$(BUILDEXE)
|
||||
+PYTHON= python$(DEBUG_SUFFIX)$(EXE)
|
||||
+BUILDPYTHON= python$(DEBUG_SUFFIX)$(BUILDEXE)
|
||||
|
||||
PYTHON_FOR_REGEN=@PYTHON_FOR_REGEN@
|
||||
PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
|
||||
@@ -547,7 +553,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
|
||||
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
|
||||
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
|
||||
|
||||
-libpython$(VERSION).so: $(LIBRARY_OBJS)
|
||||
+libpython$(VERSION)$(DEBUG_EXT).so: $(LIBRARY_OBJS)
|
||||
if test $(INSTSONAME) != $(LDLIBRARY); then \
|
||||
$(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
|
||||
$(LN) -f $(INSTSONAME) $@; \
|
||||
@@ -954,18 +960,18 @@ bininstall: altbininstall
|
||||
then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
|
||||
else true; \
|
||||
fi
|
||||
- (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(EXE) $(PYTHON))
|
||||
- -rm -f $(DESTDIR)$(BINDIR)/python2$(EXE)
|
||||
- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(EXE) python2$(EXE))
|
||||
- -rm -f $(DESTDIR)$(BINDIR)/python2-config
|
||||
- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python2-config)
|
||||
- -rm -f $(DESTDIR)$(BINDIR)/python-config
|
||||
- (cd $(DESTDIR)$(BINDIR); $(LN) -s python2-config python-config)
|
||||
+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(DEBUG_SUFFIX)$(EXE) $(PYTHON))
|
||||
+ -rm -f $(DESTDIR)$(BINDIR)/python2$(DEBUG_SUFFIX)$(EXE)
|
||||
+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)$(EXE) python2$(DEBUG_SUFFIX)$(EXE))
|
||||
+ -rm -f $(DESTDIR)$(BINDIR)/python2$(DEBUG_SUFFIX)-config
|
||||
+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)-config python2$(DEBUG_SUFFIX)-config)
|
||||
+ -rm -f $(DESTDIR)$(BINDIR)/python$(DEBUG_SUFFIX)-config
|
||||
+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(DEBUG_SUFFIX)-config python$(DEBUG_SUFFIX)-config)
|
||||
-test -d $(DESTDIR)$(LIBPC) || $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC)
|
||||
- -rm -f $(DESTDIR)$(LIBPC)/python2.pc
|
||||
- (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python2.pc)
|
||||
- -rm -f $(DESTDIR)$(LIBPC)/python.pc
|
||||
- (cd $(DESTDIR)$(LIBPC); $(LN) -s python2.pc python.pc)
|
||||
+ -rm -f $(DESTDIR)$(LIBPC)/python2$(DEBUG_SUFFIX).pc
|
||||
+ (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)$(DEBUG_SUFFIX).pc python2$(DEBUG_SUFFIX).pc)
|
||||
+ -rm -f $(DESTDIR)$(LIBPC)/python$(DEBUG_SUFFIX).pc
|
||||
+ (cd $(DESTDIR)$(LIBPC); $(LN) -s python2$(DEBUG_SUFFIX).pc python$(DEBUG_SUFFIX).pc)
|
||||
|
||||
# Install the interpreter with $(VERSION) affixed
|
||||
# This goes into $(exec_prefix)
|
||||
@@ -978,7 +984,7 @@ altbininstall: $(BUILDPYTHON)
|
||||
else true; \
|
||||
fi; \
|
||||
done
|
||||
- $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
|
||||
+ $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)
|
||||
if test -f $(LDLIBRARY); then \
|
||||
if test -n "$(DLLLIBRARY)" ; then \
|
||||
$(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
|
||||
@@ -1148,10 +1154,11 @@ $(srcdir)/Lib/$(PLATDIR):
|
||||
fi; \
|
||||
cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
|
||||
|
||||
-python-config: $(srcdir)/Misc/python-config.in
|
||||
+python$(DEBUG_SUFFIX)-config: $(srcdir)/Misc/python-config.in
|
||||
# Substitution happens here, as the completely-expanded BINDIR
|
||||
# is not available in configure
|
||||
- sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
|
||||
+ sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)," < $(srcdir)/Misc/python-config.in >python$(DEBUG_SUFFIX)-config
|
||||
+
|
||||
|
||||
# Install the include files
|
||||
INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
|
||||
@@ -1172,13 +1179,13 @@ inclinstall:
|
||||
$(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
|
||||
|
||||
# Install the library and miscellaneous stuff needed for extending/embedding
|
||||
-# This goes into $(exec_prefix)
|
||||
-LIBPL= $(LIBP)/config
|
||||
+# This goes into $(exec_prefix)$(DEBUG_SUFFIX)
|
||||
+LIBPL= $(LIBP)/config$(DEBUG_SUFFIX)
|
||||
|
||||
# pkgconfig directory
|
||||
LIBPC= $(LIBDIR)/pkgconfig
|
||||
|
||||
-libainstall: @DEF_MAKE_RULE@ python-config
|
||||
+libainstall: @DEF_MAKE_RULE@ python$(DEBUG_SUFFIX)-config
|
||||
@for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
|
||||
do \
|
||||
if test ! -d $(DESTDIR)$$i; then \
|
||||
@@ -1194,11 +1201,10 @@ libainstall: all python-config
|
||||
$(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
|
||||
$(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
|
||||
$(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
|
||||
- $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
|
||||
+ $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION)$(DEBUG_SUFFIX).pc
|
||||
$(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
|
||||
$(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
|
||||
- $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
|
||||
- rm python-config
|
||||
+ $(INSTALL_SCRIPT) python$(DEBUG_SUFFIX)-config $(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)-config
|
||||
@if [ -s Modules/python.exp -a \
|
||||
"`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
|
||||
echo; echo "Installing support files for building shared extension modules on AIX:"; \
|
||||
diff --git a/Misc/python-config.in b/Misc/python-config.in
|
||||
index a09e07c..c1691ef 100644
|
||||
--- a/Misc/python-config.in
|
||||
+++ b/Misc/python-config.in
|
||||
@@ -44,7 +44,7 @@ for opt in opt_flags:
|
||||
print ' '.join(flags)
|
||||
|
||||
elif opt in ('--libs', '--ldflags'):
|
||||
- libs = ['-lpython' + pyver]
|
||||
+ libs = ['-lpython' + pyver + (sys.pydebug and "_d" or "")]
|
||||
libs += getvar('LIBS').split()
|
||||
libs += getvar('SYSLIBS').split()
|
||||
# add the prefix/lib/pythonX.Y/config dir, but only if there is no
|
||||
diff --git a/Modules/makesetup b/Modules/makesetup
|
||||
index 1bffcbf..f0bc743 100755
|
||||
--- a/Modules/makesetup
|
||||
+++ b/Modules/makesetup
|
||||
@@ -233,7 +233,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
|
||||
*$mod.o*) base=$mod;;
|
||||
*) base=${mod}module;;
|
||||
esac
|
||||
- file="$srcdir/$base\$(SO)"
|
||||
+ file="$srcdir/$base\$(DEBUG_EXT)\$(SO)"
|
||||
case $doconfig in
|
||||
no) SHAREDMODS="$SHAREDMODS $file";;
|
||||
esac
|
||||
diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
|
||||
index 17ebab1..02a94aa 100644
|
||||
--- a/Python/dynload_shlib.c
|
||||
+++ b/Python/dynload_shlib.c
|
||||
@@ -46,11 +46,16 @@ const struct filedescr _PyImport_DynLoadFiletab[] = {
|
||||
{"module.exe", "rb", C_EXTENSION},
|
||||
{"MODULE.EXE", "rb", C_EXTENSION},
|
||||
#else
|
||||
+#ifdef Py_DEBUG
|
||||
+ {"_d.so", "rb", C_EXTENSION},
|
||||
+ {"module_d.so", "rb", C_EXTENSION},
|
||||
+#else
|
||||
{".so", "rb", C_EXTENSION},
|
||||
{"module.so", "rb", C_EXTENSION},
|
||||
-#endif
|
||||
-#endif
|
||||
-#endif
|
||||
+#endif /* Py_DEBUG */
|
||||
+#endif /* __VMS */
|
||||
+#endif /* defined(PYOS_OS2) && defined(PYCC_GCC) */
|
||||
+#endif /* __CYGWIN__ */
|
||||
{0, 0}
|
||||
};
|
||||
|
||||
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
|
||||
index aeff38a..183e3cc 100644
|
||||
--- a/Python/sysmodule.c
|
||||
+++ b/Python/sysmodule.c
|
||||
@@ -1524,6 +1524,12 @@ _PySys_Init(void)
|
||||
PyString_FromString("legacy"));
|
||||
#endif
|
||||
|
||||
+#ifdef Py_DEBUG
|
||||
+ PyDict_SetItemString(sysdict, "pydebug", Py_True);
|
||||
+#else
|
||||
+ PyDict_SetItemString(sysdict, "pydebug", Py_False);
|
||||
+#endif
|
||||
+
|
||||
#undef SET_SYS_FROM_STRING
|
||||
if (PyErr_Occurred())
|
||||
return NULL;
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 0a902c7..5caedb7 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -764,7 +764,7 @@ AC_SUBST(LIBRARY)
|
||||
AC_MSG_CHECKING(LIBRARY)
|
||||
if test -z "$LIBRARY"
|
||||
then
|
||||
- LIBRARY='libpython$(VERSION).a'
|
||||
+ LIBRARY='libpython$(VERSION)$(DEBUG_EXT).a'
|
||||
fi
|
||||
AC_MSG_RESULT($LIBRARY)
|
||||
|
||||
@@ -910,8 +910,8 @@ if test $enable_shared = "yes"; then
|
||||
INSTSONAME="$LDLIBRARY".$SOVERSION
|
||||
;;
|
||||
Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
|
||||
- LDLIBRARY='libpython$(VERSION).so'
|
||||
- BLDLIBRARY='-L. -lpython$(VERSION)'
|
||||
+ LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
|
||||
+ BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
|
||||
RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
|
||||
case $ac_sys_system in
|
||||
FreeBSD*)
|
||||
@@ -1040,6 +1040,14 @@ else AC_MSG_RESULT(no); Py_DEBUG='false'
|
||||
fi],
|
||||
[AC_MSG_RESULT(no)])
|
||||
|
||||
+if test "$Py_DEBUG" = 'true'
|
||||
+then
|
||||
+ DEBUG_EXT=_d
|
||||
+ DEBUG_SUFFIX=-debug
|
||||
+fi
|
||||
+AC_SUBST(DEBUG_EXT)
|
||||
+AC_SUBST(DEBUG_SUFFIX)
|
||||
+
|
||||
# XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
|
||||
# merged with this chunk of code?
|
||||
|
||||
--
|
||||
2.11.0
|
||||
|
50
SOURCES/00113-more-configuration-flags.patch
Normal file
50
SOURCES/00113-more-configuration-flags.patch
Normal file
@ -0,0 +1,50 @@
|
||||
diff -up Python-2.6.5/configure.ac.more-configuration-flags Python-2.6.5/configure.ac
|
||||
--- Python-2.6.5/configure.ac.more-configuration-flags 2010-05-24 18:51:25.410111792 -0400
|
||||
+++ Python-2.6.5/configure.ac 2010-05-24 18:59:23.954986388 -0400
|
||||
@@ -2515,6 +2515,30 @@ else AC_MSG_RESULT(no)
|
||||
fi],
|
||||
[AC_MSG_RESULT(no)])
|
||||
|
||||
+AC_MSG_CHECKING(for --with-count-allocs)
|
||||
+AC_ARG_WITH(count-allocs,
|
||||
+[ --with(out)count-allocs enable/disable per-type instance accounting], [
|
||||
+if test "$withval" != no
|
||||
+then
|
||||
+ AC_DEFINE(COUNT_ALLOCS, 1,
|
||||
+ [Define to keep records of the number of instances of each type])
|
||||
+ AC_MSG_RESULT(yes)
|
||||
+else AC_MSG_RESULT(no)
|
||||
+fi],
|
||||
+[AC_MSG_RESULT(no)])
|
||||
+
|
||||
+AC_MSG_CHECKING(for --with-call-profile)
|
||||
+AC_ARG_WITH(call-profile,
|
||||
+[ --with(out)-call-profile enable/disable statistics on function call invocation], [
|
||||
+if test "$withval" != no
|
||||
+then
|
||||
+ AC_DEFINE(CALL_PROFILE, 1,
|
||||
+ [Define to keep records on function call invocation])
|
||||
+ AC_MSG_RESULT(yes)
|
||||
+else AC_MSG_RESULT(no)
|
||||
+fi],
|
||||
+[AC_MSG_RESULT(no)])
|
||||
+
|
||||
# Check for Python-specific malloc support
|
||||
AC_MSG_CHECKING(for --with-pymalloc)
|
||||
AC_ARG_WITH(pymalloc,
|
||||
diff -up Python-2.6.5/pyconfig.h.in.more-configuration-flags Python-2.6.5/pyconfig.h.in
|
||||
--- Python-2.6.5/pyconfig.h.in.more-configuration-flags 2010-05-24 18:51:45.677988086 -0400
|
||||
+++ Python-2.6.5/pyconfig.h.in 2010-05-24 19:00:44.163987730 -0400
|
||||
@@ -1019,6 +1019,12 @@
|
||||
/* Define to profile with the Pentium timestamp counter */
|
||||
#undef WITH_TSC
|
||||
|
||||
+/* Define to keep records of the number of instances of each type */
|
||||
+#undef COUNT_ALLOCS
|
||||
+
|
||||
+/* Define to keep records on function call invocation */
|
||||
+#undef CALL_PROFILE
|
||||
+
|
||||
/* Define if you want pymalloc to be disabled when running under valgrind */
|
||||
#undef WITH_VALGRIND
|
||||
|
47
SOURCES/00114-statvfs-f_flag-constants.patch
Normal file
47
SOURCES/00114-statvfs-f_flag-constants.patch
Normal file
@ -0,0 +1,47 @@
|
||||
diff -up Python-2.7rc1/Modules/posixmodule.c.statvfs-f-flag-constants Python-2.7rc1/Modules/posixmodule.c
|
||||
--- Python-2.7rc1/Modules/posixmodule.c.statvfs-f-flag-constants 2010-05-15 17:45:30.000000000 -0400
|
||||
+++ Python-2.7rc1/Modules/posixmodule.c 2010-06-07 22:54:16.162068624 -0400
|
||||
@@ -9174,6 +9174,43 @@ all_ins(PyObject *d)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+ /* These came from statvfs.h */
|
||||
+#ifdef ST_RDONLY
|
||||
+ if (ins(d, "ST_RDONLY", (long)ST_RDONLY)) return -1;
|
||||
+#endif /* ST_RDONLY */
|
||||
+#ifdef ST_NOSUID
|
||||
+ if (ins(d, "ST_NOSUID", (long)ST_NOSUID)) return -1;
|
||||
+#endif /* ST_NOSUID */
|
||||
+
|
||||
+ /* GNU extensions */
|
||||
+#ifdef ST_NODEV
|
||||
+ if (ins(d, "ST_NODEV", (long)ST_NODEV)) return -1;
|
||||
+#endif /* ST_NODEV */
|
||||
+#ifdef ST_NOEXEC
|
||||
+ if (ins(d, "ST_NOEXEC", (long)ST_NOEXEC)) return -1;
|
||||
+#endif /* ST_NOEXEC */
|
||||
+#ifdef ST_SYNCHRONOUS
|
||||
+ if (ins(d, "ST_SYNCHRONOUS", (long)ST_SYNCHRONOUS)) return -1;
|
||||
+#endif /* ST_SYNCHRONOUS */
|
||||
+#ifdef ST_MANDLOCK
|
||||
+ if (ins(d, "ST_MANDLOCK", (long)ST_MANDLOCK)) return -1;
|
||||
+#endif /* ST_MANDLOCK */
|
||||
+#ifdef ST_WRITE
|
||||
+ if (ins(d, "ST_WRITE", (long)ST_WRITE)) return -1;
|
||||
+#endif /* ST_WRITE */
|
||||
+#ifdef ST_APPEND
|
||||
+ if (ins(d, "ST_APPEND", (long)ST_APPEND)) return -1;
|
||||
+#endif /* ST_APPEND */
|
||||
+#ifdef ST_NOATIME
|
||||
+ if (ins(d, "ST_NOATIME", (long)ST_NOATIME)) return -1;
|
||||
+#endif /* ST_NOATIME */
|
||||
+#ifdef ST_NODIRATIME
|
||||
+ if (ins(d, "ST_NODIRATIME", (long)ST_NODIRATIME)) return -1;
|
||||
+#endif /* ST_NODIRATIME */
|
||||
+#ifdef ST_RELATIME
|
||||
+ if (ins(d, "ST_RELATIME", (long)ST_RELATIME)) return -1;
|
||||
+#endif /* ST_RELATIME */
|
||||
+
|
||||
#if defined(PYOS_OS2)
|
||||
if (insertvalues(d)) return -1;
|
||||
#endif
|
13
SOURCES/00121-add-Modules-to-build-path.patch
Normal file
13
SOURCES/00121-add-Modules-to-build-path.patch
Normal file
@ -0,0 +1,13 @@
|
||||
--- Python-2.7.5/Lib/site.py.orig 2013-05-16 12:47:55.000000000 +0200
|
||||
+++ Python-2.7.5/Lib/site.py 2013-05-16 12:56:20.089058109 +0200
|
||||
@@ -529,6 +529,10 @@ def main():
|
||||
|
||||
abs__file__()
|
||||
known_paths = removeduppaths()
|
||||
+ from sysconfig import is_python_build
|
||||
+ if is_python_build():
|
||||
+ from _sysconfigdata import build_time_vars
|
||||
+ sys.path.append(os.path.join(build_time_vars['abs_builddir'], 'Modules'))
|
||||
if ENABLE_USER_SITE is None:
|
||||
ENABLE_USER_SITE = check_enableusersite()
|
||||
known_paths = addusersitepackages(known_paths)
|
11
SOURCES/00131-disable-tests-in-test_io.patch
Normal file
11
SOURCES/00131-disable-tests-in-test_io.patch
Normal file
@ -0,0 +1,11 @@
|
||||
diff -up Python-2.7.2/Lib/test/test_io.py.disable-tests-in-test_io Python-2.7.2/Lib/test/test_io.py
|
||||
--- Python-2.7.2/Lib/test/test_io.py.disable-tests-in-test_io 2011-09-01 14:18:45.963304089 -0400
|
||||
+++ Python-2.7.2/Lib/test/test_io.py 2011-09-01 15:08:53.796098413 -0400
|
||||
@@ -2669,6 +2669,7 @@ class SignalsTest(unittest.TestCase):
|
||||
self.check_interrupted_read_retry(lambda x: x,
|
||||
mode="r")
|
||||
|
||||
+ @unittest.skip('rhbz#732998')
|
||||
@unittest.skipUnless(threading, 'Threading required for this test.')
|
||||
def check_interrupted_write_retry(self, item, **fdopen_kwargs):
|
||||
"""Check that a buffered write, when it gets interrupted (either
|
68
SOURCES/00132-add-rpmbuild-hooks-to-unittest.patch
Normal file
68
SOURCES/00132-add-rpmbuild-hooks-to-unittest.patch
Normal file
@ -0,0 +1,68 @@
|
||||
diff -up Python-2.7.2/Lib/unittest/case.py.add-rpmbuild-hooks-to-unittest Python-2.7.2/Lib/unittest/case.py
|
||||
--- Python-2.7.2/Lib/unittest/case.py.add-rpmbuild-hooks-to-unittest 2011-09-08 14:45:47.677169191 -0400
|
||||
+++ Python-2.7.2/Lib/unittest/case.py 2011-09-08 16:01:36.287858159 -0400
|
||||
@@ -1,6 +1,7 @@
|
||||
"""Test case implementation"""
|
||||
|
||||
import collections
|
||||
+import os
|
||||
import sys
|
||||
import functools
|
||||
import difflib
|
||||
@@ -94,6 +95,43 @@ def expectedFailure(func):
|
||||
return wrapper
|
||||
|
||||
|
||||
+# Non-standard/downstream-only hooks for handling issues with specific test
|
||||
+# cases:
|
||||
+
|
||||
+def _skipInRpmBuild(reason):
|
||||
+ """
|
||||
+ Non-standard/downstream-only decorator for marking a specific unit test
|
||||
+ to be skipped when run within the %check of an rpmbuild.
|
||||
+
|
||||
+ Specifically, this takes effect when WITHIN_PYTHON_RPM_BUILD is set within
|
||||
+ the environment, and has no effect otherwise.
|
||||
+ """
|
||||
+ if 'WITHIN_PYTHON_RPM_BUILD' in os.environ:
|
||||
+ return skip(reason)
|
||||
+ else:
|
||||
+ return _id
|
||||
+
|
||||
+def _expectedFailureInRpmBuild(func):
|
||||
+ """
|
||||
+ Non-standard/downstream-only decorator for marking a specific unit test
|
||||
+ as expected to fail within the %check of an rpmbuild.
|
||||
+
|
||||
+ Specifically, this takes effect when WITHIN_PYTHON_RPM_BUILD is set within
|
||||
+ the environment, and has no effect otherwise.
|
||||
+ """
|
||||
+ @functools.wraps(func)
|
||||
+ def wrapper(*args, **kwargs):
|
||||
+ if 'WITHIN_PYTHON_RPM_BUILD' in os.environ:
|
||||
+ try:
|
||||
+ func(*args, **kwargs)
|
||||
+ except Exception:
|
||||
+ raise _ExpectedFailure(sys.exc_info())
|
||||
+ raise _UnexpectedSuccess
|
||||
+ else:
|
||||
+ # Call directly:
|
||||
+ func(*args, **kwargs)
|
||||
+ return wrapper
|
||||
+
|
||||
class _AssertRaisesContext(object):
|
||||
"""A context manager used to implement TestCase.assertRaises* methods."""
|
||||
|
||||
diff -up Python-2.7.2/Lib/unittest/__init__.py.add-rpmbuild-hooks-to-unittest Python-2.7.2/Lib/unittest/__init__.py
|
||||
--- Python-2.7.2/Lib/unittest/__init__.py.add-rpmbuild-hooks-to-unittest 2011-09-08 14:59:39.534112310 -0400
|
||||
+++ Python-2.7.2/Lib/unittest/__init__.py 2011-09-08 15:07:09.191081562 -0400
|
||||
@@ -57,7 +57,8 @@ __unittest = True
|
||||
|
||||
from .result import TestResult
|
||||
from .case import (TestCase, FunctionTestCase, SkipTest, skip, skipIf,
|
||||
- skipUnless, expectedFailure)
|
||||
+ skipUnless, expectedFailure,
|
||||
+ _skipInRpmBuild, _expectedFailureInRpmBuild)
|
||||
from .suite import BaseTestSuite, TestSuite
|
||||
from .loader import (TestLoader, defaultTestLoader, makeSuite, getTestCaseNames,
|
||||
findTestCases)
|
13
SOURCES/00133-skip-test_dl.patch
Normal file
13
SOURCES/00133-skip-test_dl.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff -up Python-2.7.2/Lib/test/test_dl.py.skip-test_dl Python-2.7.2/Lib/test/test_dl.py
|
||||
--- Python-2.7.2/Lib/test/test_dl.py.skip-test_dl 2011-09-08 15:18:40.529034289 -0400
|
||||
+++ Python-2.7.2/Lib/test/test_dl.py 2011-09-08 16:29:45.184742670 -0400
|
||||
@@ -13,6 +13,9 @@ sharedlibs = [
|
||||
('/usr/lib/libc.dylib', 'getpid'),
|
||||
]
|
||||
|
||||
+# (also, "dl" is deprecated in favor of ctypes)
|
||||
+@unittest._skipInRpmBuild('fails on 64-bit builds: '
|
||||
+ 'module dl requires sizeof(int) == sizeof(long) == sizeof(char*)')
|
||||
def test_main():
|
||||
for s, func in sharedlibs:
|
||||
try:
|
11
SOURCES/00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
Normal file
11
SOURCES/00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
Normal file
@ -0,0 +1,11 @@
|
||||
diff -up Python-2.7.6/Lib/test/test_file2k.py.stdin-test Python-2.7.6/Lib/test/test_file2k.py
|
||||
--- Python-2.7.6/Lib/test/test_file2k.py.stdin-test 2013-11-10 08:36:40.000000000 +0100
|
||||
+++ Python-2.7.6/Lib/test/test_file2k.py 2014-01-29 14:28:01.029488055 +0100
|
||||
@@ -223,6 +223,7 @@ class OtherFileTests(unittest.TestCase):
|
||||
else:
|
||||
f.close()
|
||||
|
||||
+ @unittest._skipInRpmBuild('seems not to raise the exception when run in Koji')
|
||||
def testStdinSeek(self):
|
||||
if sys.platform == 'osf1V5':
|
||||
# This causes the interpreter to exit on OSF1 v5.1.
|
@ -0,0 +1,12 @@
|
||||
diff -up Python-2.7.3/Lib/distutils/tests/test_bdist_rpm.py.mark-tests-that-fail-in-rpmbuild Python-2.7.3/Lib/distutils/tests/test_bdist_rpm.py
|
||||
--- Python-2.7.3/Lib/distutils/tests/test_bdist_rpm.py.mark-tests-that-fail-in-rpmbuild 2012-04-09 19:07:29.000000000 -0400
|
||||
+++ Python-2.7.3/Lib/distutils/tests/test_bdist_rpm.py 2012-04-13 00:20:08.223819263 -0400
|
||||
@@ -24,6 +24,7 @@ setup(name='foo', version='0.1', py_modu
|
||||
|
||||
"""
|
||||
|
||||
+@unittest._skipInRpmBuild("don't try to nest one rpm build inside another rpm build")
|
||||
class BuildRpmTestCase(support.TempdirManager,
|
||||
support.EnvironGuard,
|
||||
support.LoggingSilencer,
|
||||
diff -up Python-2.7.3/Lib/distutils/tests/test_build_ext.py.mark-tests-that-fail-in-rpmbuild Python-2.7.3/Lib/distutils/tests/test_build_ext.py
|
68
SOURCES/00138-fix-distutils-tests-in-debug-build.patch
Normal file
68
SOURCES/00138-fix-distutils-tests-in-debug-build.patch
Normal file
@ -0,0 +1,68 @@
|
||||
diff -up Python-2.7.2/Lib/distutils/tests/test_build_ext.py.mark-tests-that-fail-in-rpmbuild Python-2.7.2/Lib/distutils/tests/test_build_ext.py
|
||||
--- Python-2.7.2/Lib/distutils/tests/test_build_ext.py.mark-tests-that-fail-in-rpmbuild 2011-09-08 16:07:25.033834312 -0400
|
||||
+++ Python-2.7.2/Lib/distutils/tests/test_build_ext.py 2011-09-08 17:43:15.656441082 -0400
|
||||
@@ -330,6 +332,7 @@ class BuildExtTestCase(support.TempdirMa
|
||||
self.assertEqual(lastdir, 'bar')
|
||||
|
||||
def test_ext_fullpath(self):
|
||||
+ debug_ext = sysconfig.get_config_var("DEBUG_EXT")
|
||||
ext = sysconfig.get_config_vars()['SO']
|
||||
dist = Distribution()
|
||||
cmd = build_ext(dist)
|
||||
@@ -337,14 +340,14 @@ class BuildExtTestCase(support.TempdirMa
|
||||
cmd.distribution.package_dir = {'': 'src'}
|
||||
cmd.distribution.packages = ['lxml', 'lxml.html']
|
||||
curdir = os.getcwd()
|
||||
- wanted = os.path.join(curdir, 'src', 'lxml', 'etree' + ext)
|
||||
+ wanted = os.path.join(curdir, 'src', 'lxml', 'etree' + debug_ext + ext)
|
||||
path = cmd.get_ext_fullpath('lxml.etree')
|
||||
self.assertEqual(wanted, path)
|
||||
|
||||
# building lxml.etree not inplace
|
||||
cmd.inplace = 0
|
||||
cmd.build_lib = os.path.join(curdir, 'tmpdir')
|
||||
- wanted = os.path.join(curdir, 'tmpdir', 'lxml', 'etree' + ext)
|
||||
+ wanted = os.path.join(curdir, 'tmpdir', 'lxml', 'etree' + debug_ext + ext)
|
||||
path = cmd.get_ext_fullpath('lxml.etree')
|
||||
self.assertEqual(wanted, path)
|
||||
|
||||
@@ -354,13 +357,13 @@ class BuildExtTestCase(support.TempdirMa
|
||||
cmd.distribution.packages = ['twisted', 'twisted.runner.portmap']
|
||||
path = cmd.get_ext_fullpath('twisted.runner.portmap')
|
||||
wanted = os.path.join(curdir, 'tmpdir', 'twisted', 'runner',
|
||||
- 'portmap' + ext)
|
||||
+ 'portmap' + debug_ext + ext)
|
||||
self.assertEqual(wanted, path)
|
||||
|
||||
# building twisted.runner.portmap inplace
|
||||
cmd.inplace = 1
|
||||
path = cmd.get_ext_fullpath('twisted.runner.portmap')
|
||||
- wanted = os.path.join(curdir, 'twisted', 'runner', 'portmap' + ext)
|
||||
+ wanted = os.path.join(curdir, 'twisted', 'runner', 'portmap' + debug_ext + ext)
|
||||
self.assertEqual(wanted, path)
|
||||
|
||||
def test_build_ext_inplace(self):
|
||||
@@ -373,8 +376,9 @@ class BuildExtTestCase(support.TempdirMa
|
||||
cmd.distribution.package_dir = {'': 'src'}
|
||||
cmd.distribution.packages = ['lxml', 'lxml.html']
|
||||
curdir = os.getcwd()
|
||||
+ debug_ext = sysconfig.get_config_var("DEBUG_EXT")
|
||||
ext = sysconfig.get_config_var("SO")
|
||||
- wanted = os.path.join(curdir, 'src', 'lxml', 'etree' + ext)
|
||||
+ wanted = os.path.join(curdir, 'src', 'lxml', 'etree' + debug_ext + ext)
|
||||
path = cmd.get_ext_fullpath('lxml.etree')
|
||||
self.assertEqual(wanted, path)
|
||||
|
||||
@@ -412,10 +416,11 @@ class BuildExtTestCase(support.TempdirMa
|
||||
dist = Distribution({'name': 'UpdateManager'})
|
||||
cmd = build_ext(dist)
|
||||
cmd.ensure_finalized()
|
||||
+ debug_ext = sysconfig.get_config_var("DEBUG_EXT")
|
||||
ext = sysconfig.get_config_var("SO")
|
||||
ext_name = os.path.join('UpdateManager', 'fdsend')
|
||||
ext_path = cmd.get_ext_fullpath(ext_name)
|
||||
- wanted = os.path.join(cmd.build_lib, 'UpdateManager', 'fdsend' + ext)
|
||||
+ wanted = os.path.join(cmd.build_lib, 'UpdateManager', 'fdsend' + debug_ext + ext)
|
||||
self.assertEqual(ext_path, wanted)
|
||||
|
||||
@unittest.skipUnless(sys.platform == 'win32', 'these tests require Windows')
|
11
SOURCES/00139-skip-test_float-known-failure-on-arm.patch
Normal file
11
SOURCES/00139-skip-test_float-known-failure-on-arm.patch
Normal file
@ -0,0 +1,11 @@
|
||||
diff -up Python-2.7.2/Lib/test/test_float.py.skip-test_float-known-failure-on-arm Python-2.7.2/Lib/test/test_float.py
|
||||
--- Python-2.7.2/Lib/test/test_float.py.skip-test_float-known-failure-on-arm 2011-09-08 19:34:09.000986128 -0400
|
||||
+++ Python-2.7.2/Lib/test/test_float.py 2011-09-08 19:34:57.969982779 -0400
|
||||
@@ -1072,6 +1072,7 @@ class HexFloatTestCase(unittest.TestCase
|
||||
self.identical(got, expected)
|
||||
|
||||
|
||||
+ @unittest.skip('Known failure on ARM: http://bugs.python.org/issue8265')
|
||||
def test_from_hex(self):
|
||||
MIN = self.MIN;
|
||||
MAX = self.MAX;
|
11
SOURCES/00140-skip-test_ctypes-known-failure-on-sparc.patch
Normal file
11
SOURCES/00140-skip-test_ctypes-known-failure-on-sparc.patch
Normal file
@ -0,0 +1,11 @@
|
||||
diff -up Python-2.7.2/Lib/ctypes/test/test_callbacks.py.skip-test_ctypes-known-failure-on-sparc Python-2.7.2/Lib/ctypes/test/test_callbacks.py
|
||||
--- Python-2.7.2/Lib/ctypes/test/test_callbacks.py.skip-test_ctypes-known-failure-on-sparc 2011-09-08 19:42:35.541951490 -0400
|
||||
+++ Python-2.7.2/Lib/ctypes/test/test_callbacks.py 2011-09-08 19:43:40.676947036 -0400
|
||||
@@ -67,6 +67,7 @@ class Callbacks(unittest.TestCase):
|
||||
self.check_type(c_longlong, 42)
|
||||
self.check_type(c_longlong, -42)
|
||||
|
||||
+ @unittest.skip('Known failure on Sparc: http://bugs.python.org/issue8314')
|
||||
def test_ulonglong(self):
|
||||
# test some 64-bit values, with and without msb set.
|
||||
self.check_type(c_ulonglong, 10955412242170339782)
|
22
SOURCES/00142-skip-failing-pty-tests-in-rpmbuild.patch
Normal file
22
SOURCES/00142-skip-failing-pty-tests-in-rpmbuild.patch
Normal file
@ -0,0 +1,22 @@
|
||||
diff -up Python-2.7.6/Lib/test/test_openpty.py.tty-fail Python-2.7.6/Lib/test/test_openpty.py
|
||||
--- Python-2.7.6/Lib/test/test_openpty.py.tty-fail 2014-01-29 14:31:43.761343267 +0100
|
||||
+++ Python-2.7.6/Lib/test/test_openpty.py 2014-01-29 14:32:19.284090165 +0100
|
||||
@@ -8,6 +8,7 @@ if not hasattr(os, "openpty"):
|
||||
|
||||
|
||||
class OpenptyTest(unittest.TestCase):
|
||||
+ @unittest._skipInRpmBuild('sometimes fails in Koji, possibly due to a mock issue (rhbz#714627)')
|
||||
def test(self):
|
||||
master, slave = os.openpty()
|
||||
self.addCleanup(os.close, master)
|
||||
diff -up Python-2.7.6/Lib/test/test_pty.py.tty-fail Python-2.7.6/Lib/test/test_pty.py
|
||||
--- Python-2.7.6/Lib/test/test_pty.py.tty-fail 2013-11-10 08:36:40.000000000 +0100
|
||||
+++ Python-2.7.6/Lib/test/test_pty.py 2014-01-29 14:31:43.761343267 +0100
|
||||
@@ -111,6 +111,7 @@ class PtyTest(unittest.TestCase):
|
||||
os.close(master_fd)
|
||||
|
||||
|
||||
+ @unittest._skipInRpmBuild('sometimes fails in Koji, possibly due to a mock issue (rhbz#714627)')
|
||||
def test_fork(self):
|
||||
debug("calling pty.fork()")
|
||||
pid, master_fd = pty.fork()
|
58
SOURCES/00143-tsc-on-ppc.patch
Normal file
58
SOURCES/00143-tsc-on-ppc.patch
Normal file
@ -0,0 +1,58 @@
|
||||
diff -up Python-2.7.2/Python/ceval.c.tsc-on-ppc Python-2.7.2/Python/ceval.c
|
||||
--- Python-2.7.2/Python/ceval.c.tsc-on-ppc 2011-08-23 14:59:48.051300849 -0400
|
||||
+++ Python-2.7.2/Python/ceval.c 2011-08-23 15:33:25.412162902 -0400
|
||||
@@ -37,24 +37,42 @@ typedef unsigned long long uint64;
|
||||
*/
|
||||
#if defined(__ppc__) || defined (__powerpc__)
|
||||
|
||||
-#define READ_TIMESTAMP(var) ppc_getcounter(&var)
|
||||
+#if defined( __powerpc64__) || defined(__LP64__)
|
||||
+/* 64-bit PowerPC */
|
||||
+#define READ_TIMESTAMP(var) ppc64_getcounter(&var)
|
||||
+static void
|
||||
+ppc64_getcounter(uint64 *v)
|
||||
+{
|
||||
+ /* On 64-bit PowerPC we can read the 64-bit timebase directly into a
|
||||
+ 64-bit register */
|
||||
+ uint64 timebase;
|
||||
+#ifdef _ARCH_PWR4
|
||||
+ asm volatile ("mfspr %0,268" : "=r" (timebase));
|
||||
+#else
|
||||
+ asm volatile ("mftb %0" : "=r" (timebase));
|
||||
+#endif
|
||||
+ *v = timebase;
|
||||
+}
|
||||
+
|
||||
+#else
|
||||
+/* 32-bit PowerPC */
|
||||
+#define READ_TIMESTAMP(var) ppc32_getcounter(&var)
|
||||
|
||||
static void
|
||||
-ppc_getcounter(uint64 *v)
|
||||
+ppc32_getcounter(uint64 *v)
|
||||
{
|
||||
- register unsigned long tbu, tb, tbu2;
|
||||
+ union { long long ll; long ii[2]; } u;
|
||||
+ long tmp;
|
||||
|
||||
loop:
|
||||
- asm volatile ("mftbu %0" : "=r" (tbu) );
|
||||
- asm volatile ("mftb %0" : "=r" (tb) );
|
||||
- asm volatile ("mftbu %0" : "=r" (tbu2));
|
||||
- if (__builtin_expect(tbu != tbu2, 0)) goto loop;
|
||||
-
|
||||
- /* The slightly peculiar way of writing the next lines is
|
||||
- compiled better by GCC than any other way I tried. */
|
||||
- ((long*)(v))[0] = tbu;
|
||||
- ((long*)(v))[1] = tb;
|
||||
+ asm volatile ("mftbu %0" : "=r" (u.ii[0]) );
|
||||
+ asm volatile ("mftb %0" : "=r" (u.ii[1]) );
|
||||
+ asm volatile ("mftbu %0" : "=r" (tmp));
|
||||
+ if (__builtin_expect(u.ii[0] != tmp, 0)) goto loop;
|
||||
+
|
||||
+ *v = u.ll;
|
||||
}
|
||||
+#endif /* powerpc 32/64 bit */
|
||||
|
||||
#elif defined(__i386__)
|
||||
|
12
SOURCES/00144-no-gdbm.patch
Normal file
12
SOURCES/00144-no-gdbm.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -up Python-2.7.2/Modules/Setup.dist.no-gdbm Python-2.7.2/Modules/Setup.dist
|
||||
--- Python-2.7.2/Modules/Setup.dist.no-gdbm 2011-09-13 14:25:43.496095926 -0400
|
||||
+++ Python-2.7.2/Modules/Setup.dist 2011-09-13 14:25:46.491095724 -0400
|
||||
@@ -396,7 +396,7 @@ dl dlmodule.c
|
||||
#
|
||||
# First, look at Setup.config; configure may have set this for you.
|
||||
|
||||
-gdbm gdbmmodule.c -lgdbm
|
||||
+# gdbm gdbmmodule.c -lgdbm
|
||||
|
||||
|
||||
# Sleepycat Berkeley DB interface.
|
732
SOURCES/00146-hashlib-fips.patch
Normal file
732
SOURCES/00146-hashlib-fips.patch
Normal file
@ -0,0 +1,732 @@
|
||||
diff -up Python-2.7.2/Lib/hashlib.py.hashlib-fips Python-2.7.2/Lib/hashlib.py
|
||||
--- Python-2.7.2/Lib/hashlib.py.hashlib-fips 2011-06-11 11:46:24.000000000 -0400
|
||||
+++ Python-2.7.2/Lib/hashlib.py 2011-09-14 00:21:26.194252001 -0400
|
||||
@@ -6,9 +6,12 @@
|
||||
|
||||
__doc__ = """hashlib module - A common interface to many hash functions.
|
||||
|
||||
-new(name, string='') - returns a new hash object implementing the
|
||||
- given hash function; initializing the hash
|
||||
- using the given string data.
|
||||
+new(name, string='', usedforsecurity=True)
|
||||
+ - returns a new hash object implementing the given hash function;
|
||||
+ initializing the hash using the given string data.
|
||||
+
|
||||
+ "usedforsecurity" is a non-standard extension for better supporting
|
||||
+ FIPS-compliant environments (see below)
|
||||
|
||||
Named constructor functions are also available, these are much faster
|
||||
than using new():
|
||||
@@ -24,6 +27,20 @@ the zlib module.
|
||||
Choose your hash function wisely. Some have known collision weaknesses.
|
||||
sha384 and sha512 will be slow on 32 bit platforms.
|
||||
|
||||
+Our implementation of hashlib uses OpenSSL.
|
||||
+
|
||||
+OpenSSL has a "FIPS mode", which, if enabled, may restrict the available hashes
|
||||
+to only those that are compliant with FIPS regulations. For example, it may
|
||||
+deny the use of MD5, on the grounds that this is not secure for uses such as
|
||||
+authentication, system integrity checking, or digital signatures.
|
||||
+
|
||||
+If you need to use such a hash for non-security purposes (such as indexing into
|
||||
+a data structure for speed), you can override the keyword argument
|
||||
+"usedforsecurity" from True to False to signify that your code is not relying
|
||||
+on the hash for security purposes, and this will allow the hash to be usable
|
||||
+even in FIPS mode. This is not a standard feature of Python 2.7's hashlib, and
|
||||
+is included here to better support FIPS mode.
|
||||
+
|
||||
Hash objects have these methods:
|
||||
- update(arg): Update the hash object with the string arg. Repeated calls
|
||||
are equivalent to a single call with the concatenation of all
|
||||
@@ -63,76 +80,41 @@ algorithms = __always_supported
|
||||
'pbkdf2_hmac')
|
||||
|
||||
|
||||
-def __get_builtin_constructor(name):
|
||||
- try:
|
||||
- if name in ('SHA1', 'sha1'):
|
||||
- import _sha
|
||||
- return _sha.new
|
||||
- elif name in ('MD5', 'md5'):
|
||||
- import _md5
|
||||
- return _md5.new
|
||||
- elif name in ('SHA256', 'sha256', 'SHA224', 'sha224'):
|
||||
- import _sha256
|
||||
- bs = name[3:]
|
||||
- if bs == '256':
|
||||
- return _sha256.sha256
|
||||
- elif bs == '224':
|
||||
- return _sha256.sha224
|
||||
- elif name in ('SHA512', 'sha512', 'SHA384', 'sha384'):
|
||||
- import _sha512
|
||||
- bs = name[3:]
|
||||
- if bs == '512':
|
||||
- return _sha512.sha512
|
||||
- elif bs == '384':
|
||||
- return _sha512.sha384
|
||||
- except ImportError:
|
||||
- pass # no extension module, this hash is unsupported.
|
||||
-
|
||||
- raise ValueError('unsupported hash type ' + name)
|
||||
-
|
||||
-
|
||||
def __get_openssl_constructor(name):
|
||||
try:
|
||||
f = getattr(_hashlib, 'openssl_' + name)
|
||||
# Allow the C module to raise ValueError. The function will be
|
||||
# defined but the hash not actually available thanks to OpenSSL.
|
||||
- f()
|
||||
+ #
|
||||
+ # We pass "usedforsecurity=False" to disable FIPS-based restrictions:
|
||||
+ # at this stage we're merely seeing if the function is callable,
|
||||
+ # rather than using it for actual work.
|
||||
+ f(usedforsecurity=False)
|
||||
# Use the C function directly (very fast)
|
||||
return f
|
||||
except (AttributeError, ValueError):
|
||||
- return __get_builtin_constructor(name)
|
||||
+ raise
|
||||
|
||||
-
|
||||
-def __py_new(name, string=''):
|
||||
- """new(name, string='') - Return a new hashing object using the named algorithm;
|
||||
- optionally initialized with a string.
|
||||
- """
|
||||
- return __get_builtin_constructor(name)(string)
|
||||
-
|
||||
-
|
||||
-def __hash_new(name, string=''):
|
||||
+def __hash_new(name, string='', usedforsecurity=True):
|
||||
"""new(name, string='') - Return a new hashing object using the named algorithm;
|
||||
optionally initialized with a string.
|
||||
+ Override 'usedforsecurity' to False when using for non-security purposes in
|
||||
+ a FIPS environment
|
||||
"""
|
||||
try:
|
||||
- return _hashlib.new(name, string)
|
||||
+ return _hashlib.new(name, string, usedforsecurity)
|
||||
except ValueError:
|
||||
- # If the _hashlib module (OpenSSL) doesn't support the named
|
||||
- # hash, try using our builtin implementations.
|
||||
- # This allows for SHA224/256 and SHA384/512 support even though
|
||||
- # the OpenSSL library prior to 0.9.8 doesn't provide them.
|
||||
- return __get_builtin_constructor(name)(string)
|
||||
-
|
||||
+ raise
|
||||
|
||||
try:
|
||||
import _hashlib
|
||||
new = __hash_new
|
||||
__get_hash = __get_openssl_constructor
|
||||
algorithms_available = algorithms_available.union(
|
||||
_hashlib.openssl_md_meth_names)
|
||||
except ImportError:
|
||||
- new = __py_new
|
||||
- __get_hash = __get_builtin_constructor
|
||||
+ # We don't build the legacy modules
|
||||
+ raise
|
||||
|
||||
for __func_name in __always_supported:
|
||||
# try them all, some may not work due to the OpenSSL
|
||||
@@ -143,4 +125,4 @@ for __func_name in __always_supported:
|
||||
|
||||
# Cleanup locals()
|
||||
del __always_supported, __func_name, __get_hash
|
||||
-del __py_new, __hash_new, __get_openssl_constructor
|
||||
+del __hash_new, __get_openssl_constructor
|
||||
diff -up Python-2.7.2/Lib/test/test_hashlib.py.hashlib-fips Python-2.7.2/Lib/test/test_hashlib.py
|
||||
--- Python-2.7.2/Lib/test/test_hashlib.py.hashlib-fips 2011-06-11 11:46:25.000000000 -0400
|
||||
+++ Python-2.7.2/Lib/test/test_hashlib.py 2011-09-14 01:08:55.525254195 -0400
|
||||
@@ -32,6 +32,19 @@ def hexstr(s):
|
||||
r = r + h[(i >> 4) & 0xF] + h[i & 0xF]
|
||||
return r
|
||||
|
||||
+def openssl_enforces_fips():
|
||||
+ # Use the "openssl" command (if present) to try to determine if the local
|
||||
+ # OpenSSL is configured to enforce FIPS
|
||||
+ from subprocess import Popen, PIPE
|
||||
+ try:
|
||||
+ p = Popen(['openssl', 'md5'],
|
||||
+ stdin=PIPE, stdout=PIPE, stderr=PIPE)
|
||||
+ except OSError:
|
||||
+ # "openssl" command not found
|
||||
+ return False
|
||||
+ stdout, stderr = p.communicate(input=b'abc')
|
||||
+ return b'unknown cipher' in stderr
|
||||
+OPENSSL_ENFORCES_FIPS = openssl_enforces_fips()
|
||||
|
||||
class HashLibTestCase(unittest.TestCase):
|
||||
supported_hash_names = ( 'md5', 'MD5', 'sha1', 'SHA1',
|
||||
@@ -61,10 +74,10 @@ class HashLibTestCase(unittest.TestCase)
|
||||
# of hashlib.new given the algorithm name.
|
||||
for algorithm, constructors in self.constructors_to_test.items():
|
||||
constructors.add(getattr(hashlib, algorithm))
|
||||
- def _test_algorithm_via_hashlib_new(data=None, _alg=algorithm):
|
||||
+ def _test_algorithm_via_hashlib_new(data=None, _alg=algorithm, usedforsecurity=True):
|
||||
if data is None:
|
||||
- return hashlib.new(_alg)
|
||||
- return hashlib.new(_alg, data)
|
||||
+ return hashlib.new(_alg, usedforsecurity=usedforsecurity)
|
||||
+ return hashlib.new(_alg, data, usedforsecurity=usedforsecurity)
|
||||
constructors.add(_test_algorithm_via_hashlib_new)
|
||||
|
||||
_hashlib = self._conditional_import_module('_hashlib')
|
||||
@@ -78,28 +91,13 @@ class HashLibTestCase(unittest.TestCase)
|
||||
if constructor:
|
||||
constructors.add(constructor)
|
||||
|
||||
- _md5 = self._conditional_import_module('_md5')
|
||||
- if _md5:
|
||||
- self.constructors_to_test['md5'].add(_md5.new)
|
||||
- _sha = self._conditional_import_module('_sha')
|
||||
- if _sha:
|
||||
- self.constructors_to_test['sha1'].add(_sha.new)
|
||||
- _sha256 = self._conditional_import_module('_sha256')
|
||||
- if _sha256:
|
||||
- self.constructors_to_test['sha224'].add(_sha256.sha224)
|
||||
- self.constructors_to_test['sha256'].add(_sha256.sha256)
|
||||
- _sha512 = self._conditional_import_module('_sha512')
|
||||
- if _sha512:
|
||||
- self.constructors_to_test['sha384'].add(_sha512.sha384)
|
||||
- self.constructors_to_test['sha512'].add(_sha512.sha512)
|
||||
-
|
||||
super(HashLibTestCase, self).__init__(*args, **kwargs)
|
||||
|
||||
def test_hash_array(self):
|
||||
a = array.array("b", range(10))
|
||||
constructors = self.constructors_to_test.itervalues()
|
||||
for cons in itertools.chain.from_iterable(constructors):
|
||||
- c = cons(a)
|
||||
+ c = cons(a, usedforsecurity=False)
|
||||
c.hexdigest()
|
||||
|
||||
def test_algorithms_attribute(self):
|
||||
@@ -115,28 +113,9 @@ class HashLibTestCase(unittest.TestCase)
|
||||
self.assertRaises(ValueError, hashlib.new, 'spam spam spam spam spam')
|
||||
self.assertRaises(TypeError, hashlib.new, 1)
|
||||
|
||||
- def test_get_builtin_constructor(self):
|
||||
- get_builtin_constructor = hashlib.__dict__[
|
||||
- '__get_builtin_constructor']
|
||||
- self.assertRaises(ValueError, get_builtin_constructor, 'test')
|
||||
- try:
|
||||
- import _md5
|
||||
- except ImportError:
|
||||
- pass
|
||||
- # This forces an ImportError for "import _md5" statements
|
||||
- sys.modules['_md5'] = None
|
||||
- try:
|
||||
- self.assertRaises(ValueError, get_builtin_constructor, 'md5')
|
||||
- finally:
|
||||
- if '_md5' in locals():
|
||||
- sys.modules['_md5'] = _md5
|
||||
- else:
|
||||
- del sys.modules['_md5']
|
||||
- self.assertRaises(TypeError, get_builtin_constructor, 3)
|
||||
-
|
||||
def test_hexdigest(self):
|
||||
for name in self.supported_hash_names:
|
||||
- h = hashlib.new(name)
|
||||
+ h = hashlib.new(name, usedforsecurity=False)
|
||||
self.assertTrue(hexstr(h.digest()) == h.hexdigest())
|
||||
|
||||
def test_large_update(self):
|
||||
@@ -145,16 +125,16 @@ class HashLibTestCase(unittest.TestCase)
|
||||
abcs = aas + bees + cees
|
||||
|
||||
for name in self.supported_hash_names:
|
||||
- m1 = hashlib.new(name)
|
||||
+ m1 = hashlib.new(name, usedforsecurity=False)
|
||||
m1.update(aas)
|
||||
m1.update(bees)
|
||||
m1.update(cees)
|
||||
|
||||
- m2 = hashlib.new(name)
|
||||
+ m2 = hashlib.new(name, usedforsecurity=False)
|
||||
m2.update(abcs)
|
||||
self.assertEqual(m1.digest(), m2.digest(), name+' update problem.')
|
||||
|
||||
- m3 = hashlib.new(name, abcs)
|
||||
+ m3 = hashlib.new(name, abcs, usedforsecurity=False)
|
||||
self.assertEqual(m1.digest(), m3.digest(), name+' new problem.')
|
||||
|
||||
def check(self, name, data, digest):
|
||||
@@ -162,7 +142,7 @@ class HashLibTestCase(unittest.TestCase)
|
||||
# 2 is for hashlib.name(...) and hashlib.new(name, ...)
|
||||
self.assertGreaterEqual(len(constructors), 2)
|
||||
for hash_object_constructor in constructors:
|
||||
- computed = hash_object_constructor(data).hexdigest()
|
||||
+ computed = hash_object_constructor(data, usedforsecurity=False).hexdigest()
|
||||
self.assertEqual(
|
||||
computed, digest,
|
||||
"Hash algorithm %s constructed using %s returned hexdigest"
|
||||
@@ -172,7 +152,8 @@ class HashLibTestCase(unittest.TestCase)
|
||||
|
||||
def check_unicode(self, algorithm_name):
|
||||
# Unicode objects are not allowed as input.
|
||||
- expected = hashlib.new(algorithm_name, str(u'spam')).hexdigest()
|
||||
+ expected = hashlib.new(algorithm_name, str(u'spam'),
|
||||
+ usedforsecurity=False).hexdigest()
|
||||
self.check(algorithm_name, u'spam', expected)
|
||||
|
||||
def test_unicode(self):
|
||||
@@ -354,6 +335,70 @@ class HashLibTestCase(unittest.TestCase)
|
||||
self.assertEqual(expected_hash, hasher.hexdigest())
|
||||
|
||||
|
||||
+ def test_issue9146(self):
|
||||
+ # Ensure that various ways to use "MD5" from "hashlib" don't segfault:
|
||||
+ m = hashlib.md5(usedforsecurity=False)
|
||||
+ m.update(b'abc\n')
|
||||
+ self.assertEquals(m.hexdigest(), "0bee89b07a248e27c83fc3d5951213c1")
|
||||
+
|
||||
+ m = hashlib.new('md5', usedforsecurity=False)
|
||||
+ m.update(b'abc\n')
|
||||
+ self.assertEquals(m.hexdigest(), "0bee89b07a248e27c83fc3d5951213c1")
|
||||
+
|
||||
+ m = hashlib.md5(b'abc\n', usedforsecurity=False)
|
||||
+ self.assertEquals(m.hexdigest(), "0bee89b07a248e27c83fc3d5951213c1")
|
||||
+
|
||||
+ m = hashlib.new('md5', b'abc\n', usedforsecurity=False)
|
||||
+ self.assertEquals(m.hexdigest(), "0bee89b07a248e27c83fc3d5951213c1")
|
||||
+
|
||||
+ def assertRaisesUnknownCipher(self, callable_obj=None, *args, **kwargs):
|
||||
+ try:
|
||||
+ callable_obj(*args, **kwargs)
|
||||
+ except ValueError, e:
|
||||
+ if not e.args[0].endswith('unknown cipher'):
|
||||
+ self.fail('Incorrect exception raised')
|
||||
+ else:
|
||||
+ self.fail('Exception was not raised')
|
||||
+
|
||||
+ @unittest.skipUnless(OPENSSL_ENFORCES_FIPS,
|
||||
+ 'FIPS enforcement required for this test.')
|
||||
+ def test_hashlib_fips_mode(self):
|
||||
+ # Ensure that we raise a ValueError on vanilla attempts to use MD5
|
||||
+ # in hashlib in a FIPS-enforced setting:
|
||||
+ self.assertRaisesUnknownCipher(hashlib.md5)
|
||||
+ self.assertRaisesUnknownCipher(hashlib.new, 'md5')
|
||||
+
|
||||
+ @unittest.skipUnless(OPENSSL_ENFORCES_FIPS,
|
||||
+ 'FIPS enforcement required for this test.')
|
||||
+ def test_hashopenssl_fips_mode(self):
|
||||
+ # Verify the _hashlib module's handling of md5:
|
||||
+ import _hashlib
|
||||
+
|
||||
+ assert hasattr(_hashlib, 'openssl_md5')
|
||||
+
|
||||
+ # Ensure that _hashlib raises a ValueError on vanilla attempts to
|
||||
+ # use MD5 in a FIPS-enforced setting:
|
||||
+ self.assertRaisesUnknownCipher(_hashlib.openssl_md5)
|
||||
+ self.assertRaisesUnknownCipher(_hashlib.new, 'md5')
|
||||
+
|
||||
+ # Ensure that in such a setting we can whitelist a callsite with
|
||||
+ # usedforsecurity=False and have it succeed:
|
||||
+ m = _hashlib.openssl_md5(usedforsecurity=False)
|
||||
+ m.update('abc\n')
|
||||
+ self.assertEquals(m.hexdigest(), "0bee89b07a248e27c83fc3d5951213c1")
|
||||
+
|
||||
+ m = _hashlib.new('md5', usedforsecurity=False)
|
||||
+ m.update('abc\n')
|
||||
+ self.assertEquals(m.hexdigest(), "0bee89b07a248e27c83fc3d5951213c1")
|
||||
+
|
||||
+ m = _hashlib.openssl_md5('abc\n', usedforsecurity=False)
|
||||
+ self.assertEquals(m.hexdigest(), "0bee89b07a248e27c83fc3d5951213c1")
|
||||
+
|
||||
+ m = _hashlib.new('md5', 'abc\n', usedforsecurity=False)
|
||||
+ self.assertEquals(m.hexdigest(), "0bee89b07a248e27c83fc3d5951213c1")
|
||||
+
|
||||
+
|
||||
+
|
||||
class KDFTests(unittest.TestCase):
|
||||
pbkdf2_test_vectors = [
|
||||
(b'password', b'salt', 1, None),
|
||||
diff -up Python-2.7.2/Modules/Setup.dist.hashlib-fips Python-2.7.2/Modules/Setup.dist
|
||||
--- Python-2.7.2/Modules/Setup.dist.hashlib-fips 2011-09-14 00:21:26.163252001 -0400
|
||||
+++ Python-2.7.2/Modules/Setup.dist 2011-09-14 00:21:26.201252001 -0400
|
||||
@@ -248,14 +248,14 @@ imageop imageop.c # Operations on images
|
||||
# Message-Digest Algorithm, described in RFC 1321. The necessary files
|
||||
# md5.c and md5.h are included here.
|
||||
|
||||
-_md5 md5module.c md5.c
|
||||
+#_md5 md5module.c md5.c
|
||||
|
||||
|
||||
# The _sha module implements the SHA checksum algorithms.
|
||||
# (NIST's Secure Hash Algorithms.)
|
||||
-_sha shamodule.c
|
||||
-_sha256 sha256module.c
|
||||
-_sha512 sha512module.c
|
||||
+#_sha shamodule.c
|
||||
+#_sha256 sha256module.c
|
||||
+#_sha512 sha512module.c
|
||||
|
||||
|
||||
# SGI IRIX specific modules -- off by default.
|
||||
diff -up Python-2.7.2/setup.py.hashlib-fips Python-2.7.2/setup.py
|
||||
--- Python-2.7.2/setup.py.hashlib-fips 2011-09-14 00:21:25.722252001 -0400
|
||||
+++ Python-2.7.2/setup.py 2011-09-14 00:21:26.203252001 -0400
|
||||
@@ -768,21 +768,6 @@ class PyBuildExt(build_ext):
|
||||
print ("warning: openssl 0x%08x is too old for _hashlib" %
|
||||
openssl_ver)
|
||||
missing.append('_hashlib')
|
||||
- if COMPILED_WITH_PYDEBUG or not have_usable_openssl:
|
||||
- # The _sha module implements the SHA1 hash algorithm.
|
||||
- exts.append( Extension('_sha', ['shamodule.c']) )
|
||||
- # The _md5 module implements the RSA Data Security, Inc. MD5
|
||||
- # Message-Digest Algorithm, described in RFC 1321. The
|
||||
- # necessary files md5.c and md5.h are included here.
|
||||
- exts.append( Extension('_md5',
|
||||
- sources = ['md5module.c', 'md5.c'],
|
||||
- depends = ['md5.h']) )
|
||||
-
|
||||
- min_sha2_openssl_ver = 0x00908000
|
||||
- if COMPILED_WITH_PYDEBUG or openssl_ver < min_sha2_openssl_ver:
|
||||
- # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash
|
||||
- exts.append( Extension('_sha256', ['sha256module.c']) )
|
||||
- exts.append( Extension('_sha512', ['sha512module.c']) )
|
||||
|
||||
# Modules that provide persistent dictionary-like semantics. You will
|
||||
# probably want to arrange for at least one of them to be available on
|
||||
--- Python-2.7.8/Modules/_hashopenssl.c.orig 2014-06-30 04:05:41.000000000 +0200
|
||||
+++ Python-2.7.8/Modules/_hashopenssl.c 2014-07-14 14:21:59.546386572 +0200
|
||||
@@ -36,6 +36,8 @@
|
||||