From 074122cee89e143c839faad0251750309e2a2a6b0f52aa339748e52d14c987d9 Mon Sep 17 00:00:00 2001 From: Jan Matejek Date: Thu, 26 Aug 2010 13:45:58 +0000 Subject: [PATCH] - fixed distutils test OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python?expand=0&rev=75 --- python-2.6.5-distutils_test_path.patch | 31 ++++++++++++++++++++++---- python-base.changes | 5 +++++ python-base.spec | 8 +++++-- python.spec | 4 +++- 4 files changed, 41 insertions(+), 7 deletions(-) diff --git a/python-2.6.5-distutils_test_path.patch b/python-2.6.5-distutils_test_path.patch index 103cab0..a68a550 100644 --- a/python-2.6.5-distutils_test_path.patch +++ b/python-2.6.5-distutils_test_path.patch @@ -1,8 +1,8 @@ -Index: Python-2.6.5/Lib/distutils/tests/test_build_ext.py +Index: Python-2.7/Lib/distutils/tests/test_build_ext.py =================================================================== ---- Python-2.6.5.orig/Lib/distutils/tests/test_build_ext.py -+++ Python-2.6.5/Lib/distutils/tests/test_build_ext.py -@@ -253,20 +253,14 @@ class BuildExtTestCase(support.TempdirMa +--- Python-2.7.orig/Lib/distutils/tests/test_build_ext.py ++++ Python-2.7/Lib/distutils/tests/test_build_ext.py +@@ -261,20 +261,14 @@ class BuildExtTestCase(support.TempdirMa # issue #5977 : distutils build_ext.get_outputs # returns wrong result with --inplace @@ -27,3 +27,26 @@ Index: Python-2.6.5/Lib/distutils/tests/test_build_ext.py cmd.compiler = None cmd.inplace = 0 cmd.run() +Index: Python-2.7/Lib/test/regrtest.py +=================================================================== +--- Python-2.7.orig/Lib/test/regrtest.py ++++ Python-2.7/Lib/test/regrtest.py +@@ -1503,16 +1503,5 @@ if __name__ == '__main__': + if not os.path.exists(TEMPDIR): + os.mkdir(TEMPDIR) + +- # Define a writable temp dir that will be used as cwd while running +- # the tests. The name of the dir includes the pid to allow parallel +- # testing (see the -j option). +- TESTCWD = 'test_python_{}'.format(os.getpid()) +- +- TESTCWD = os.path.join(TEMPDIR, TESTCWD) +- +- # Run the tests in a context manager that temporary changes the CWD to a +- # temporary and writable directory. If it's not possible to create or +- # change the CWD, the original CWD will be used. The original CWD is +- # available from test_support.SAVEDCWD. +- with test_support.temp_cwd(TESTCWD, quiet=True): +- main() ++ # do not change directory, because it breaks distutils tests ++ main() diff --git a/python-base.changes b/python-base.changes index 6c30632..0d48d75 100644 --- a/python-base.changes +++ b/python-base.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Aug 26 13:45:19 UTC 2010 - jmatejek@novell.com + +- fixed distutils test + ------------------------------------------------------------------- Thu Aug 26 11:37:28 UTC 2010 - jmatejek@novell.com diff --git a/python-base.spec b/python-base.spec index 5e64931..c44947e 100644 --- a/python-base.spec +++ b/python-base.spec @@ -46,7 +46,8 @@ Patch3: Python-2.7rc2-multilib.patch Patch4: python-2.7rc2-canonicalize2.patch Patch5: python-2.7rc2-configure.patch Patch6: python-2.6-gettext-plurals.patch -Patch7: sparc_longdouble.patch +Patch7: python-2.6.5-distutils_test_path.patch +Patch8: sparc_longdouble.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %define python_version %(echo %{version} | head -c 3) @@ -133,6 +134,7 @@ Authors: %patch5 %patch6 %patch7 -p1 +%patch8 -p1 # some cleanup find . -name .cvsignore -type f -print0 | xargs -0 rm -f @@ -148,9 +150,11 @@ export SUSE_ASNEEDED=0 ######################################## export OPT="$RPM_OPT_FLAGS" ######################################## -# regenerate +# regenerate (only on > 11.2 because of autoconf version) ######################################## +%if %{?suse_version: %{suse_version} > 1120} %{!?suse_version:1} autoreconf -f -i . # Modules/_ctypes/libffi +%endif # prevent make from trying to rebuild asdl stuff, which requires existing # python installation touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h diff --git a/python.spec b/python.spec index 2ebe468..d9b67eb 100644 --- a/python.spec +++ b/python.spec @@ -198,9 +198,11 @@ export SUSE_ASNEEDED=0 ######################################## export OPT="$RPM_OPT_FLAGS" ######################################## -# regenerate +# regenerate (only on > 11.2 because of autoconf version) ######################################## +%if %{?suse_version: %{suse_version} > 1120} %{!?suse_version:1} autoreconf -f -i . # Modules/_ctypes/libffi +%endif # prevent make from trying to rebuild asdl stuff, which requires existing # python installation touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h