Hello community,
here is the log from the commit of package python.571 for openSUSE:12.1:Update checked in at 2012-07-02 12:11:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.1:Update/python.571 (Old)
and /work/SRC/openSUSE:12.1:Update/.python.571.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python.571", Maintainer is ""
Changes:
--------
New Changes file:
--- /dev/null 2012-06-28 07:48:42.835576985 +0200
+++ /work/SRC/openSUSE:12.1:Update/.python.571.new/python-base.changes 2012-07-02 12:11:57.000000000 +0200
@@ -0,0 +1,320 @@
+-------------------------------------------------------------------
+Tue Jun 19 14:50:11 UTC 2012 - jmatejek@suse.com
+
+- subpackages now require same version-release for python-base
+ (prevents bnc#766778 and other bugs of its class caused by
+ private APIs not being in sync)
+
+-------------------------------------------------------------------
+Wed Mar 28 17:10:00 UTC 2012 - jmatejek@suse.com
+
+- fix for XMLRPC Server DoS (CVE-2012-0845, bnc#747125)
+- fix for hash randomization issues (CVE-2012-1150, bnc#751718)
+- fix for insecure creation of .pypirc (CVE-2011-4944, bnc#754447)
+- fix SSL BEAST vulnerability (bnc#754677, CVE-2011-3389)
+
+-------------------------------------------------------------------
+Fri Jan 20 16:36:34 UTC 2012 - jmatejek@suse.com
+
+- change sys.platform to linux2 unconditionally (bnc#739304)
+ - this fix replaces previous linux3-compat patch
+
+-------------------------------------------------------------------
+Thu Jan 12 15:25:19 UTC 2012 - toddrme2178@gmail.com
+
+- Exclude /usr/bin/2to3 script to avoid conflicts with python3-2to3
+ (bnc#739536)
+
+-------------------------------------------------------------------
+Fri Sep 30 09:08:59 UTC 2011 - adrian@suse.de
+
+- fix build for arm by removing an old hack for arm, bz2.so is built now
+
+-------------------------------------------------------------------
+Fri Aug 19 22:37:42 CEST 2011 - dmueller@suse.de
+
+- update to 2.7.2:
+ * Bug fix only release, see
+ http://hg.python.org/cpython/raw-file/eb3c9b74884c/Misc/NEWS
+ for details
+- introduce a pre_checkin.sh file that synchronizes
+ patches between python and python-base
+- rediff patches for 2.7.2
+- replace kernel3 patch with the upstream solution
+
+-------------------------------------------------------------------
+Fri Jul 22 13:03:49 UTC 2011 - idonmez@novell.com
+
+- Copy Lib/plat-linux2 to Lix/plat-linux3 so that DLFCN module
+ is also available for linux3 systems bnc#707667
+
+-------------------------------------------------------------------
+Mon Jul 11 01:59:56 CEST 2011 - ro@suse.de
+
+- fix build on factory: setup reports linux3 not linux2 now,
+ adapt checks
+
+-------------------------------------------------------------------
+Tue May 31 17:58:30 UTC 2011 - jmatejek@novell.com
+
+- added explicit requires to libpython-%version-%release
+ to prevent bugs like bnc#697251 reappearing
+
+-------------------------------------------------------------------
+Tue May 24 14:27:05 UTC 2011 - jmatejek@novell.com
+
+- update to 2.7.1
+ * bugfix-only release, see NEWS for details
+- refreshed patches, dropped the upstreamed ones
+- dropped acrequire patch, replacing it with build-time sed
+- improved fix to bnc#673071 by defining the constants
+ only for files that require it (as is done in python3)
+
+-------------------------------------------------------------------
+Mon May 2 16:04:49 UTC 2011 - jmatejek@novell.com
+
+- fixed a security flaw where malicious sites could redirect
+ Python application from http to a local file
+ (CVE-2011-1521, bnc#682554)
+- fixed race condition in Makefile which randomly failed
+ parallel builds ( http://bugs.python.org/issue10013 )
+
+-------------------------------------------------------------------
+Thu Feb 17 17:37:09 CET 2011 - pth@suse.de
+
+- Prefix DATE and TIME with PY_BUILD_ and COMPILER with PYTHON_ as
+ to not break external code (bnc#673071).
+
+-------------------------------------------------------------------
+Mon Jan 17 09:42:20 UTC 2011 - coolo@novell.com
+
+- provide pyxml to avoid touching tons of packages
+
+-------------------------------------------------------------------
+Thu Nov 18 08:23:34 UTC 2010 - coolo@novell.com
+
+- add patch from http://psf.upfronthosting.co.za/roundup/tracker/issue9960
+ to fix build on ppc64
+
+-------------------------------------------------------------------
+Fri Oct 1 13:41:30 UTC 2010 - jmatejek@novell.com
+
+- moved unittest to python-base (it is a testing framework, not a
+ testsuite, so it clearly belongs into stdlib)
+- fixed smtpd.py DoS (bnc#638233, CVE probably not assigned)
+
+-------------------------------------------------------------------
+Tue Sep 21 10:07:43 UTC 2010 - coolo@novell.com
+
+- fix baselibs.conf
+
+-------------------------------------------------------------------
+Thu Aug 26 15:13:49 UTC 2010 - suse-tux@gmx.de
+
+- fix for urllib2 (http://bugs.python.org/issue9639)
+
+-------------------------------------------------------------------
+Thu Aug 26 13:45:19 UTC 2010 - jmatejek@novell.com
+
+- fixed distutils test
+- dropped autoconf version requirement (it builds just fine with other versions)
+
+-------------------------------------------------------------------
+Thu Aug 26 11:37:28 UTC 2010 - jmatejek@novell.com
+
+- update to version 2.7
+ * improved handling of numeric types
+ * deprecation warnings are now silent by default
+ * new argparse module for command line arguments
+ * many new features, see http://docs.python.org/dev/whatsnew/2.7.html
+ for complete list
+*** 2.7 is supposed to be the last version from the 2.x series,
+so its (upstream) maintenance period will probably be longer than usual.
+However, upstream development now focuses on 3.x series.
+
+- cleaned up spec and patches
+
+-------------------------------------------------------------------
+Fri Jul 2 13:58:38 UTC 2010 - jengelh@medozas.de
+
+- add patch from http://bugs.python.org/issue6029
+- use %_smp_mflags
+
+-------------------------------------------------------------------
+Mon May 17 17:07:33 CEST 2010 - matejcik@suse.cz
+
+- dropped audioop.so because of security vulnerabilities
+ (bnc#603255)
+
+-------------------------------------------------------------------
+Wed Apr 7 20:35:26 CEST 2010 - matejcik@suse.cz
+
+- update to 2.6.5 (rpm version 2.6.5)
+- patched test_distutils to work
+
+-------------------------------------------------------------------
+Thu Mar 11 18:13:05 CET 2010 - matejcik@suse.cz
+
+- update to 2.6.5rc2 (rpm version is 2.6.4.92)
+ * bugfix-only release
+- removed fwrapv patch - no longer needed
+- removed expat patches (this version also fixes expat vulnerabilities
+ from bnc#581765 )
+- removed readline spacing patch - no longer needed
+- removed https_proxy patch - no longer needed
+- removed test_distutils patch - no longer needed
+- disabled test_distutils because of spurious failure,
+ * TODO reenable at release
+
+-------------------------------------------------------------------
+Thu Feb 4 20:46:03 CET 2010 - matejcik@suse.cz
+
+- removed precompiled exe files (as noted in bnc#577032)
+
+-------------------------------------------------------------------
+Fri Jan 29 15:44:15 CET 2010 - matejcik@suse.cz
+
+- enabled ipv6 in configure (bnc#572673)
+
+-------------------------------------------------------------------
+Wed Dec 23 08:36:29 UTC 2009 - aj@suse.de
+
+- Apply patches with fuzz=0
+
+-------------------------------------------------------------------
+Tue Dec 15 00:22:44 CET 2009 - jengelh@medozas.de
+
+- add baselibs.conf as source
+
+-------------------------------------------------------------------
+Wed Oct 28 18:03:27 UTC 2009 - crrodriguez@opensuse.org
+
+- python-devel Requires glibc-devel
+
+-------------------------------------------------------------------
+Fri Sep 4 20:16:42 CEST 2009 - matejcik@suse.cz
+
+- fixed potential DoS in python's copy of expat (bnc#534721)
++++ 123 more lines (skipped)
++++ between /dev/null
++++ and /work/SRC/openSUSE:12.1:Update/.python.571.new/python-base.changes
New Changes file:
--- /dev/null 2012-06-28 07:48:42.835576985 +0200
+++ /work/SRC/openSUSE:12.1:Update/.python.571.new/python-doc.changes 2012-07-02 12:11:57.000000000 +0200
@@ -0,0 +1,77 @@
+-------------------------------------------------------------------
+Tue May 24 14:30:36 UTC 2011 - jmatejek@novell.com
+
+- updated to build against 2.7.1
+
+-------------------------------------------------------------------
+Thu Aug 26 11:43:28 UTC 2010 - jmatejek@novell.com
+
+- updated to 2.7
+
+-------------------------------------------------------------------
+Thu Mar 11 19:19:07 CET 2010 - matejcik@suse.cz
+
+- updated to build against 2.6.5 source
+
+-------------------------------------------------------------------
+Wed Dec 23 08:36:27 UTC 2009 - aj@suse.de
+
+- Apply patches with fuzz=0
+
+-------------------------------------------------------------------
+Mon Apr 27 15:21:03 CEST 2009 - matejcik@suse.cz
+
+- update to build against 2.6.2 source
+
+-------------------------------------------------------------------
+Wed Mar 11 10:52:59 CET 2009 - coolo@suse.de
+
+- fix build in actually packaging the docs
+
+-------------------------------------------------------------------
+Thu Oct 9 18:58:15 CEST 2008 - matejcik@suse.cz
+
+- updated docs to version 2.6
+
+-------------------------------------------------------------------
+Mon Sep 15 18:34:58 CEST 2008 - matejcik@suse.cz
+
+- updated to build against 2.6rc1
+
+-------------------------------------------------------------------
+Wed Jun 25 21:55:18 CEST 2008 - matejcik@suse.cz
+
+- updated to build against 2.6b1
+- will update the docs when 2.6 final is out
+
+-------------------------------------------------------------------
+Thu May 24 18:51:37 CEST 2007 - jmatejek@suse.cz
+
+- updated to version 2.5.1
+
+-------------------------------------------------------------------
+Tue Sep 19 18:30:50 CEST 2006 - jmatejek@suse.cz
+
+- updated to version 2.5 final, going into STABLE dist
+
+-------------------------------------------------------------------
+Wed Sep 13 19:11:36 CEST 2006 - jmatejek@suse.cz
+
+- updated to build against 2.5c2
+
+-------------------------------------------------------------------
+Tue Sep 5 14:01:05 CEST 2006 - jmatejek@suse.cz
+
+- updated to build against 2.5c1
+- will actually update the docs as soon as this goes into STABLE
+
+-------------------------------------------------------------------
+Mon Apr 24 20:08:41 CEST 2006 - jmatejek@suse.cz
+
+- update to 2.4.3
+
+-------------------------------------------------------------------
+Tue Mar 21 18:11:38 CET 2006 - jmatejek@suse.cz
+
+- created separate noarch specfile
+
New Changes file:
--- /dev/null 2012-06-28 07:48:42.835576985 +0200
+++ /work/SRC/openSUSE:12.1:Update/.python.571.new/python.changes 2012-07-02 12:11:57.000000000 +0200
@@ -0,0 +1,1310 @@
+-------------------------------------------------------------------
+Fri Jan 20 16:36:34 UTC 2012 - jmatejek@suse.com
+
+- change sys.platform to linux2 unconditionally (bnc#739304)
+ - this fix replaces previous linux3-compat patch
+
+-------------------------------------------------------------------
+Fri Sep 16 16:21:44 UTC 2011 - jmatejek@suse.com
+
+- dropped newslist.py from demos because of bad license
+ (bnc#718009)
+
+-------------------------------------------------------------------
+Mon Jul 11 01:59:56 CEST 2011 - ro@suse.de
+
+- update to 2.7.2:
+ * Bug fix only release, see
+ http://hg.python.org/cpython/raw-file/eb3c9b74884c/Misc/NEWS
+ for details
+- introduce a pre_checkin.sh file that synchronizes
+ patches between python and python-base
+- rediff patches for 2.7.2
+- replace kernel3 patch with the upstream solution
+
+-------------------------------------------------------------------
+Tue May 24 14:30:10 UTC 2011 - jmatejek@novell.com
+
+- updated to 2.7.1
+ * bugfix-only release
+
+-------------------------------------------------------------------
+Wed May 4 14:18:08 UTC 2011 - jmatejek@novell.com
+
+- added "fix-parallel-make" patch to python main package as well,
+ because build process is the same
+
+-------------------------------------------------------------------
+Thu Feb 17 17:37:09 CET 2011 - pth@suse.de
+
+- Prefix DATE and TIME with PY_BUILD_ and COMPILER with PYTHON_ as
+ to not break external code (bnc#673071).
+
+-------------------------------------------------------------------
+Tue Aug 31 02:51:56 UTC 2010 - cristian.rodriguez@opensuse.org
+
+- Provide "fake" build enviroment information
+* build date replaced by source tarball modify date
+* compiler string replaced by "GCC"
+* This is intended to avoid republishing the packages
+ over and over again.
+
+-------------------------------------------------------------------
+Thu Aug 26 11:42:44 UTC 2010 - jmatejek@novell.com
+
+- update to 2.7
+ * see changes in python-base.changes
+- cleaned up the spec and patches
+
+-------------------------------------------------------------------
+Fri Jul 2 13:57:02 UTC 2010 - jengelh@medozas.de
+
+- add patch from http://bugs.python.org/issue6029
+- use %_smp_mflags
+
+-------------------------------------------------------------------
+Wed Apr 7 20:36:11 CEST 2010 - matejcik@suse.cz
+
+- update to 2.6.5
+
+-------------------------------------------------------------------
+Wed Feb 3 16:07:54 UTC 2010 - jengelh@medozas.de
+
+- exclude dl.so from SPARC64 (not built like on x86_64)
+
+-------------------------------------------------------------------
+Fri Jan 29 15:44:28 CET 2010 - matejcik@suse.cz
+
+- enabled ipv6 in configure (bnc#572673)
+
+-------------------------------------------------------------------
+Wed Dec 23 08:36:32 UTC 2009 - aj@suse.de
+
+- Apply patches with fuzz=0
+
+-------------------------------------------------------------------
+Wed Dec 2 18:40:21 UTC 2009 - coolo@novell.com
+
+- update patch again
+
+-------------------------------------------------------------------
+Wed Nov 4 19:04:16 CET 2009 - matejcik@suse.cz
+
+- readline shouldn't append space after completion (bnc#551715,
+ python bug 5833)
+
+-------------------------------------------------------------------
+Tue Nov 3 19:13:42 UTC 2009 - coolo@novell.com
+
+- updated patches to apply with fuzz=0
+
+-------------------------------------------------------------------
+Tue Sep 8 16:11:33 CEST 2009 - max@suse.de
+
+- removed blt from BuildRequires so that it can be dropped.
+
+-------------------------------------------------------------------
+Fri Sep 4 20:15:43 CEST 2009 - matejcik@suse.cz
+
+- added patch for potential SSL hangup during handshake (bnc#525295)
+
+-------------------------------------------------------------------
+Wed Jul 29 17:25:33 CEST 2009 - matejcik@suse.cz
+
+- renamed multilib patch to reflect the changes
+
+-------------------------------------------------------------------
+Thu Jul 16 10:11:27 CEST 2009 - coolo@novell.com
+
+- disable as-needed to fix build
+
+-------------------------------------------------------------------
+Mon Apr 27 15:19:45 CEST 2009 - matejcik@suse.cz
+
+- update to 2.6.2
+ * bugfix-only release for 2.6 series
+
+-------------------------------------------------------------------
+Wed Jan 7 12:34:56 CET 2009 - olh@suse.de
+
+- obsolete old -XXbit packages (bnc#437293)
+
+-------------------------------------------------------------------
+Mon Dec 15 17:10:17 CET 2008 - matejcik@suse.cz
+
+- reenabled bsddb module, so that dependent packages can build
+ ( bnc#441088 )
+
+-------------------------------------------------------------------
+Thu Oct 9 18:57:43 CEST 2008 - matejcik@suse.cz
+
+- update to 2.6 (version name is 2.6.0 to prevent upgrade problems)
+- don't run the whole test suite, only run tests for
+ newly built modules
+- provide %name = 2.6
+
+-------------------------------------------------------------------
+Fri Sep 19 20:10:33 CEST 2008 - matejcik@suse.cz
+
+- moved testsuite to %check section
+- update to 2.6rc2, removing the last remaining security patch
+- included fix for socket.ssl() behavior regression, fixing
+ bnc#426563
+
+-------------------------------------------------------------------
+Tue Sep 16 18:09:49 CEST 2008 - matejcik@suse.cz
+
+- moved python-xml to subpackage of python-base
+- moved dbm.so to gdbm subpackage
+- moved ssl.py and sqlite3 module to this
+
+-------------------------------------------------------------------
+Mon Sep 15 18:34:06 CEST 2008 - matejcik@suse.cz
+
+- update to 2.6rc1 - bugfix-only pre-stable release
+
+-------------------------------------------------------------------
+Fri Sep 12 14:44:55 CEST 2008 - matejcik@suse.cz
+
+- split package, as per fate#305065
+- moved python-devel to be a subpackage of python-base
+- minor fixes & packaging cleanups
+
+-------------------------------------------------------------------
+Wed Sep 10 16:31:29 CEST 2008 - matejcik@suse.cz
+
+- fixed misapplied ssl-compat patch (caused segfaults when
+ opening SSL connections, bnc#425138 )
+
+-------------------------------------------------------------------
+Wed Sep 3 17:17:06 CEST 2008 - matejcik@suse.cz
+
+- updated to 2.6beta3 from BETA dist, summary of changes follows:
+ * patches update/cleanup
+ * removed failing tests (test_unicode, test_urllib2), those will
+ be reworked later to not fail
+ * fixed ncurses/panel.h include
+ * removed most security fixes, as they are already included in
+ this version
+ * removed imageop/rgbimg
+ (reasons: they only work in 32bit environment anyway, are
+ deprecated by upstream and have inherent security problems)
+ * fixed pythonstart script to trim history after 10000 lines
+ (bnc#399190)
+- 2.6beta3 is mostly stable release of the 2.6 series,
+ package will be updated to 2.6 final as soon as it comes out
+ (in the beginning of October)
+
++++ 1113 more lines (skipped)
++++ between /dev/null
++++ and /work/SRC/openSUSE:12.1:Update/.python.571.new/python.changes
New:
----
Python-2.7.2.tar.bz2
README.SUSE
_local.pth
baselibs.conf
distutils.cfg
macros.python
pre_checkin.sh
pypirc-secure.diff
python-2.5.1-sqlite.patch
python-2.6-gettext-plurals.patch
python-2.6b3-curses-panel.patch
python-2.7-CVE-2011-3389-ssl-compat.patch
python-2.7-CVE-2012-0845-xmlrpc-DoS.patch
python-2.7-CVE-2012-1150-hash-randomization.patch
python-2.7-dirs.patch
python-2.7-docs-html.tar.bz2
python-2.7-docs-pdf-a4.tar.bz2
python-2.7-docs-pdf-letter.tar.bz2
python-2.7-expat-hash-randomization.patch
python-2.7.1-distutils_test_path.patch
python-2.7.1-urllib-noproxy.patch
python-2.7.2-fix_date_time_compiler.patch
python-2.7.2-linux3-linux2.patch
python-2.7.2-multilib.patch
python-2.7rc2-canonicalize2.patch
python-2.7rc2-configure.patch
python-base.changes
python-base.spec
python-distutils-rpm-8.patch
python-doc.changes
python-doc.spec
python-test_structmembers.patch
python.changes
python.csh
python.sh
python.spec
pythonstart
sparc_longdouble.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-base.spec ++++++
#
# spec file for package python-base
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python-base
BuildRequires: fdupes
BuildRequires: pkg-config
BuildRequires: zlib-devel
Url: http://www.python.org/
# bug437293
%ifarch ppc64
Obsoletes: python-64bit
%endif
#
Summary: Python Interpreter base package
License: MIT
Group: Development/Languages/Python
Version: 2.7.2
Release: 0
%define tarversion %{version}
%define tarname Python-%{tarversion}
Source0: %{tarname}.tar.bz2
Source1: macros.python
Source2: baselibs.conf
Source3: README.SUSE
Source4: distutils.cfg
Source5: _local.pth
# COMMON-PATCH-BEGIN
Patch1: python-2.7-dirs.patch
Patch2: python-distutils-rpm-8.patch
Patch3: python-2.7.2-multilib.patch
Patch4: python-2.5.1-sqlite.patch
Patch5: python-2.7rc2-canonicalize2.patch
Patch6: python-2.7rc2-configure.patch
Patch7: python-2.6-gettext-plurals.patch
Patch8: python-2.6b3-curses-panel.patch
Patch9: python-2.7.1-distutils_test_path.patch
Patch10: sparc_longdouble.patch
Patch11: python-2.7.2-linux3-linux2.patch
Patch12: http://psf.upfronthosting.co.za/roundup/tracker/file19029/python-test_struct...
Patch13: python-2.7.2-fix_date_time_compiler.patch
Patch14: python-2.7.1-urllib-noproxy.patch
Patch15: python-2.7-CVE-2012-0845-xmlrpc-DoS.patch
Patch16: python-2.7-CVE-2012-1150-hash-randomization.patch
Patch17: python-2.7-expat-hash-randomization.patch
Patch18: pypirc-secure.diff
Patch19: python-2.7-CVE-2011-3389-ssl-compat.patch
# COMMON-PATCH-END
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define python_version %(echo %{version} | head -c 3)
Provides: %{name} = %{python_version}
# explicitly, see bnc#697251
Requires: libpython2_7-1_0 = %{version}-%{release}
%description
Python is an interpreted, object-oriented programming language, and is
often compared to Tcl, Perl, Scheme, or Java. You can find an overview
of Python in the documentation and tutorials included in the python-doc
(HTML) or python-doc-pdf (PDF) packages.
This package contains all of stand-alone Python files, minus binary
modules that would pull in extra dependencies.
Authors:
--------
Guido van Rossum
%package -n python-devel
Requires: glibc-devel
Requires: python-base = %{version}-%{release}
Summary: Include Files and Libraries Mandatory for Building Python Modules
License: Python-2.0
Group: Development/Languages/Python
%description -n python-devel
The Python programming language's interpreter can be extended with
dynamically loaded extensions and can be embedded in other programs.
This package contains header files, a static library, and development
tools for building Python modules, extending the Python interpreter or
embedding Python in applications.
Authors:
--------
Guido van Rossum
%package -n python-xml
Requires: python-base = %{version}-%{release}
Summary: A Python XML Interface
License: Python-2.0
Group: Development/Libraries/Python
# pyxml used to live out of tree
Provides: pyxml = 0.8.5
Obsoletes: pyxml < 0.8.5
%description -n python-xml
The expat module is a Python interface to the expat XML parser. Since
Python2.x, it is part of the core Python distribution.
%package -n libpython2_7-1_0
Summary: Python Interpreter shared library
License: MIT
Group: Development/Languages/Python
#%description -n libpython%{lib_version}
%description -n libpython2_7-1_0
Python is an interpreted, object-oriented programming language, and is
often compared to Tcl, Perl, Scheme, or Java. You can find an overview
of Python in the documentation and tutorials included in the python-doc
(HTML) or python-doc-pdf (PDF) packages.
This package contains libpython2.6 shared library for embedding in
other applications.
Authors:
--------
Guido van Rossum
%prep
%setup -q -n %{tarname}
# patching
# COMMON-PREP-BEGIN
%patch1 -p1
%patch2 -p1
%patch3
%patch4
%patch5
%patch6
%patch7
%patch8
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12
%patch13
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
# COMMON-PREP-END
# drop Autoconf version requirement
sed -i 's/^version_required/dnl version_required/' configure.in
%build
export OPT="$RPM_OPT_FLAGS"
autoreconf -f -i . # Modules/_ctypes/libffi
# provide a stable timestamp
touch -r %{S:0} Makefile.pre.in
# prevent make from trying to rebuild asdl stuff, which requires existing
# python installation
touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h
./configure \
--prefix=%{_prefix} \
--libdir=%{_libdir} \
--mandir=%{_mandir} \
--docdir=%{_docdir}/python \
--with-fpectl \
--enable-ipv6 \
--enable-shared \
--enable-unicode=ucs4
LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH \
make %{?_smp_mflags} \
DESTDIR=$RPM_BUILD_ROOT \
profile-opt
%check
# on hppa, the threading of glibc is quite broken. The tests just stop
# at some point, and the machine does not build anything more until a
# timeout several hours later.
%ifnarch hppa %arm
# test_file(2k) fails in autobuild env - "stdin.seek(-1)" wrongly succeeds. probably an issue with autobuild's stdin
# test_urllib2 relies on being able to resolve local address, which is notoriously impossible in autobuild
EXCLUDE="-x test_urllib2 -x test_file -x test_file2k"
# test_nis and test_threading are AWFULLY slow.
EXCLUDE="$EXCLUDE -x test_nis -x test_threading"
# test_gdb fails if gdb with (different) python support is part of the buildsystem
EXCLUDE="$EXCLUDE -x test_gdb"
%ifarch ia64
# test_smtplib's testSend is known to be broken and on ia64 it actually fails most of the time, preventing the build.
EXCLUDE="$EXCLUDE -x test_smtplib"
%endif
# test_subprocess and test_unittest and test_threaded_import fail in Factory
EXCLUDE="$EXCLUDE -x test_subprocess -x test_unittest -xtest_threaded_import"
# Limit virtual memory to avoid spurious failures
if test $(ulimit -v) = unlimited || test $(ulimit -v) -gt 10000000; then
ulimit -v 10000000 || :
fi
make test TESTOPTS="-l $EXCLUDE" TESTPYTHONOPTS="-R"
# use network, be verbose:
#make test TESTOPTS="-l -u network -v"
%endif
%install
# replace rest of /usr/local/bin/python or /usr/bin/python2.5 with /usr/bin/python
find . -wholename "./Parser" -prune -o -name '*.py' -type f -print0 | xargs -0 grep -lE '^#! *(/usr/.*bin/(env +)?)?python' | xargs sed -r -i -e '1s@^#![[:space:]]*(/usr/(local/)?bin/(env +)?)?python([0-9]+\.[0-9]+)?@#!/usr/bin/python@'
# the grep inbetween makes it much faster
########################################
# install it
########################################
make \
OPT="$RPM_OPT_FLAGS -fPIC" \
DESTDIR=$RPM_BUILD_ROOT \
install
# install site-specific tweaks
ln -s python%{python_version} ${RPM_BUILD_ROOT}%{_bindir}/python2
install -m 644 %{S:4} ${RPM_BUILD_ROOT}%{_libdir}/python%{python_version}/distutils
install -m 644 %{S:5} ${RPM_BUILD_ROOT}%{_libdir}/python%{python_version}/site-packages
install -d -m 755 ${RPM_BUILD_ROOT}/etc/rpm
install -m 644 %{S:1} ${RPM_BUILD_ROOT}/etc/rpm
# make sure /usr/lib/python/site-packages exists even on lib64 machines
mkdir -p ${RPM_BUILD_ROOT}/usr/lib/python%{python_version}/site-packages
########################################
# some cleanups
########################################
# remove hard links and replace them with symlinks
for dir in bin include %{_lib} ; do
rm -f $RPM_BUILD_ROOT/%{_prefix}/$dir/python
ln -s python%{python_version} $RPM_BUILD_ROOT/%{_prefix}/$dir/python
done
CLEANUP_DIR="$RPM_BUILD_ROOT%{_libdir}/python%{python_version}"
# don't distribute precompiled windows installers (duh)
rm -f $CLEANUP_DIR/distutils/command/*.exe
# kill imageop.so and audioop.so, they are rarely used and insecure
rm -f $CLEANUP_DIR/lib-dynload/imageop.so
rm -f $CLEANUP_DIR/lib-dynload/audioop.so
# remove various things that don't need to be in python-base
rm $RPM_BUILD_ROOT%{_bindir}/idle
rm -rf $CLEANUP_DIR/{curses,bsddb,idlelib,lib-tk,sqlite3}
rm $CLEANUP_DIR/ssl.py*
# does not work without _ssl.so anyway
# replace duplicate .pyo/.pyc with hardlinks
%fdupes $RPM_BUILD_ROOT/%{_libdir}/python%{python_version}
########################################
# documentation
########################################
export PDOCS=${RPM_BUILD_ROOT}%{_docdir}/%{name}
install -d -m 755 $PDOCS
install -c -m 644 %{S:3} $PDOCS/
install -c -m 644 LICENSE $PDOCS/
install -c -m 644 README $PDOCS/
ln -s python%{python_version}.1.gz ${RPM_BUILD_ROOT}%{_mandir}/man1/python.1.gz
########################################
# devel
########################################
# install Makefile.pre.in and Makefile.pre
cp Makefile Makefile.pre.in Makefile.pre $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/config/
%clean
rm -rf $RPM_BUILD_ROOT
#%post -n libpython%{lib_version}
%post -n libpython2_7-1_0
%{run_ldconfig}
#%postun -n libpython%{lib_version}
%postun -n libpython2_7-1_0
%{run_ldconfig}
%files -n python-devel
%defattr(-, root, root)
%{_libdir}/python%{python_version}/config/*
%exclude %{_libdir}/python%{python_version}/config/Setup
%exclude %{_libdir}/python%{python_version}/config/Makefile
%defattr(644, root, root, 755)
%{_libdir}/libpython*.so
%{_libdir}/pkgconfig/python-%{python_version}.pc
%{_libdir}/pkgconfig/python.pc
%{_includedir}/python*
%exclude %{_includedir}/python%{python_version}/pyconfig.h
%{_libdir}/python%{python_version}/test
%defattr(755, root, root)
%{_bindir}/python-config
%{_bindir}/python%{python_version}-config
%files -n python-xml
%defattr(644, root, root, 755)
%{_libdir}/python%{python_version}/xml
%{_libdir}/python%{python_version}/lib-dynload/pyexpat.so
#%files -n libpython%{lib_version}
%files -n libpython2_7-1_0
%defattr(644, root, root)
%{_libdir}/libpython*.so.*
%files
%defattr(644, root, root, 755)
%config /etc/rpm/macros.python
%dir %{_docdir}/%{name}
%doc %{_docdir}/%{name}/README
%doc %{_docdir}/%{name}/LICENSE
%doc %{_docdir}/%{name}/README.SUSE
%doc %{_mandir}/man1/python.1*
%doc %{_mandir}/man1/python%{python_version}.1*
%dir %{_includedir}/python%{python_version}
%{_includedir}/python%{python_version}/pyconfig.h
%{_libdir}/python
%dir /usr/lib/python%{python_version}
%dir /usr/lib/python%{python_version}/site-packages
%dir %{_libdir}/python%{python_version}
%dir %{_libdir}/python%{python_version}/config
%{_libdir}/python%{python_version}/config/Setup
%{_libdir}/python%{python_version}/config/Makefile
%{_libdir}/python%{python_version}/*.*
%{_libdir}/python%{python_version}/compiler
%{_libdir}/python%{python_version}/ctypes
%{_libdir}/python%{python_version}/distutils
%{_libdir}/python%{python_version}/email
%{_libdir}/python%{python_version}/encodings
%{_libdir}/python%{python_version}/hotshot
%{_libdir}/python%{python_version}/importlib
%{_libdir}/python%{python_version}/json
%{_libdir}/python%{python_version}/lib2to3
%{_libdir}/python%{python_version}/logging
%{_libdir}/python%{python_version}/multiprocessing
%{_libdir}/python%{python_version}/plat-*
%{_libdir}/python%{python_version}/pydoc_data
%{_libdir}/python%{python_version}/unittest
%{_libdir}/python%{python_version}/wsgiref
%dir %{_libdir}/python%{python_version}/site-packages
%{_libdir}/python%{python_version}/site-packages/README
%{_libdir}/python%{python_version}/site-packages/_local.pth
%dir %{_libdir}/python%{python_version}/lib-dynload
%{_libdir}/python%{python_version}/lib-dynload/_bisect.so
#%{_libdir}/python%{python_version}/lib-dynload/_bytesio.so
%{_libdir}/python%{python_version}/lib-dynload/_csv.so
%{_libdir}/python%{python_version}/lib-dynload/_collections.so
%{_libdir}/python%{python_version}/lib-dynload/_ctypes.so
%{_libdir}/python%{python_version}/lib-dynload/_ctypes_test.so
%{_libdir}/python%{python_version}/lib-dynload/_elementtree.so
#%{_libdir}/python%{python_version}/lib-dynload/_fileio.so
%{_libdir}/python%{python_version}/lib-dynload/_functools.so
%{_libdir}/python%{python_version}/lib-dynload/_heapq.so
%{_libdir}/python%{python_version}/lib-dynload/_hotshot.so
%{_libdir}/python%{python_version}/lib-dynload/_io.so
%{_libdir}/python%{python_version}/lib-dynload/_json.so
%{_libdir}/python%{python_version}/lib-dynload/_locale.so
%{_libdir}/python%{python_version}/lib-dynload/_lsprof.so
%{_libdir}/python%{python_version}/lib-dynload/_md5.so
%{_libdir}/python%{python_version}/lib-dynload/_multiprocessing.so
%{_libdir}/python%{python_version}/lib-dynload/_random.so
%{_libdir}/python%{python_version}/lib-dynload/_sha.so
%{_libdir}/python%{python_version}/lib-dynload/_sha256.so
%{_libdir}/python%{python_version}/lib-dynload/_sha512.so
%{_libdir}/python%{python_version}/lib-dynload/_socket.so
%{_libdir}/python%{python_version}/lib-dynload/_struct.so
%{_libdir}/python%{python_version}/lib-dynload/_testcapi.so
%{_libdir}/python%{python_version}/lib-dynload/array.so
%{_libdir}/python%{python_version}/lib-dynload/binascii.so
%{_libdir}/python%{python_version}/lib-dynload/bz2.so
%{_libdir}/python%{python_version}/lib-dynload/cPickle.so
%{_libdir}/python%{python_version}/lib-dynload/cStringIO.so
%{_libdir}/python%{python_version}/lib-dynload/cmath.so
%{_libdir}/python%{python_version}/lib-dynload/crypt.so
%{_libdir}/python%{python_version}/lib-dynload/datetime.so
%{_libdir}/python%{python_version}/lib-dynload/fcntl.so
%{_libdir}/python%{python_version}/lib-dynload/future_builtins.so
%{_libdir}/python%{python_version}/lib-dynload/grp.so
%{_libdir}/python%{python_version}/lib-dynload/itertools.so
%{_libdir}/python%{python_version}/lib-dynload/linuxaudiodev.so
%{_libdir}/python%{python_version}/lib-dynload/math.so
%{_libdir}/python%{python_version}/lib-dynload/mmap.so
%{_libdir}/python%{python_version}/lib-dynload/nis.so
%{_libdir}/python%{python_version}/lib-dynload/operator.so
%{_libdir}/python%{python_version}/lib-dynload/ossaudiodev.so
%{_libdir}/python%{python_version}/lib-dynload/parser.so
%{_libdir}/python%{python_version}/lib-dynload/resource.so
%{_libdir}/python%{python_version}/lib-dynload/select.so
%{_libdir}/python%{python_version}/lib-dynload/spwd.so
%{_libdir}/python%{python_version}/lib-dynload/strop.so
%{_libdir}/python%{python_version}/lib-dynload/syslog.so
%{_libdir}/python%{python_version}/lib-dynload/termios.so
%{_libdir}/python%{python_version}/lib-dynload/time.so
%{_libdir}/python%{python_version}/lib-dynload/unicodedata.so
%{_libdir}/python%{python_version}/lib-dynload/zlib.so
%{_libdir}/python%{python_version}/lib-dynload/_codecs*.so
%{_libdir}/python%{python_version}/lib-dynload/_multibytecodec.so
%{_libdir}/python%{python_version}/lib-dynload/Python-%{tarversion}-py%{python_version}.egg-info
# these modules don't support 64-bit arches (disabled by setup.py)
%ifnarch alpha ia64 x86_64 s390x ppc64 sparc64
# requires sizeof(int) == sizeof(long) == sizeof(char*)
%{_libdir}/python%{python_version}/lib-dynload/dl.so
%endif
%attr(755, root, root) %{_bindir}/pydoc
%attr(755, root, root) %{_bindir}/python
%attr(755, root, root) %{_bindir}/python%{python_version}
%attr(755, root, root) %{_bindir}/smtpd.py
%exclude %{_bindir}/2to3
%{_bindir}/python2
%changelog
++++++ python-doc.spec ++++++
#
# spec file for package python-doc
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python-doc
Url: http://www.python.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Summary: Additional Package Documentation for Python.
License: Python-2.0
Group: Development/Languages/Python
Version: 2.7
Release: 0
%define pyver 2.7.2
BuildArch: noarch
%define tarname Python-%{pyver}
%define pyname python
Enhances: %{pyname}=%{pyver}
Source0: %{tarname}.tar.bz2
Source1: python-%{version}-docs-html.tar.bz2
Source2: python-%{version}-docs-pdf-a4.tar.bz2
Source3: python-%{version}-docs-pdf-letter.tar.bz2
Provides: pyth_doc
Provides: pyth_ps
Obsoletes: pyth_doc
Obsoletes: pyth_ps
%description
Tutorial, Global Module Index, Language Reference, Library Reference,
Extending and Embedding Reference, Python/C API Reference, Documenting
Python, and Macintosh Module Reference in HTML format.
%package pdf
Provides: pyth_pdf
Obsoletes: pyth_pdf
Summary: Python PDF Documentation
Group: Development/Languages/Python
%description pdf
Tutorial, Global Module Index, Language Reference, Library Reference,
Extending and Embedding Reference, Python/C API Reference, Documenting
Python, and Macintosh Module Reference in PDF format.
Authors:
--------
Guido van Rossum
%prep
%setup -q -n %{tarname}
%build
# nothing to do (...whistles innocently)
%install
export PDOCS=${RPM_BUILD_ROOT}%{_docdir}/%{pyname}
install -d -m 755 $PDOCS/Misc
install -d -m 755 $PDOCS/paper-a4 $PDOCS/paper-letter $PDOCS/html
tar xfj %{S:1} -C $PDOCS/
mv $PDOCS/python-%{version}-docs-html $PDOCS/html
tar xfj %{S:2} -C $PDOCS
mv $PDOCS/docs-pdf $PDOCS/paper-a4
tar xfj %{S:3} -C $PDOCS
mv $PDOCS/docs-pdf $PDOCS/paper-letter
install -c -m 644 Doc/ACKS.txt $PDOCS/ACKS.txt
install -c -m 644 README $PDOCS/README
for i in Misc/* ; do
[ -f $i ] && install -c -m 644 $i $PDOCS/Misc/
done
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644, root, root, 755)
%dir %{_docdir}/%{pyname}
%doc %{_docdir}/%{pyname}/Misc
%doc %{_docdir}/%{pyname}/html
%doc %{_docdir}/%{pyname}/ACKS.txt
%doc %{_docdir}/%{pyname}/README
%files pdf
%defattr(644, root, root, 755)
%doc %{_docdir}/%{pyname}/paper-a4
%doc %{_docdir}/%{pyname}/paper-letter
%changelog
++++++ python.spec ++++++
#
# spec file for package python
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python
BuildRequires: db-devel
BuildRequires: fdupes
BuildRequires: gdbm-devel
BuildRequires: gmp-devel
BuildRequires: libbz2-devel
BuildRequires: libopenssl-devel
BuildRequires: ncurses-devel
BuildRequires: readline-devel
BuildRequires: sqlite-devel
BuildRequires: tk-devel
BuildRequires: xorg-x11-devel
#Requires: openssl >= 0.9.8e
Url: http://www.python.org/
# bug437293
%ifarch ppc64
Obsoletes: python-64bit
%endif
#
Obsoletes: python-elementtree
Obsoletes: python-nothreads
Obsoletes: python-sqlite
Obsoletes: python21
Summary: Python Interpreter
License: MIT
Group: Development/Languages/Python
Version: 2.7.2
Release: 0
Requires: python-base = %{version}-%{release}
%define tarversion %{version}
%define tarname Python-%{tarversion}
Source0: %{tarname}.tar.bz2
Source1: README.SUSE
Source2: pythonstart
Source3: python.sh
Source4: python.csh
#Source11: testfiles.tar.bz2
# issues with copyrighted Unicode testing files
# !!!!!!!!!!!!!!
# do not add or edit patches here. please edit python-base.spec
# instead and run pre_checkin.sh
# !!!!!!!!!!!!!!
# COMMON-PATCH-BEGIN
Patch1: python-2.7-dirs.patch
Patch2: python-distutils-rpm-8.patch
Patch3: python-2.7.2-multilib.patch
Patch4: python-2.5.1-sqlite.patch
Patch5: python-2.7rc2-canonicalize2.patch
Patch6: python-2.7rc2-configure.patch
Patch7: python-2.6-gettext-plurals.patch
Patch8: python-2.6b3-curses-panel.patch
Patch9: python-2.7.1-distutils_test_path.patch
Patch10: sparc_longdouble.patch
Patch11: python-2.7.2-linux3-linux2.patch
Patch12: http://psf.upfronthosting.co.za/roundup/tracker/file19029/python-test_struct...
Patch13: python-2.7.2-fix_date_time_compiler.patch
Patch14: python-2.7.1-urllib-noproxy.patch
Patch15: python-2.7-CVE-2012-0845-xmlrpc-DoS.patch
Patch16: python-2.7-CVE-2012-1150-hash-randomization.patch
Patch17: python-2.7-expat-hash-randomization.patch
Patch18: pypirc-secure.diff
Patch19: python-2.7-CVE-2011-3389-ssl-compat.patch
# COMMON-PATCH-END
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define python_version %(echo %{version} | head -c 3)
%define idle_name idle
Provides: %{name} = %{python_version}
%description
Python is an interpreted, object-oriented programming language, and is
often compared to Tcl, Perl, Scheme, or Java. You can find an overview
of Python in the documentation and tutorials included in the python-doc
(HTML) or python-doc-pdf (PDF) packages.
If you want to install third party modules using distutils, you need to
install python-devel package.
Authors:
--------
Guido van Rossum
%package idle
Requires: python-base = %{version}-%{release}
Requires: python-tk
Summary: An Integrated Development Environment for Python
License: Python-2.0
Group: Development/Languages/Python
%description idle
IDLE is a Tkinter based integrated development environment for Python.
It features a multi-window text editor with multiple undo, Python
colorizing, and many other things, as well as a Python shell window and
a debugger.
Authors:
--------
Guido van Rossum
%package demo
Provides: pyth_dmo
Obsoletes: pyth_dmo
Requires: python-base = %{version}-%{release}
Summary: Python Demonstration Scripts
License: Python-2.0
Group: Development/Languages/Python
%description demo
Various demonstrations of what you can do with Python and a number of
programs that are useful for building or extending Python.
Authors:
--------
Guido van Rossum
%package tk
Provides: pyth_tk
Provides: pyth_tkl
Provides: python-tkinter
Provides: python_tkinter_lib
#%ifarch %ix86
#Provides: _tkinter.so
#%endif
Obsoletes: pyth_tk
Obsoletes: pyth_tkl
Obsoletes: python-tkinter
Requires: python-base = %{version}-%{release}
Summary: TkInter - Python Tk Interface
License: Python-2.0
Group: Development/Libraries/Python
%description tk
Python interface to Tk. Tk is the GUI toolkit that comes with Tcl. The
"xrpm" package uses this Python interface.
Authors:
--------
Guido van Rossum
%package curses
Requires: python-base = %{version}-%{release}
Obsoletes: pyth_cur
Provides: pyth_cur
Summary: Python Interface to the (N)Curses Library
License: Python-2.0
Group: Development/Libraries/Python
%description curses
An easy to use interface to the (n)curses CUI library. CUI stands for
Console User Interface.
Authors:
--------
Guido van Rossum
%package gdbm
Requires: python-base = %{version}-%{release}
Obsoletes: pygdmod
Provides: pygdmod
Summary: Python Interface to the GDBM Library
License: MIT
Group: Development/Libraries/Python
%description gdbm
An easy to use interface for GDBM databases. GDBM is the GNU
implementation of the standard Unix DBM databases.
Authors:
--------
Guido van Rossum
%prep
%setup -q -n %{tarname}
# COMMON-PREP-BEGIN
%patch1 -p1
%patch2 -p1
%patch3
%patch4
%patch5
%patch6
%patch7
%patch8
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12
%patch13
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
# COMMON-PREP-END
# drop Autoconf version requirement
sed -i 's/^version_required/dnl version_required/' configure.in
# remove newslist.py because of bad license
rm Demo/scripts/newslist.*
%build
# necessary for correct linking with GDBM:
export SUSE_ASNEEDED=0
export OPT="$RPM_OPT_FLAGS"
autoreconf -f -i . # Modules/_ctypes/libffi
# prevent make from trying to rebuild asdl stuff, which requires existing
# python installation
touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h
./configure \
--prefix=%{_prefix} \
--libdir=%{_libdir} \
--mandir=%{_mandir} \
--docdir=%{_docdir}/python \
--enable-ipv6 \
--with-fpectl \
--enable-shared \
--enable-unicode=ucs4
make %{?_smp_mflags} DESTDIR=$RPM_BUILD_ROOT
%check
# on hppa, the threading of glibc is quite broken. The tests just stop
# at some point, and the machine does not build anything more until a
# timeout several hours later.
%ifnarch hppa %arm
# Limit virtual memory to avoid spurious failures
if test $(ulimit -v) = unlimited || test $(ulimit -v) -gt 10000000; then
ulimit -v 10000000 || :
fi
LIST="test_urllib test_ssl test_hashlib test_hmac test_urllib2_localnet test_unicodedata test_tarfile test_sqlite test_tcl test_anydbm test_dumbdbm test_gdbm test_whichdb test_tk test_ttk_textonly test_bsddb test_readline "
make test TESTOPTS="$LIST" TESTPYTHONOPTS="-R"
%endif
%install
# replace rest of /usr/local/bin/python or /usr/bin/python2.x with /usr/bin/python
find . -wholename "./Parser" -prune -o -name '*.py' -type f -print0 | xargs -0 grep -lE '^#! *(/usr/.*bin/(env +)?)?python' | xargs sed -r -i -e '1s@^#![[:space:]]*(/usr/(local/)?bin/(env +)?)?python([0-9]+\.[0-9]+)?@#!/usr/bin/python@'
# the grep inbetween makes it much faster
########################################
# install it
########################################
make \
OPT="$RPM_OPT_FLAGS -fPIC" \
DESTDIR=$RPM_BUILD_ROOT \
install
########################################
# some cleanups
########################################
# remove hard links and replace them with symlinks
for dir in bin include %{_lib} ; do
rm -f $RPM_BUILD_ROOT/%{_prefix}/$dir/python
ln -s python%{python_version} $RPM_BUILD_ROOT/%{_prefix}/$dir/python
done
# kill imageop.so, it's insecure
rm -f $RPM_BUILD_ROOT/%{_libdir}/python%{python_version}/lib-dynload/imageop.so
#cleanup for -base
rm $RPM_BUILD_ROOT%{_bindir}/python{,%{python_version}}
rm $RPM_BUILD_ROOT%{_bindir}/smtpd.py
rm $RPM_BUILD_ROOT%{_bindir}/pydoc
rm $RPM_BUILD_ROOT%{_bindir}/2to3
rm $RPM_BUILD_ROOT%{_mandir}/man1/python*
rm $RPM_BUILD_ROOT%{_libdir}/libpython*.so.*
rm $RPM_BUILD_ROOT%{_libdir}/python
find $RPM_BUILD_ROOT%{_libdir}/python%{python_version} -maxdepth 1 ! \( -name "ssl.py" \) -exec rm {} ";"
rm $RPM_BUILD_ROOT%{_bindir}/python%{python_version}-config
rm $RPM_BUILD_ROOT%{_bindir}/python-config
rm $RPM_BUILD_ROOT%{_libdir}/pkgconfig/*
rm -r $RPM_BUILD_ROOT%{_includedir}/python
rm -r $RPM_BUILD_ROOT%{_includedir}/python%{python_version}
rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/compiler
rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/config
rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/ctypes
rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/distutils
rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/email
rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/encodings
rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/hotshot
rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/importlib
rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/json
rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib2to3
rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/logging
rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/multiprocessing
rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/plat-*
rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/pydoc_data
rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/test
rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/unittest
rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/wsgiref
rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/xml
rm $RPM_BUILD_ROOT%{_libdir}/libpython%{python_version}.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/site-packages/README
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_bisect.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_csv.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_collections.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_ctypes.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_ctypes_test.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_elementtree.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_functools.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_heapq.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_hotshot.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_io.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_json.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_locale.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_lsprof.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_multiprocessing.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_random.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_socket.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_struct.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_testcapi.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/array.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/binascii.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/bz2.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/cPickle.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/cStringIO.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/cmath.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/crypt.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/datetime.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/fcntl.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/future_builtins.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/grp.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/itertools.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/linuxaudiodev.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/math.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/mmap.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/nis.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/operator.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/ossaudiodev.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/parser.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/pyexpat.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/resource.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/select.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/spwd.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/strop.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/syslog.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/termios.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/time.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/unicodedata.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/zlib.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_codecs*.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_multibytecodec.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/audioop.so
rm -f $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/dl.so
rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/Python-%{tarversion}-py%{python_version}.egg-info
# replace duplicate .pyo/.pyc with hardlinks
%fdupes $RPM_BUILD_ROOT/%{_libdir}/python%{python_version}
########################################
# documentation
########################################
export PDOCS=${RPM_BUILD_ROOT}%{_docdir}/%{name}
install -d -m 755 $PDOCS
install -c -m 644 %{S:1} $PDOCS/
install -c -m 644 LICENSE $PDOCS/
install -c -m 644 README $PDOCS/
########################################
# tools and demos
########################################
find Tools/ Demo/ -type d \( -regex ".*/.cvsignore" \) -exec rm -f \{\} \;
for x in `find Tools/ Demo/ \( -not -name Makefile \) -print | sort` ; do
test -d $x && ( install -c -m 755 -d $PDOCS/$x ) \
|| ( install -c -m 644 $x $PDOCS/$x )
done
########################################
# idle
########################################
# move idle config into /etc
install -d -m755 ${RPM_BUILD_ROOT}/etc/%{idle_name}
(
cd ${RPM_BUILD_ROOT}/%{_libdir}/python%{python_version}/idlelib/
for file in *.def ; do
mv $file ${RPM_BUILD_ROOT}/etc/%{idle_name}/
ln -sf /etc/%{idle_name}/$file ${RPM_BUILD_ROOT}/%{_libdir}/python%{python_version}/idlelib/
done
)
########################################
# startup script
########################################
install -m 644 %{S:2} $RPM_BUILD_ROOT/etc
install -d -m 755 $RPM_BUILD_ROOT/etc/profile.d
install -m 644 %{S:3} %{S:4} $RPM_BUILD_ROOT/etc/profile.d
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files idle
%defattr(644, root, root, 755)
%dir /etc/%{idle_name}
%config /etc/%{idle_name}/*
%doc Lib/idlelib/NEWS.txt
%doc Lib/idlelib/README.txt
%doc Lib/idlelib/TODO.txt
%doc Lib/idlelib/extend.txt
%doc Lib/idlelib/ChangeLog
%{_libdir}/python%{python_version}/idlelib
%attr(755, root, root) %{_bindir}/%{idle_name}
%files demo
%defattr(644, root, root, 755)
%doc %{_docdir}/%{name}/Demo
%doc %{_docdir}/%{name}/Tools
%files tk
%defattr(644, root, root, 755)
%{_libdir}/python%{python_version}/lib-tk/
%{_libdir}/python%{python_version}/lib-dynload/_tkinter.so
%files curses
%defattr(644, root, root, 755)
%{_libdir}/python%{python_version}/curses
%{_libdir}/python%{python_version}/lib-dynload/_curses.so
%{_libdir}/python%{python_version}/lib-dynload/_curses_panel.so
%files gdbm
%defattr(644, root, root, 755)
%{_libdir}/python%{python_version}/lib-dynload/gdbm.so
%{_libdir}/python%{python_version}/lib-dynload/dbm.so
%files
%defattr(644, root, root, 755)
%dir %{_docdir}/%{name}
%doc %{_docdir}/%{name}/README
%doc %{_docdir}/%{name}/LICENSE
%doc %{_docdir}/%{name}/README.SUSE
%config /etc/pythonstart
%config /etc/profile.d/python.*
%dir %{_libdir}/python%{python_version}
%{_libdir}/python%{python_version}/ssl.py*
%{_libdir}/python%{python_version}/bsddb
%{_libdir}/python%{python_version}/sqlite3
%dir %{_libdir}/python%{python_version}/lib-dynload
%{_libdir}/python%{python_version}/lib-dynload/_bsddb.so
%{_libdir}/python%{python_version}/lib-dynload/_hashlib.so
%{_libdir}/python%{python_version}/lib-dynload/_sqlite3.so
%{_libdir}/python%{python_version}/lib-dynload/_ssl.so
%{_libdir}/python%{python_version}/lib-dynload/readline.so
%changelog
++++++ README.SUSE ++++++
Python in SUSE
==============
* Documentation *
You can find documentation in seprarate packages: python-doc and
python-doc-pdf. These contan following documents:
Tutorial, What's New in Python, Global Module Index, Library Reference,
Macintosh Module Reference, Installing Python Modules, Distributing Python
Modules, Language Reference, Extending and Embedding, Python/C API,
Documenting Python
The python-doc package constains many text files from source tarball.
* Interactive mode *
Interactive mode is by default enhanced with of history and command completion.
If you don't like these features, you can unset PYTHONSTARTUP variable in your
.profile or disable it system wide in /etc/profile.d/python.sh.
++++++ _local.pth ++++++
import site; import sys; site.addsitedir("/usr/local/" + sys.lib + "/python"+sys.version[:3]+"/site-packages", set()); sys.lib != "lib" and site.addsitedir("/usr/local/lib/python"+sys.version[:3]+"/site-packages", set())
++++++ baselibs.conf ++++++
python
requires "python-base-<targettype> = <version>"
python-base
libpython2_7-1_0
++++++ distutils.cfg ++++++
[build_py]
optimize=0
[install]
prefix=/usr/local
optimize=0
++++++ macros.python ++++++
%py_ver %(python -c "import sys; v=sys.version_info[:2]; print '%%d.%%d'%%v" 2>/dev/null || echo PYTHON-NOT-FOUND)
%py_prefix %(python -c "import sys; print sys.prefix" 2>/dev/null || echo PYTHON-NOT-FOUND)
%py_libdir %{py_prefix}/%{_lib}/python%{py_ver}
%py_incdir %{py_prefix}/include/python%{py_ver}
%py_sitedir %{py_libdir}/site-packages
%py_compile(O) \
find %1 -name '*.pyc' -exec rm -f {} \\; \
python -c "import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)" %1 \
%{-O: \
find %1 -name '*.pyo' -exec rm -f {} \\; \
python -O -c "import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)" %1 \
}
%py_requires(d) \
BuildRequires: /usr/bin/python %{-d:python-devel} \
PreReq: python = %{py_ver}
%python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib();")
%python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True);")
++++++ pre_checkin.sh ++++++
#!/bin/bash
# This script is called automatically during autobuild checkin.
for spec in python.spec; do
{ sed -n -e '1,/COMMON-PATCH-BEGIN/p' $spec
sed -n -e '/COMMON-PATCH-BEGIN/,/COMMON-PATCH-END/p' python-base.spec
sed -n -e '/COMMON-PATCH-END/,/COMMON-PREP-BEGIN/p' $spec
sed -n -e '/COMMON-PREP-BEGIN/,/COMMON-PREP-END/p' python-base.spec
sed -n -e '/COMMON-PREP-END/,$p' $spec;
} | uniq > $spec.tmp && mv $spec.tmp $spec
done
++++++ pypirc-secure.diff ++++++
# HG changeset patch
# User Philip Jenvey
# Date 1322701507 28800
# Branch 2.7
# Node ID e7c20a8476a0e2ca18f8040864cbc400818d8f24
# Parent 3ecddf168f1f554a17a047384fe0b02f2d688277
create the .pypirc securely
diff -r 3ecddf168f1f -r e7c20a8476a0 Lib/distutils/config.py
--- a/Lib/distutils/config.py Tue Nov 29 00:53:09 2011 +0100
+++ b/Lib/distutils/config.py Wed Nov 30 17:05:07 2011 -0800
@@ -42,16 +42,8 @@
def _store_pypirc(self, username, password):
"""Creates a default .pypirc file."""
rc = self._get_rc_file()
- f = open(rc, 'w')
- try:
- f.write(DEFAULT_PYPIRC % (username, password))
- finally:
- f.close()
- try:
- os.chmod(rc, 0600)
- except OSError:
- # should do something better here
- pass
+ with os.fdopen(os.open(rc, os.O_CREAT | os.O_WRONLY, 0600), 'w') as fp:
+ fp.write(DEFAULT_PYPIRC % (username, password))
def _read_pypirc(self):
"""Reads the .pypirc file."""
++++++ python-2.5.1-sqlite.patch ++++++
--- Modules/_sqlite/cursor.c
+++ Modules/_sqlite/cursor.c
@@ -782,6 +782,9 @@
goto error;
}
+ if (! statement)
+ break;
+
/* execute statement, and ignore results of SELECT statements */
rc = SQLITE_ROW;
while (rc == SQLITE_ROW) {
++++++ python-2.6-gettext-plurals.patch ++++++
Index: Lib/gettext.py
===================================================================
--- Lib/gettext.py.orig
+++ Lib/gettext.py
@@ -311,8 +311,9 @@ class GNUTranslations(NullTranslations):
self._charset = v.split('charset=')[1]
elif k == 'plural-forms':
v = v.split(';')
- plural = v[1].split('plural=')[1]
- self.plural = c2py(plural)
+ if len(v) > 1:
+ plural = v[1].split('plural=')[1]
+ self.plural = c2py(plural)
# Note: we unconditionally convert both msgids and msgstrs to
# Unicode using the character encoding specified in the charset
# parameter of the Content-Type header. The gettext documentation
++++++ python-2.6b3-curses-panel.patch ++++++
--- Modules/_curses_panel.c
+++ Modules/_curses_panel.c
@@ -14,7 +14,7 @@
#include "py_curses.h"
-#include
+#include
static PyObject *PyCursesError;
++++++ python-2.7-CVE-2011-3389-ssl-compat.patch ++++++
Index: Python-2.7/Modules/_ssl.c
===================================================================
--- Python-2.7.orig/Modules/_ssl.c 2010-06-25 02:03:21.000000000 +0200
+++ Python-2.7/Modules/_ssl.c 2012-03-29 16:25:36.000000000 +0200
@@ -365,7 +365,7 @@
}
/* ssl compatibility */
- SSL_CTX_set_options(self->ctx, SSL_OP_ALL);
+ SSL_CTX_set_options(self->ctx, SSL_OP_ALL & ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS);
verification_mode = SSL_VERIFY_NONE;
if (certreq == PY_SSL_CERT_OPTIONAL)
++++++ python-2.7-CVE-2012-0845-xmlrpc-DoS.patch ++++++
# HG changeset patch
# User Charles-François Natali
# Date 1329571834 -3600
# Node ID 0c02f30b2538a6d426e0162f2a3f59afb1d870e7
# Parent 7052eb923fb873f19ddf2ac4d962d4358753be18# Parent 24244a744d0143b24137b343d93d937c223877aa
Issue #14001: CVE-2012-0845: xmlrpc: Fix an endless loop in SimpleXMLRPCServer
upon malformed POST request.
diff --git a/Lib/SimpleXMLRPCServer.py b/Lib/SimpleXMLRPCServer.py
--- a/Lib/SimpleXMLRPCServer.py
+++ b/Lib/SimpleXMLRPCServer.py
@@ -486,7 +486,10 @@ class SimpleXMLRPCRequestHandler(BaseHTT
L = []
while size_remaining:
chunk_size = min(size_remaining, max_chunk_size)
- L.append(self.rfile.read(chunk_size))
+ chunk = self.rfile.read(chunk_size)
+ if not chunk:
+ break
+ L.append(chunk)
size_remaining -= len(L[-1])
data = ''.join(L)
diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py
--- a/Lib/test/test_xmlrpc.py
+++ b/Lib/test/test_xmlrpc.py
@@ -589,6 +589,12 @@ class SimpleServerTestCase(BaseServerTes
# This avoids waiting for the socket timeout.
self.test_simple1()
+ def test_partial_post(self):
+ # Check that a partial POST doesn't make the server loop: issue #14001.
+ conn = httplib.HTTPConnection(ADDR, PORT)
+ conn.request('POST', '/RPC2 HTTP/1.0\r\nContent-Length: 100\r\n\r\nbye')
+ conn.close()
+
class MultiPathServerTestCase(BaseServerTestCase):
threadFunc = staticmethod(http_multi_server)
request_count = 2
++++++ python-2.7-CVE-2012-1150-hash-randomization.patch ++++++
++++ 3344 lines (skipped)
++++++ python-2.7-dirs.patch ++++++
Index: Python-2.7/Makefile.pre.in
===================================================================
--- Python-2.7.orig/Makefile.pre.in
+++ Python-2.7/Makefile.pre.in
@@ -94,7 +94,7 @@ LIBDIR= @libdir@
MANDIR= @mandir@
INCLUDEDIR= @includedir@
CONFINCLUDEDIR= $(exec_prefix)/include
-SCRIPTDIR= $(prefix)/lib
+SCRIPTDIR= @libdir@
# Detailed destination directories
BINLIBDEST= $(LIBDIR)/python$(VERSION)
++++++ python-2.7-expat-hash-randomization.patch ++++++
# HG changeset patch
# User Gregory P. Smith
# Date 1331764090 25200
# Node ID 04ff6e206b9820ce2ba999f81791fe9c9f500105
# Parent 36ec90b6b5e51a73a7f89e102cc34e5a9808f16a
Fixes Issue #14234: CVE-2012-0876: Randomize hashes of xml attributes
in the hash table internal to the pyexpat module's copy of the expat
library to avoid a denial of service due to hash collisions.
Patch by David Malcolm with some modifications by the expat project.
diff --git a/Modules/expat/expat.h b/Modules/expat/expat.h
--- a/Modules/expat/expat.h
+++ b/Modules/expat/expat.h
@@ -883,6 +883,15 @@ XMLPARSEAPI(int)
XML_SetParamEntityParsing(XML_Parser parser,
enum XML_ParamEntityParsing parsing);
+/* Sets the hash salt to use for internal hash calculations.
+ Helps in preventing DoS attacks based on predicting hash
+ function behavior. This must be called before parsing is started.
+ Returns 1 if successful, 0 when called after parsing has started.
+*/
+XMLPARSEAPI(int)
+XML_SetHashSalt(XML_Parser parser,
+ unsigned long hash_salt);
+
/* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then
XML_GetErrorCode returns information about the error.
*/
diff --git a/Modules/expat/pyexpatns.h b/Modules/expat/pyexpatns.h
--- a/Modules/expat/pyexpatns.h
+++ b/Modules/expat/pyexpatns.h
@@ -97,6 +97,7 @@
#define XML_SetEntityDeclHandler PyExpat_XML_SetEntityDeclHandler
#define XML_SetExternalEntityRefHandler PyExpat_XML_SetExternalEntityRefHandler
#define XML_SetExternalEntityRefHandlerArg PyExpat_XML_SetExternalEntityRefHandlerArg
+#define XML_SetHashSalt PyExpat_XML_SetHashSalt
#define XML_SetNamespaceDeclHandler PyExpat_XML_SetNamespaceDeclHandler
#define XML_SetNotationDeclHandler PyExpat_XML_SetNotationDeclHandler
#define XML_SetNotStandaloneHandler PyExpat_XML_SetNotStandaloneHandler
diff --git a/Modules/expat/xmlparse.c b/Modules/expat/xmlparse.c
--- a/Modules/expat/xmlparse.c
+++ b/Modules/expat/xmlparse.c
@@ -17,6 +17,8 @@
#include
#include /* memset(), memcpy() */
#include
+#include /* UINT_MAX */
+#include /* time() */
#include "expat.h"
@@ -387,12 +389,13 @@ static void dtdReset(DTD *p, const XML_M
static void
dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms);
static int
-dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms);
+dtdCopy(XML_Parser oldParser,
+ DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms);
static int
-copyEntityTable(HASH_TABLE *, STRING_POOL *, const HASH_TABLE *);
-
+copyEntityTable(XML_Parser oldParser,
+ HASH_TABLE *, STRING_POOL *, const HASH_TABLE *);
static NAMED *
-lookup(HASH_TABLE *table, KEY name, size_t createSize);
+lookup(XML_Parser parser, HASH_TABLE *table, KEY name, size_t createSize);
static void FASTCALL
hashTableInit(HASH_TABLE *, const XML_Memory_Handling_Suite *ms);
static void FASTCALL hashTableClear(HASH_TABLE *);
@@ -425,6 +428,9 @@ static ELEMENT_TYPE *
getElementType(XML_Parser parser, const ENCODING *enc,
const char *ptr, const char *end);
+static unsigned long generate_hash_secret_salt(void);
+static XML_Bool startParsing(XML_Parser parser);
+
static XML_Parser
parserCreate(const XML_Char *encodingName,
const XML_Memory_Handling_Suite *memsuite,
@@ -542,6 +548,7 @@ struct XML_ParserStruct {
XML_Bool m_useForeignDTD;
enum XML_ParamEntityParsing m_paramEntityParsing;
#endif
+ unsigned long m_hash_secret_salt;
};
#define MALLOC(s) (parser->m_mem.malloc_fcn((s)))
@@ -649,6 +656,7 @@ struct XML_ParserStruct {
#define useForeignDTD (parser->m_useForeignDTD)
#define paramEntityParsing (parser->m_paramEntityParsing)
#endif /* XML_DTD */
+#define hash_secret_salt (parser->m_hash_secret_salt)
XML_Parser XMLCALL
XML_ParserCreate(const XML_Char *encodingName)
@@ -671,22 +679,36 @@ static const XML_Char implicitContext[]
'n', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\0'
};
-XML_Parser XMLCALL
-XML_ParserCreate_MM(const XML_Char *encodingName,
- const XML_Memory_Handling_Suite *memsuite,
- const XML_Char *nameSep)
+static unsigned long
+generate_hash_secret_salt(void)
{
- XML_Parser parser = parserCreate(encodingName, memsuite, nameSep, NULL);
- if (parser != NULL && ns) {
+ unsigned int seed = time(NULL) % UINT_MAX;
+ srand(seed);
+ return rand();
+}
+
+static XML_Bool /* only valid for root parser */
+startParsing(XML_Parser parser)
+{
+ /* hash functions must be initialized before setContext() is called */
+
+ if (hash_secret_salt == 0)
+ hash_secret_salt = generate_hash_secret_salt();
+ if (ns) {
/* implicit context only set for root parser, since child
parsers (i.e. external entity parsers) will inherit it
*/
- if (!setContext(parser, implicitContext)) {
- XML_ParserFree(parser);
- return NULL;
- }
+ return setContext(parser, implicitContext);
}
- return parser;
+ return XML_TRUE;
+}
+
+XML_Parser XMLCALL
+XML_ParserCreate_MM(const XML_Char *encodingName,
+ const XML_Memory_Handling_Suite *memsuite,
+ const XML_Char *nameSep)
+{
+ return parserCreate(encodingName, memsuite, nameSep, NULL);
}
static XML_Parser
@@ -860,6 +882,7 @@ parserInit(XML_Parser parser, const XML_
useForeignDTD = XML_FALSE;
paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER;
#endif
+ hash_secret_salt = 0;
}
/* moves list of bindings to freeBindingList */
@@ -907,7 +930,7 @@ XML_ParserReset(XML_Parser parser, const
poolClear(&temp2Pool);
parserInit(parser, encodingName);
dtdReset(_dtd, &parser->m_mem);
- return setContext(parser, implicitContext);
+ return XML_TRUE;
}
enum XML_Status XMLCALL
@@ -976,6 +999,12 @@ XML_ExternalEntityParserCreate(XML_Parse
int oldInEntityValue = prologState.inEntityValue;
#endif
XML_Bool oldns_triplets = ns_triplets;
+ /* Note that the new parser shares the same hash secret as the old
+ parser, so that dtdCopy and copyEntityTable can lookup values
+ from hash tables associated with either parser without us having
+ to worry which hash secrets each table has.
+ */
+ unsigned long oldhash_secret_salt = hash_secret_salt;
#ifdef XML_DTD
if (!context)
@@ -1029,13 +1058,14 @@ XML_ExternalEntityParserCreate(XML_Parse
externalEntityRefHandlerArg = oldExternalEntityRefHandlerArg;
defaultExpandInternalEntities = oldDefaultExpandInternalEntities;
ns_triplets = oldns_triplets;
+ hash_secret_salt = oldhash_secret_salt;
parentParser = oldParser;
#ifdef XML_DTD
paramEntityParsing = oldParamEntityParsing;
prologState.inEntityValue = oldInEntityValue;
if (context) {
#endif /* XML_DTD */
- if (!dtdCopy(_dtd, oldDtd, &parser->m_mem)
+ if (!dtdCopy(oldParser, _dtd, oldDtd, &parser->m_mem)
|| !setContext(parser, context)) {
XML_ParserFree(parser);
return NULL;
@@ -1420,6 +1450,17 @@ XML_SetParamEntityParsing(XML_Parser par
#endif
}
+int XMLCALL
+XML_SetHashSalt(XML_Parser parser,
+ unsigned long hash_salt)
+{
+ /* block after XML_Parse()/XML_ParseBuffer() has been called */
+ if (ps_parsing == XML_PARSING || ps_parsing == XML_SUSPENDED)
+ return 0;
+ hash_secret_salt = hash_salt;
+ return 1;
+}
+
enum XML_Status XMLCALL
XML_Parse(XML_Parser parser, const char *s, int len, int isFinal)
{
@@ -1430,6 +1471,11 @@ XML_Parse(XML_Parser parser, const char
case XML_FINISHED:
errorCode = XML_ERROR_FINISHED;
return XML_STATUS_ERROR;
+ case XML_INITIALIZED:
+ if (parentParser == NULL && !startParsing(parser)) {
+ errorCode = XML_ERROR_NO_MEMORY;
+ return XML_STATUS_ERROR;
+ }
default:
ps_parsing = XML_PARSING;
}
@@ -1488,11 +1534,13 @@ XML_Parse(XML_Parser parser, const char
break;
case XML_INITIALIZED:
case XML_PARSING:
- result = XML_STATUS_OK;
if (isFinal) {
ps_parsing = XML_FINISHED;
- return result;
+ return XML_STATUS_OK;
}
+ /* fall through */
+ default:
+ result = XML_STATUS_OK;
}
}
@@ -1553,6 +1601,11 @@ XML_ParseBuffer(XML_Parser parser, int l
case XML_FINISHED:
errorCode = XML_ERROR_FINISHED;
return XML_STATUS_ERROR;
+ case XML_INITIALIZED:
+ if (parentParser == NULL && !startParsing(parser)) {
+ errorCode = XML_ERROR_NO_MEMORY;
+ return XML_STATUS_ERROR;
+ }
default:
ps_parsing = XML_PARSING;
}
@@ -2231,7 +2284,7 @@ doContent(XML_Parser parser,
next - enc->minBytesPerChar);
if (!name)
return XML_ERROR_NO_MEMORY;
- entity = (ENTITY *)lookup(&dtd->generalEntities, name, 0);
+ entity = (ENTITY *)lookup(parser, &dtd->generalEntities, name, 0);
poolDiscard(&dtd->pool);
/* First, determine if a check for an existing declaration is needed;
if yes, check that the entity exists, and that it is internal,
@@ -2618,12 +2671,12 @@ storeAtts(XML_Parser parser, const ENCOD
const XML_Char *localPart;
/* lookup the element type name */
- elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, tagNamePtr->str,0);
+ elementType = (ELEMENT_TYPE *)lookup(parser, &dtd->elementTypes, tagNamePtr->str,0);
if (!elementType) {
const XML_Char *name = poolCopyString(&dtd->pool, tagNamePtr->str);
if (!name)
return XML_ERROR_NO_MEMORY;
- elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, name,
+ elementType = (ELEMENT_TYPE *)lookup(parser, &dtd->elementTypes, name,
sizeof(ELEMENT_TYPE));
if (!elementType)
return XML_ERROR_NO_MEMORY;
@@ -2792,9 +2845,9 @@ storeAtts(XML_Parser parser, const ENCOD
if (s[-1] == 2) { /* prefixed */
ATTRIBUTE_ID *id;
const BINDING *b;
- unsigned long uriHash = 0;
+ unsigned long uriHash = hash_secret_salt;
((XML_Char *)s)[-1] = 0; /* clear flag */
- id = (ATTRIBUTE_ID *)lookup(&dtd->attributeIds, s, 0);
+ id = (ATTRIBUTE_ID *)lookup(parser, &dtd->attributeIds, s, 0);
if (!id)
return XML_ERROR_NO_MEMORY;
b = id->prefix->binding;
@@ -2818,7 +2871,7 @@ storeAtts(XML_Parser parser, const ENCOD
} while (*s++);
{ /* Check hash table for duplicate of expanded name (uriName).
- Derived from code in lookup(HASH_TABLE *table, ...).
+ Derived from code in lookup(parser, HASH_TABLE *table, ...).
*/
unsigned char step = 0;
unsigned long mask = nsAttsSize - 1;
@@ -3756,7 +3809,8 @@ doProlog(XML_Parser parser,
case XML_ROLE_DOCTYPE_PUBLIC_ID:
#ifdef XML_DTD
useForeignDTD = XML_FALSE;
- declEntity = (ENTITY *)lookup(&dtd->paramEntities,
+ declEntity = (ENTITY *)lookup(parser,
+ &dtd->paramEntities,
externalSubsetName,
sizeof(ENTITY));
if (!declEntity)
@@ -3811,7 +3865,8 @@ doProlog(XML_Parser parser,
XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs;
dtd->hasParamEntityRefs = XML_TRUE;
if (paramEntityParsing && externalEntityRefHandler) {
- ENTITY *entity = (ENTITY *)lookup(&dtd->paramEntities,
+ ENTITY *entity = (ENTITY *)lookup(parser,
+ &dtd->paramEntities,
externalSubsetName,
sizeof(ENTITY));
if (!entity)
@@ -3855,7 +3910,7 @@ doProlog(XML_Parser parser,
XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs;
dtd->hasParamEntityRefs = XML_TRUE;
if (paramEntityParsing && externalEntityRefHandler) {
- ENTITY *entity = (ENTITY *)lookup(&dtd->paramEntities,
+ ENTITY *entity = (ENTITY *)lookup(parser, &dtd->paramEntities,
externalSubsetName,
sizeof(ENTITY));
if (!entity)
@@ -4069,7 +4124,8 @@ doProlog(XML_Parser parser,
break;
#else /* XML_DTD */
if (!declEntity) {
- declEntity = (ENTITY *)lookup(&dtd->paramEntities,
+ declEntity = (ENTITY *)lookup(parser,
+ &dtd->paramEntities,
externalSubsetName,
sizeof(ENTITY));
if (!declEntity)
@@ -4144,7 +4200,7 @@ doProlog(XML_Parser parser,
const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next);
if (!name)
return XML_ERROR_NO_MEMORY;
- declEntity = (ENTITY *)lookup(&dtd->generalEntities, name,
+ declEntity = (ENTITY *)lookup(parser, &dtd->generalEntities, name,
sizeof(ENTITY));
if (!declEntity)
return XML_ERROR_NO_MEMORY;
@@ -4176,7 +4232,7 @@ doProlog(XML_Parser parser,
const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next);
if (!name)
return XML_ERROR_NO_MEMORY;
- declEntity = (ENTITY *)lookup(&dtd->paramEntities,
+ declEntity = (ENTITY *)lookup(parser, &dtd->paramEntities,
name, sizeof(ENTITY));
if (!declEntity)
return XML_ERROR_NO_MEMORY;
@@ -4358,7 +4414,7 @@ doProlog(XML_Parser parser,
next - enc->minBytesPerChar);
if (!name)
return XML_ERROR_NO_MEMORY;
- entity = (ENTITY *)lookup(&dtd->paramEntities, name, 0);
+ entity = (ENTITY *)lookup(parser, &dtd->paramEntities, name, 0);
poolDiscard(&dtd->pool);
/* first, determine if a check for an existing declaration is needed;
if yes, check that the entity exists, and that it is internal,
@@ -4882,7 +4938,7 @@ appendAttributeValue(XML_Parser parser,
next - enc->minBytesPerChar);
if (!name)
return XML_ERROR_NO_MEMORY;
- entity = (ENTITY *)lookup(&dtd->generalEntities, name, 0);
+ entity = (ENTITY *)lookup(parser, &dtd->generalEntities, name, 0);
poolDiscard(&temp2Pool);
/* First, determine if a check for an existing declaration is needed;
if yes, check that the entity exists, and that it is internal.
@@ -4991,7 +5047,7 @@ storeEntityValue(XML_Parser parser,
result = XML_ERROR_NO_MEMORY;
goto endEntityValue;
}
- entity = (ENTITY *)lookup(&dtd->paramEntities, name, 0);
+ entity = (ENTITY *)lookup(parser, &dtd->paramEntities, name, 0);
poolDiscard(&tempPool);
if (!entity) {
/* not a well-formedness error - see XML 1.0: WFC Entity Declared */
@@ -5281,7 +5337,7 @@ setElementTypePrefix(XML_Parser parser,
}
if (!poolAppendChar(&dtd->pool, XML_T('\0')))
return 0;
- prefix = (PREFIX *)lookup(&dtd->prefixes, poolStart(&dtd->pool),
+ prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&dtd->pool),
sizeof(PREFIX));
if (!prefix)
return 0;
@@ -5310,7 +5366,7 @@ getAttributeId(XML_Parser parser, const
return NULL;
/* skip quotation mark - its storage will be re-used (like in name[-1]) */
++name;
- id = (ATTRIBUTE_ID *)lookup(&dtd->attributeIds, name, sizeof(ATTRIBUTE_ID));
+ id = (ATTRIBUTE_ID *)lookup(parser, &dtd->attributeIds, name, sizeof(ATTRIBUTE_ID));
if (!id)
return NULL;
if (id->name != name)
@@ -5328,7 +5384,7 @@ getAttributeId(XML_Parser parser, const
if (name[5] == XML_T('\0'))
id->prefix = &dtd->defaultPrefix;
else
- id->prefix = (PREFIX *)lookup(&dtd->prefixes, name + 6, sizeof(PREFIX));
+ id->prefix = (PREFIX *)lookup(parser, &dtd->prefixes, name + 6, sizeof(PREFIX));
id->xmlns = XML_TRUE;
}
else {
@@ -5343,7 +5399,7 @@ getAttributeId(XML_Parser parser, const
}
if (!poolAppendChar(&dtd->pool, XML_T('\0')))
return NULL;
- id->prefix = (PREFIX *)lookup(&dtd->prefixes, poolStart(&dtd->pool),
+ id->prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&dtd->pool),
sizeof(PREFIX));
if (!id->prefix)
return NULL;
@@ -5441,7 +5497,7 @@ setContext(XML_Parser parser, const XML_
ENTITY *e;
if (!poolAppendChar(&tempPool, XML_T('\0')))
return XML_FALSE;
- e = (ENTITY *)lookup(&dtd->generalEntities, poolStart(&tempPool), 0);
+ e = (ENTITY *)lookup(parser, &dtd->generalEntities, poolStart(&tempPool), 0);
if (e)
e->open = XML_TRUE;
if (*s != XML_T('\0'))
@@ -5456,7 +5512,7 @@ setContext(XML_Parser parser, const XML_
else {
if (!poolAppendChar(&tempPool, XML_T('\0')))
return XML_FALSE;
- prefix = (PREFIX *)lookup(&dtd->prefixes, poolStart(&tempPool),
+ prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&tempPool),
sizeof(PREFIX));
if (!prefix)
return XML_FALSE;
@@ -5620,7 +5676,7 @@ dtdDestroy(DTD *p, XML_Bool isDocEntity,
The new DTD has already been initialized.
*/
static int
-dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms)
+dtdCopy(XML_Parser oldParser, DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms)
{
HASH_TABLE_ITER iter;
@@ -5635,7 +5691,7 @@ dtdCopy(DTD *newDtd, const DTD *oldDtd,
name = poolCopyString(&(newDtd->pool), oldP->name);
if (!name)
return 0;
- if (!lookup(&(newDtd->prefixes), name, sizeof(PREFIX)))
+ if (!lookup(oldParser, &(newDtd->prefixes), name, sizeof(PREFIX)))
return 0;
}
@@ -5657,7 +5713,7 @@ dtdCopy(DTD *newDtd, const DTD *oldDtd,
if (!name)
return 0;
++name;
- newA = (ATTRIBUTE_ID *)lookup(&(newDtd->attributeIds), name,
+ newA = (ATTRIBUTE_ID *)lookup(oldParser, &(newDtd->attributeIds), name,
sizeof(ATTRIBUTE_ID));
if (!newA)
return 0;
@@ -5667,7 +5723,7 @@ dtdCopy(DTD *newDtd, const DTD *oldDtd,
if (oldA->prefix == &oldDtd->defaultPrefix)
newA->prefix = &newDtd->defaultPrefix;
else
- newA->prefix = (PREFIX *)lookup(&(newDtd->prefixes),
+ newA->prefix = (PREFIX *)lookup(oldParser, &(newDtd->prefixes),
oldA->prefix->name, 0);
}
}
@@ -5686,7 +5742,7 @@ dtdCopy(DTD *newDtd, const DTD *oldDtd,
name = poolCopyString(&(newDtd->pool), oldE->name);
if (!name)
return 0;
- newE = (ELEMENT_TYPE *)lookup(&(newDtd->elementTypes), name,
+ newE = (ELEMENT_TYPE *)lookup(oldParser, &(newDtd->elementTypes), name,
sizeof(ELEMENT_TYPE));
if (!newE)
return 0;
@@ -5700,14 +5756,14 @@ dtdCopy(DTD *newDtd, const DTD *oldDtd,
}
if (oldE->idAtt)
newE->idAtt = (ATTRIBUTE_ID *)
- lookup(&(newDtd->attributeIds), oldE->idAtt->name, 0);
+ lookup(oldParser, &(newDtd->attributeIds), oldE->idAtt->name, 0);
newE->allocDefaultAtts = newE->nDefaultAtts = oldE->nDefaultAtts;
if (oldE->prefix)
- newE->prefix = (PREFIX *)lookup(&(newDtd->prefixes),
+ newE->prefix = (PREFIX *)lookup(oldParser, &(newDtd->prefixes),
oldE->prefix->name, 0);
for (i = 0; i < newE->nDefaultAtts; i++) {
newE->defaultAtts[i].id = (ATTRIBUTE_ID *)
- lookup(&(newDtd->attributeIds), oldE->defaultAtts[i].id->name, 0);
+ lookup(oldParser, &(newDtd->attributeIds), oldE->defaultAtts[i].id->name, 0);
newE->defaultAtts[i].isCdata = oldE->defaultAtts[i].isCdata;
if (oldE->defaultAtts[i].value) {
newE->defaultAtts[i].value
@@ -5721,13 +5777,15 @@ dtdCopy(DTD *newDtd, const DTD *oldDtd,
}
/* Copy the entity tables. */
- if (!copyEntityTable(&(newDtd->generalEntities),
+ if (!copyEntityTable(oldParser,
+ &(newDtd->generalEntities),
&(newDtd->pool),
&(oldDtd->generalEntities)))
return 0;
#ifdef XML_DTD
- if (!copyEntityTable(&(newDtd->paramEntities),
+ if (!copyEntityTable(oldParser,
+ &(newDtd->paramEntities),
&(newDtd->pool),
&(oldDtd->paramEntities)))
return 0;
@@ -5750,7 +5808,8 @@ dtdCopy(DTD *newDtd, const DTD *oldDtd,
} /* End dtdCopy */
static int
-copyEntityTable(HASH_TABLE *newTable,
+copyEntityTable(XML_Parser oldParser,
+ HASH_TABLE *newTable,
STRING_POOL *newPool,
const HASH_TABLE *oldTable)
{
@@ -5769,7 +5828,7 @@ copyEntityTable(HASH_TABLE *newTable,
name = poolCopyString(newPool, oldE->name);
if (!name)
return 0;
- newE = (ENTITY *)lookup(newTable, name, sizeof(ENTITY));
+ newE = (ENTITY *)lookup(oldParser, newTable, name, sizeof(ENTITY));
if (!newE)
return 0;
if (oldE->systemId) {
@@ -5827,16 +5886,16 @@ keyeq(KEY s1, KEY s2)
}
static unsigned long FASTCALL
-hash(KEY s)
+hash(XML_Parser parser, KEY s)
{
- unsigned long h = 0;
+ unsigned long h = hash_secret_salt;
while (*s)
h = CHAR_HASH(h, *s++);
return h;
}
static NAMED *
-lookup(HASH_TABLE *table, KEY name, size_t createSize)
+lookup(XML_Parser parser, HASH_TABLE *table, KEY name, size_t createSize)
{
size_t i;
if (table->size == 0) {
@@ -5853,10 +5912,10 @@ lookup(HASH_TABLE *table, KEY name, size
return NULL;
}
memset(table->v, 0, tsize);
- i = hash(name) & ((unsigned long)table->size - 1);
+ i = hash(parser, name) & ((unsigned long)table->size - 1);
}
else {
- unsigned long h = hash(name);
+ unsigned long h = hash(parser, name);
unsigned long mask = (unsigned long)table->size - 1;
unsigned char step = 0;
i = h & mask;
@@ -5882,7 +5941,7 @@ lookup(HASH_TABLE *table, KEY name, size
memset(newV, 0, tsize);
for (i = 0; i < table->size; i++)
if (table->v[i]) {
- unsigned long newHash = hash(table->v[i]->name);
+ unsigned long newHash = hash(parser, table->v[i]->name);
size_t j = newHash & newMask;
step = 0;
while (newV[j]) {
@@ -6257,7 +6316,7 @@ getElementType(XML_Parser parser,
if (!name)
return NULL;
- ret = (ELEMENT_TYPE *) lookup(&dtd->elementTypes, name, sizeof(ELEMENT_TYPE));
+ ret = (ELEMENT_TYPE *) lookup(parser, &dtd->elementTypes, name, sizeof(ELEMENT_TYPE));
if (!ret)
return NULL;
if (ret->name != name)
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -1302,6 +1302,8 @@ newxmlparseobject(char *encoding, char *
else {
self->itself = XML_ParserCreate(encoding);
}
+ XML_SetHashSalt(self->itself,
+ (unsigned long)_Py_HashSecret.prefix);
self->intern = intern;
Py_XINCREF(self->intern);
#ifdef Py_TPFLAGS_HAVE_GC
++++++ python-2.7.1-distutils_test_path.patch ++++++
Index: Python-2.7/Lib/distutils/tests/test_build_ext.py
===================================================================
--- 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
- other_tmp_dir = os.path.realpath(self.mkdtemp())
- old_wd = os.getcwd()
- os.chdir(other_tmp_dir)
- try:
- cmd.inplace = 1
- cmd.run()
- so_file = cmd.get_outputs()[0]
- finally:
- os.chdir(old_wd)
+ cmd.inplace = 1
+ cmd.run()
+ so_file = cmd.get_outputs()[0]
self.assertTrue(os.path.exists(so_file))
self.assertEqual(os.path.splitext(so_file)[-1],
sysconfig.get_config_var('SO'))
so_dir = os.path.dirname(so_file)
- self.assertEqual(so_dir, other_tmp_dir)
+ self.assertEqual(so_dir, os.getcwd())
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()
++++++ python-2.7.1-urllib-noproxy.patch ++++++
Index: Python-2.7.1/Lib/urllib.py
===================================================================
--- Python-2.7.1.orig/Lib/urllib.py
+++ Python-2.7.1/Lib/urllib.py
@@ -1350,6 +1350,7 @@ def proxy_bypass_environment(host):
hostonly, port = splitport(host)
# check if the host ends with any of the DNS suffixes
for name in no_proxy.split(','):
+ name = name.strip()
if name and (hostonly.endswith(name) or host.endswith(name)):
return 1
# otherwise, don't bypass
++++++ python-2.7.2-fix_date_time_compiler.patch ++++++
--- Makefile.pre.in
+++ Makefile.pre.in
@@ -524,8 +524,15 @@
-DHGVERSION="\"`LC_ALL=C $(HGVERSION)`\"" \
-DHGTAG="\"`LC_ALL=C $(HGTAG)`\"" \
-DHGBRANCH="\"`LC_ALL=C $(HGBRANCH)`\"" \
+ -DDATE="\"`LC_ALL=C date -u -r Makefile.pre.in +"%b %d %Y"`\"" \
+ -DTIME="\"`LC_ALL=C date -u -r Makefile.pre.in +"%T"`\"" \
-o $@ $(srcdir)/Modules/getbuildinfo.c
+Python/getcompiler.o: $(srcdir)/Python/getcompiler.c Makefile
+ $(CC) -c $(PY_CFLAGS) \
+ -DCOMPILER='"[GCC]"' \
+ -o $@ $(srcdir)/Python/getcompiler.c
+
Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
$(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
-DPREFIX='"$(prefix)"' \
++++++ python-2.7.2-linux3-linux2.patch ++++++
# HG changeset patch
# User Victor Stinner
# Date 1313841665 -7200
# Node ID 800d45e51dd797e4a39cd8fde7c3973e378866ff
# Parent 5ef1d0eb2f547aa2c9def522e35b59edcbfe8641
Issue #12326: sys.platform is now always 'linux2' on Linux
Even if Python is compiled on Linux 3.
Index: Python-2.7.2/configure
===================================================================
--- Python-2.7.2.orig/configure
+++ Python-2.7.2/configure
@@ -3003,6 +3003,7 @@ then
MACHDEP="$ac_md_system$ac_md_release"
case $MACHDEP in
+ linux*) MACHDEP="linux2";;
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
atheos*) MACHDEP="atheos";;
Index: Python-2.7.2/configure.in
===================================================================
--- Python-2.7.2.orig/configure.in
+++ Python-2.7.2/configure.in
@@ -293,6 +293,7 @@ then
MACHDEP="$ac_md_system$ac_md_release"
case $MACHDEP in
+ linux*) MACHDEP="linux2";;
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
atheos*) MACHDEP="atheos";;
++++++ python-2.7.2-multilib.patch ++++++
--- configure.in
+++ configure.in
@@ -629,6 +629,41 @@
;;
esac
+AC_SUBST(ARCH)
+AC_MSG_CHECKING(ARCH)
+ARCH=`uname -m`
+case $ARCH in
+i?86) ARCH=i386;;
+esac
+AC_MSG_RESULT($ARCH)
+
+AC_SUBST(LIB)
+AC_MSG_CHECKING(LIB)
+case $ac_sys_system in
+Linux*)
+ # Test if the compiler is 64bit
+ echo 'int i;' > conftest.$ac_ext
+ python_cv_cc_64bit_output=no
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *"ELF 64"*)
+ python_cv_cc_64bit_output=yes
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+case $ARCH:$python_cv_cc_64bit_output in
+ppc64:yes | powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
+ LIB="lib64"
+ ;;
+*:*)
+ LIB="lib"
+ ;;
+esac
+AC_MSG_RESULT($LIB)
AC_SUBST(LIBRARY)
AC_MSG_CHECKING(LIBRARY)
--- Include/pythonrun.h
+++ Include/pythonrun.h
@@ -108,6 +108,8 @@
/* In their own files */
PyAPI_FUNC(const char *) Py_GetVersion(void);
PyAPI_FUNC(const char *) Py_GetPlatform(void);
+PyAPI_FUNC(const char *) Py_GetArch(void);
+PyAPI_FUNC(const char *) Py_GetLib(void);
PyAPI_FUNC(const char *) Py_GetCopyright(void);
PyAPI_FUNC(const char *) Py_GetCompiler(void);
PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
--- Lib/distutils/command/install.py
+++ Lib/distutils/command/install.py
@@ -22,6 +22,8 @@
from site import USER_SITE
+libname = sys.lib
+
if sys.version < "2.2":
WINDOWS_SCHEME = {
'purelib': '$base',
@@ -42,7 +44,7 @@
INSTALL_SCHEMES = {
'unix_prefix': {
'purelib': '$base/lib/python$py_version_short/site-packages',
- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
+ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
'headers': '$base/include/python$py_version_short/$dist_name',
'scripts': '$base/bin',
'data' : '$base',
--- Lib/distutils/sysconfig.py
+++ Lib/distutils/sysconfig.py
@@ -114,8 +114,11 @@
prefix = plat_specific and EXEC_PREFIX or PREFIX
if os.name == "posix":
- libpython = os.path.join(prefix,
- "lib", "python" + get_python_version())
+ if plat_specific or standard_lib:
+ lib = sys.lib
+ else:
+ lib = "lib"
+ libpython = os.path.join(prefix, lib, "python" + get_python_version())
if standard_lib:
return libpython
else:
--- Lib/pydoc.py
+++ Lib/pydoc.py
@@ -352,7 +352,7 @@
docloc = os.environ.get("PYTHONDOCS",
"http://docs.python.org/library")
- basedir = os.path.join(sys.exec_prefix, "lib",
+ basedir = os.path.join(sys.exec_prefix, sys.lib,
"python"+sys.version[0:3])
if (isinstance(object, type(os)) and
(object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
--- Lib/site.py
+++ Lib/site.py
@@ -300,13 +300,18 @@
if sys.platform in ('os2emx', 'riscos'):
sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
elif os.sep == '/':
- sitepackages.append(os.path.join(prefix, "lib",
+ sitepackages.append(os.path.join(prefix, sys.lib,
"python" + sys.version[:3],
"site-packages"))
- sitepackages.append(os.path.join(prefix, "lib", "site-python"))
+ sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
+ if sys.lib != "lib":
+ 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, "lib", "site-packages"))
+ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
if sys.platform == "darwin":
# for framework builds *only* we add the standard Apple
# locations.
--- Lib/sysconfig.py
+++ Lib/sysconfig.py
@@ -7,10 +7,10 @@
_INSTALL_SCHEMES = {
'posix_prefix': {
- 'stdlib': '{base}/lib/python{py_version_short}',
- 'platstdlib': '{platbase}/lib/python{py_version_short}',
+ 'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
+ 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
'purelib': '{base}/lib/python{py_version_short}/site-packages',
- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
+ 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
'include': '{base}/include/python{py_version_short}',
'platinclude': '{platbase}/include/python{py_version_short}',
'scripts': '{base}/bin',
@@ -65,10 +65,10 @@
'data' : '{userbase}',
},
'posix_user': {
- 'stdlib': '{userbase}/lib/python{py_version_short}',
- 'platstdlib': '{userbase}/lib/python{py_version_short}',
+ 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+ 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
+ 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
'include': '{userbase}/include/python{py_version_short}',
'scripts': '{userbase}/bin',
'data' : '{userbase}',
--- Lib/test/test_dl.py
+++ Lib/test/test_dl.py
@@ -5,10 +5,11 @@
import unittest
from test.test_support import verbose, import_module
dl = import_module('dl', deprecated=True)
+import sys
sharedlibs = [
- ('/usr/lib/libc.so', 'getpid'),
- ('/lib/libc.so.6', 'getpid'),
+ ('/usr/'+sys.lib+'/libc.so', 'getpid'),
+ ('/'+sys.lib+'/libc.so.6', 'getpid'),
('/usr/bin/cygwin1.dll', 'getpid'),
('/usr/lib/libc.dylib', 'getpid'),
]
--- Lib/test/test_site.py
+++ Lib/test/test_site.py
@@ -227,12 +227,16 @@
wanted = os.path.join('xoxo', 'Lib', 'site-packages')
self.assertEqual(dirs[0], wanted)
elif os.sep == '/':
- self.assertEqual(len(dirs), 2)
wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
'site-packages')
- self.assertEqual(dirs[0], wanted)
+ self.assertTrue(wanted in dirs)
wanted = os.path.join('xoxo', 'lib', 'site-python')
- self.assertEqual(dirs[1], wanted)
+ self.assertTrue(wanted in dirs)
+ wanted = os.path.join('xoxo', sys.lib, 'python' + sys.version[:3],
+ 'site-packages')
+ self.assertTrue(wanted in dirs)
+ wanted = os.path.join('xoxo', sys.lib, 'site-python')
+ self.assertTrue(wanted in dirs)
else:
self.assertEqual(len(dirs), 2)
self.assertEqual(dirs[0], 'xoxo')
--- Lib/trace.py
+++ Lib/trace.py
@@ -762,10 +762,10 @@
# should I also call expanduser? (after all, could use $HOME)
s = s.replace("$prefix",
- os.path.join(sys.prefix, "lib",
+ os.path.join(sys.prefix, sys.lib,
"python" + sys.version[:3]))
s = s.replace("$exec_prefix",
- os.path.join(sys.exec_prefix, "lib",
+ os.path.join(sys.exec_prefix, sys.lib,
"python" + sys.version[:3]))
s = os.path.normpath(s)
ignore_dirs.append(s)
--- Makefile.pre.in
+++ Makefile.pre.in
@@ -81,6 +81,8 @@
# Machine-dependent subdirectories
MACHDEP= @MACHDEP@
+LIB= @LIB@
+ARCH= @ARCH@
# Install prefix for architecture-independent files
prefix= @prefix@
@@ -532,6 +534,7 @@
-DEXEC_PREFIX='"$(exec_prefix)"' \
-DVERSION='"$(VERSION)"' \
-DVPATH='"$(VPATH)"' \
+ -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' \
-o $@ $(srcdir)/Modules/getpath.c
Modules/python.o: $(srcdir)/Modules/python.c
@@ -566,7 +569,7 @@
Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
Python/getplatform.o: $(srcdir)/Python/getplatform.c
- $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
+ $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
Python/importdl.o: $(srcdir)/Python/importdl.c
$(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
--- Modules/getpath.c
+++ Modules/getpath.c
@@ -116,9 +116,11 @@
#define EXEC_PREFIX PREFIX
#endif
+#define LIB_PYTHON LIB "/python" VERSION
+
#ifndef PYTHONPATH
-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
+#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
+ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
#endif
#ifndef LANDMARK
@@ -129,7 +131,7 @@
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[] = LIB_PYTHON;
static void
reduce(char *dir)
--- Python/getplatform.c
+++ Python/getplatform.c
@@ -10,3 +10,23 @@
{
return PLATFORM;
}
+
+#ifndef ARCH
+#define ARCH "unknown"
+#endif
+
+const char *
+Py_GetArch(void)
+{
+ return ARCH;
+}
+
+#ifndef LIB
+#define LIB "lib"
+#endif
+
+const char *
+Py_GetLib(void)
+{
+ return LIB;
+}
--- Python/sysmodule.c
+++ Python/sysmodule.c
@@ -1416,6 +1416,10 @@
PyString_FromString(Py_GetCopyright()));
SET_SYS_FROM_STRING("platform",
PyString_FromString(Py_GetPlatform()));
+ SET_SYS_FROM_STRING("arch",
+ PyString_FromString(Py_GetArch()));
+ SET_SYS_FROM_STRING("lib",
+ PyString_FromString(Py_GetLib()));
SET_SYS_FROM_STRING("executable",
PyString_FromString(Py_GetProgramFullPath()));
SET_SYS_FROM_STRING("prefix",
--- setup.py
+++ setup.py
@@ -369,7 +369,7 @@
def detect_modules(self):
# Ensure that /usr/local is always used
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/' + sys.lib)
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
self.add_multiarch_paths()
@@ -427,8 +427,7 @@
# if a file is found in one of those directories, it can
# be assumed that no additional -I,-L directives are needed.
lib_dirs = self.compiler.library_dirs + [
- '/lib64', '/usr/lib64',
- '/lib', '/usr/lib',
+ '/' + sys.lib, '/usr/' + sys.lib,
]
inc_dirs = self.compiler.include_dirs + ['/usr/include']
exts = []
@@ -677,11 +676,11 @@
elif curses_library:
readline_libs.append(curses_library)
elif self.compiler.find_library_file(lib_dirs +
- ['/usr/lib/termcap'],
+ ['/usr/'+sys.lib+'/termcap'],
'termcap'):
readline_libs.append('termcap')
exts.append( Extension('readline', ['readline.c'],
- library_dirs=['/usr/lib/termcap'],
+ library_dirs=['/usr/'+sys.lib+'/termcap'],
extra_link_args=readline_extra_link_args,
libraries=readline_libs) )
else:
@@ -1753,18 +1752,17 @@
# Check for various platform-specific directories
if platform == 'sunos5':
include_dirs.append('/usr/openwin/include')
- added_lib_dirs.append('/usr/openwin/lib')
+ added_lib_dirs.append('/usr/openwin/' + sys.lib)
elif os.path.exists('/usr/X11R6/include'):
include_dirs.append('/usr/X11R6/include')
- added_lib_dirs.append('/usr/X11R6/lib64')
- added_lib_dirs.append('/usr/X11R6/lib')
+ added_lib_dirs.append('/usr/X11R6/' + sys.lib)
elif os.path.exists('/usr/X11R5/include'):
include_dirs.append('/usr/X11R5/include')
- added_lib_dirs.append('/usr/X11R5/lib')
+ added_lib_dirs.append('/usr/X11R5/' + sys.lib)
else:
# Assume default location for X11
include_dirs.append('/usr/X11/include')
- added_lib_dirs.append('/usr/X11/lib')
+ added_lib_dirs.append('/usr/X11/' + sys.lib)
# If Cygwin, then verify that X is installed before proceeding
if platform == 'cygwin':
++++++ python-2.7rc2-canonicalize2.patch ++++++
Index: Python/sysmodule.c
===================================================================
--- Python/sysmodule.c.orig
+++ Python/sysmodule.c
@@ -1671,7 +1671,20 @@ PySys_SetArgvEx(int argc, char **argv, i
char *p = NULL;
Py_ssize_t n = 0;
PyObject *a;
-#ifdef HAVE_READLINK
+#ifdef HAVE_CANONICALIZE_FILE_NAME
+ int errnum;
+
+ if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) {
+ argv0 = canonicalize_file_name(argv0);
+ if (argv0 == NULL) argv0 = strdup(argv[0]);
+ }
+#elif defined(HAVE_REALPATH)
+ if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) {
+ if (realpath(argv0, fullpath)) {
+ argv0 = fullpath;
+ }
+ }
+#elif defined(HAVE_READLINK)
char link[MAXPATHLEN+1];
char argv0copy[2*MAXPATHLEN+1];
int nr = 0;
@@ -1698,7 +1711,8 @@ PySys_SetArgvEx(int argc, char **argv, i
}
}
}
-#endif /* HAVE_READLINK */
+#endif /* resolve method selection */
+
#if SEP == '\\' /* Special case for MS filename syntax */
if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) {
char *q;
@@ -1727,11 +1741,6 @@ PySys_SetArgvEx(int argc, char **argv, i
}
#else /* All other filename syntaxes */
if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) {
-#if defined(HAVE_REALPATH)
- if (realpath(argv0, fullpath)) {
- argv0 = fullpath;
- }
-#endif
p = strrchr(argv0, SEP);
}
if (p != NULL) {
@@ -1749,6 +1758,9 @@ PySys_SetArgvEx(int argc, char **argv, i
a = PyString_FromStringAndSize(argv0, n);
if (a == NULL)
Py_FatalError("no mem for sys.path insertion");
+#ifdef HAVE_CANONICALIZE_FILE_NAME
+ if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) free(argv0);
+#endif /* HAVE_CANONICALIZE_FILE_NAME */
if (PyList_Insert(path, 0, a) < 0)
Py_FatalError("sys.path.insert(0) failed");
Py_DECREF(a);
Index: configure.in
===================================================================
--- configure.in.orig
+++ configure.in
@@ -2728,7 +2728,7 @@ AC_CHECK_FUNCS(alarm setitimer getitimer
getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \
initgroups kill killpg lchmod lchown lstat mkfifo mknod mktime \
mremap nice pathconf pause plock poll pthread_init \
- putenv readlink realpath \
+ putenv readlink realpath canonicalize_file_name \
select sem_open sem_timedwait sem_getvalue sem_unlink setegid seteuid \
setgid \
setlocale setregid setreuid setsid setpgid setpgrp setuid setvbuf snprintf \
Index: pyconfig.h.in
===================================================================
--- pyconfig.h.in.orig
+++ pyconfig.h.in
@@ -97,6 +97,9 @@
/* Define to 1 if you have the `chflags' function. */
#undef HAVE_CHFLAGS
+/* Define to 1 if you have the `canonicalize_file_name' function. */
+#undef HAVE_CANONICALIZE_FILE_NAME
+
/* Define to 1 if you have the `chown' function. */
#undef HAVE_CHOWN
++++++ python-2.7rc2-configure.patch ++++++
Index: configure.in
===================================================================
--- configure.in.orig
+++ configure.in
@@ -3892,9 +3892,18 @@ then
fi
# check for readline 4.0
-AC_CHECK_LIB(readline, rl_pre_input_hook,
- AC_DEFINE(HAVE_RL_PRE_INPUT_HOOK, 1,
- [Define if you have readline 4.0]), ,$READLINE_LIBS)
+AC_MSG_CHECKING([for rl_pre_input_hook in -lreadline])
+AC_CACHE_VAL(ac_cv_have_rl_re_input_hook, [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include
+#include ],
+ [return rl_pre_input_hook != 0])],
+ ac_cv_have_rl_re_input_hook=yes,
+ ac_cv_have_rl_re_input_hook=no)])
+AC_MSG_RESULT($ac_cv_have_rl_re_input_hook)
+if test "$ac_cv_have_rl_re_input_hook" = yes; then
+ AC_DEFINE(HAVE_RL_PRE_INPUT_HOOK, 1,
+ [Define if you have readline 4.0])
+fi
# also in 4.0
AC_CHECK_LIB(readline, rl_completion_display_matches_hook,
++++++ python-distutils-rpm-8.patch ++++++
Index: Python-2.6.2/Lib/distutils/command/install.py
===================================================================
--- Python-2.6.2.orig/Lib/distutils/command/install.py
+++ Python-2.6.2/Lib/distutils/command/install.py
@@ -168,6 +168,8 @@ class install (Command):
('record=', None,
"filename in which to record list of installed files"),
+ ('record-rpm=', None,
+ "filename in which to record list of installed files and directories suitable as filelist for rpm"),
]
boolean_options = ['compile', 'force', 'skip-build', 'user']
@@ -243,6 +245,7 @@ class install (Command):
#self.install_info = None
self.record = None
+ self.record_rpm = None
# -- Option finalizing methods -------------------------------------
@@ -592,12 +595,61 @@ class install (Command):
self.create_path_file()
# write list of installed files, if requested.
- if self.record:
+ if self.record or self.record_rpm:
outputs = self.get_outputs()
if self.root: # strip any package prefix
root_len = len(self.root)
for counter in xrange(len(outputs)):
outputs[counter] = outputs[counter][root_len:]
+ if self.record_rpm: # add directories
+ self.record = self.record_rpm
+ dirs = []
+ # directories to reject:
+ rejectdirs = [
+ '/etc',
+ '/',
+ '',
+ self.prefix,
+ self.exec_prefix,
+ self.install_base,
+ self.install_platbase,
+ self.install_purelib,
+ self.install_platlib,
+ self.install_headers[:len(self.install_headers) - len(self.distribution.get_name()) - 1],
+ self.install_libbase,
+ self.install_scripts,
+ self.install_data,
+ os.path.join(self.install_data, 'share'),
+ os.path.join(self.install_data, 'share', 'doc'),
+ ]
+ # directories whose childs reject:
+ rejectdirs2 = [
+ os.path.join(self.install_data, 'share', 'man'),
+ ]
+ # directories whose grandsons reject:
+ rejectdirs3 = [
+ os.path.join(self.install_data, 'share', 'man'),
+ os.path.join(self.install_data, 'share', 'locale'),
+ ]
+ for counter in xrange(len(rejectdirs)):
+ if len(rejectdirs[counter]) > root_len:
+ rejectdirs[counter] = rejectdirs[counter][root_len:]
+ for counter in xrange(len(rejectdirs2)):
+ if len(rejectdirs2[counter]) > root_len:
+ rejectdirs2[counter] = rejectdirs2[counter][root_len:]
+ for counter in xrange(len(rejectdirs3)):
+ if len(rejectdirs3[counter]) > root_len:
+ rejectdirs3[counter] = rejectdirs3[counter][root_len:]
+ for counter in xrange(len(outputs)):
+ directory = os.path.dirname(outputs[counter])
+ while directory not in rejectdirs and \
+ os.path.dirname(directory) not in rejectdirs2 and \
+ os.path.dirname(os.path.dirname(directory)) not in rejectdirs3:
+ dirname = '%dir ' + directory
+ if dirname not in dirs:
+ dirs.append(dirname)
+ directory = os.path.dirname(directory)
+ outputs += dirs
self.execute(write_file,
(self.record, outputs),
"writing list of installed files to '%s'" %
++++++ python-test_structmembers.patch ++++++
Index: Modules/_testcapimodule.c
===================================================================
--- Modules/_testcapimodule.c (revision 85001)
+++ Modules/_testcapimodule.c (working copy)
@@ -5,6 +5,7 @@
* standard Python regression test, via Lib/test/test_capi.py.
*/
+#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include
#include "structmember.h"
@@ -593,7 +594,7 @@
{
PyObject *tuple, *obj;
Py_UNICODE *value;
- int len;
+ Py_ssize_t len;
/* issue4122: Undefined reference to _Py_ascii_whitespace on Windows */
/* Just use the macro and check that it compiles */
++++++ python.csh ++++++
# add python startup script for interactive sessions
setenv PYTHONSTARTUP /etc/pythonstart
++++++ python.sh ++++++
# add python startup script for interactive sessions
export PYTHONSTARTUP=/etc/pythonstart
++++++ pythonstart ++++++
# startup script for python to enable saving of interpreter history and
# enabling name completion
# import needed modules
import atexit
import os
import readline
import rlcompleter
# where is history saved
historyPath = os.path.expanduser("~/.pyhistory")
# handler for saving history
def save_history(historyPath=historyPath):
import readline
readline.write_history_file(historyPath)
# read history, if it exists
if os.path.exists(historyPath):
readline.set_history_length(10000)
readline.read_history_file(historyPath)
# register saving handler
atexit.register(save_history)
# enable completion
readline.parse_and_bind('tab: complete')
# cleanup
del os, atexit, readline, rlcompleter, save_history, historyPath
++++++ sparc_longdouble.patch ++++++
Python ticket 6029
==== //tools/python/2.6.2/src/base/Modules/_ctypes/libffi/src/sparc/ffi.c#1 - /home/build/clifford/gpdb/tools/python/2.6.2/src/base/Modules/_ctypes/libffi/src/sparc/ffi.c ====
---
Modules/_ctypes/libffi/src/sparc/ffi.c | 5 +++++
1 file changed, 5 insertions(+)
Index: Python-2.6.5/Modules/_ctypes/libffi/src/sparc/ffi.c
===================================================================
--- Python-2.6.5.orig/Modules/_ctypes/libffi/src/sparc/ffi.c
+++ Python-2.6.5/Modules/_ctypes/libffi/src/sparc/ffi.c
@@ -586,6 +586,11 @@ ffi_closure_sparc_inner_v9(ffi_closure *
}
else
{
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+ /* SparcV9 long double is 16-byte aligned; skip arg if necessary */
+ if (arg_types[i]->type == FFI_TYPE_LONGDOUBLE && (argn & 1))
+ argn++;
+#endif
/* Right-justify. */
argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org