SHA256
1
0
forked from pool/python
Jan Matejek 2010-08-26 11:50:57 +00:00 committed by Git OBS Bridge
parent 0b3447338c
commit 53002793e3
13 changed files with 73 additions and 180 deletions

23
Python-2.3.3-dirs.patch Normal file
View File

@ -0,0 +1,23 @@
# force use of directories passed to configure script
Index: Makefile.pre.in
===================================================================
--- Makefile.pre.in.orig
+++ Makefile.pre.in
@@ -86,12 +86,12 @@ exec_prefix= @exec_prefix@
datarootdir= @datarootdir@
# Expanded directories
-BINDIR= $(exec_prefix)/bin
-LIBDIR= $(exec_prefix)/lib
+BINDIR= @bindir@
+LIBDIR= @libdir@
MANDIR= @mandir@
INCLUDEDIR= @includedir@
-CONFINCLUDEDIR= $(exec_prefix)/include
-SCRIPTDIR= $(prefix)/lib
+CONFINCLUDEDIR= @includedir@
+SCRIPTDIR= @libdir@
# Detailed destination directories
BINLIBDEST= $(LIBDIR)/python$(VERSION)

View File

@ -1,4 +1,4 @@
python
requires "python-base-<targettype> = <version>"
python-base
libpython2_7-1_0
libpython2_6-1_0

View File

@ -0,0 +1,16 @@
--- Lib/ssl.py
+++ Lib/ssl.py
@@ -112,12 +112,7 @@
keyfile, certfile,
cert_reqs, ssl_version, ca_certs)
if do_handshake_on_connect:
- timeout = self.gettimeout()
- try:
- self.settimeout(None)
- self.do_handshake()
- finally:
- self.settimeout(timeout)
+ self.do_handshake()
self.keyfile = keyfile
self.certfile = certfile
self.cert_reqs = cert_reqs

View File

@ -1,8 +1,8 @@
Index: Python-2.7/Lib/distutils/tests/test_build_ext.py
Index: Python-2.6.5/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
--- Python-2.6.5.orig/Lib/distutils/tests/test_build_ext.py
+++ Python-2.6.5/Lib/distutils/tests/test_build_ext.py
@@ -253,20 +253,14 @@ class BuildExtTestCase(support.TempdirMa
# issue #5977 : distutils build_ext.get_outputs
# returns wrong result with --inplace
@ -27,26 +27,3 @@ Index: Python-2.7/Lib/distutils/tests/test_build_ext.py
cmd.compiler = None
cmd.inplace = 0
cmd.run()
Index: Python-2.7/Lib/test/regrtest.py
===================================================================
--- Python-2.7.orig/Lib/test/regrtest.py
+++ Python-2.7/Lib/test/regrtest.py
@@ -1503,16 +1503,5 @@ if __name__ == '__main__':
if not os.path.exists(TEMPDIR):
os.mkdir(TEMPDIR)
- # Define a writable temp dir that will be used as cwd while running
- # the tests. The name of the dir includes the pid to allow parallel
- # testing (see the -j option).
- TESTCWD = 'test_python_{}'.format(os.getpid())
-
- TESTCWD = os.path.join(TEMPDIR, TESTCWD)
-
- # Run the tests in a context manager that temporary changes the CWD to a
- # temporary and writable directory. If it's not possible to create or
- # change the CWD, the original CWD will be used. The original CWD is
- # available from test_support.SAVEDCWD.
- with test_support.temp_cwd(TESTCWD, quiet=True):
- main()
+ # do not change directory, because it breaks distutils tests
+ main()

View File

@ -0,0 +1,11 @@
--- Modules/_ssl.c
+++ Modules/_ssl.c
@@ -311,6 +311,8 @@
goto fail;
}
+ SSL_CTX_set_options(self->ctx, SSL_OP_ALL); /* ssl compatibility */
+
if (certreq != PY_SSL_CERT_NONE) {
if (cacerts_file == NULL) {
errstr = ERRSTR("No root certificates specified for "

View File

@ -1,13 +0,0 @@
Index: Python-2.7/configure.in
===================================================================
--- Python-2.7.orig/configure.in
+++ Python-2.7/configure.in
@@ -12,7 +12,7 @@ m4_define([version_required],
[],
[m4_fatal([Autoconf version $1 is required for Python], 63)])
])
-version_required(2.65)
+dnl version_required(2.65)
AC_REVISION($Revision: 81582 $)
AC_INIT(python, PYTHON_VERSION, http://bugs.python.org/)

View File

@ -1,26 +1,3 @@
-------------------------------------------------------------------
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

View File

@ -1,5 +1,5 @@
#
# spec file for package python-base (Version 2.7)
# spec file for package python-base (Version 2.6.5)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@ -18,7 +18,7 @@
Name: python-base
BuildRequires: fdupes pkg-config zlib-devel
BuildRequires: zlib-devel fdupes pkg-config
Url: http://www.python.org/
License: MIT License (or similar)
Group: Development/Languages/Python
@ -30,7 +30,7 @@ Obsoletes: python-64bit
#
Summary: Python Interpreter base package
Version: 2.7
Release: 3
Release: 1
%define tarversion %{version}
%define tarname Python-%{tarversion}
Source0: %{tarname}.tar.bz2
@ -46,11 +46,7 @@ Patch3: Python-2.7rc2-multilib.patch
Patch4: python-2.7rc2-canonicalize2.patch
Patch5: python-2.7rc2-configure.patch
Patch6: python-2.6-gettext-plurals.patch
Patch7: python-2.6.5-distutils_test_path.patch
Patch8: sparc_longdouble.patch
Patch9: python-2.7-acrequire.patch
Patch10: urllib2-AbstractBasicAuthHandler_reset_attr.diff
Patch11: smtpd-dos.patch
Patch7: sparc_longdouble.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define python_version %(echo %{version} | head -c 3)
@ -137,10 +133,6 @@ Authors:
%patch5
%patch6
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10
%patch11
# some cleanup
find . -name .cvsignore -type f -print0 | xargs -0 rm -f
@ -162,11 +154,6 @@ 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
# use just gcc instead of [GCC 4.5.0 20100604 [gcc-4_5-branch revision 160292]..
echo '#define COMPILER "[GCC]"' >> pyconfig.h.in
# use a compilation date equivalent to the source tarball.
printf '#define DATE "%s %s %s"\n' $(date -u -r %{SOURCE0} +"%b %d %Y") >> pyconfig.h.in
printf '#define TIME "%s"\n' $(date -u -r %{SOURCE0} +"%T") >> pyconfig.h.in
########################################
# configure
########################################
@ -288,6 +275,7 @@ rm -rf $RPM_BUILD_ROOT
%{_includedir}/python*
%exclude %{_includedir}/python%{python_version}/pyconfig.h
%{_libdir}/python%{python_version}/test
%{_libdir}/python%{python_version}/unittest
%defattr(755, root, root)
%{_bindir}/python-config
%{_bindir}/python%{python_version}-config
@ -334,7 +322,6 @@ rm -rf $RPM_BUILD_ROOT
%{_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

View File

@ -1,5 +1,5 @@
#
# spec file for package python-doc (Version 2.7)
# spec file for package python-doc (Version 2.6)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@ -24,7 +24,7 @@ Group: Development/Languages/Python
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Summary: Additional Package Documentation for Python.
Version: 2.7
Release: 3
Release: 23
%define pyver 2.7
BuildArch: noarch
%define tarname Python-%{pyver}

View File

@ -1,12 +1,3 @@
-------------------------------------------------------------------
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

View File

@ -1,5 +1,5 @@
#
# spec file for package python (Version 2.7)
# spec file for package python (Version 2.6.5)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@ -18,7 +18,7 @@
Name: python
BuildRequires: db-devel fdupes gdbm-devel gmp-devel libbz2-devel libopenssl-devel ncurses-devel readline-devel sqlite-devel tk-devel xorg-x11-devel
BuildRequires: db-devel gdbm-devel gmp-devel libbz2-devel libopenssl-devel ncurses-devel readline-devel sqlite-devel tk-devel xorg-x11-devel fdupes
#Requires: openssl >= 0.9.8e
Url: http://www.python.org/
License: MIT License (or similar)
@ -32,7 +32,7 @@ Obsoletes: python-64bit
Obsoletes: python-nothreads python21 python-elementtree python-sqlite
Summary: Python Interpreter
Version: 2.7
Release: 3
Release: 2
Requires: python-base = %{version}
%define tarversion %{version}
%define tarname Python-%{tarversion}
@ -50,7 +50,6 @@ Patch4: python-2.5.1-sqlite.patch
Patch5: python-2.7rc2-configure.patch
Patch6: python-2.6b3-curses-panel.patch
Patch7: sparc_longdouble.patch
Patch8: python-2.7-acrequire.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define python_version %(echo %{version} | head -c 3)
@ -178,10 +177,13 @@ Authors:
%patch2 -p1
%patch3
%patch4
#%if 0%{?suse_version}
#%endif
%patch5
%if %suse_version > 1100
%patch6
%endif
%patch7 -p1
%patch8 -p1
# some cleanup
find . -name .cvsignore -type f -print0 | xargs -0 rm -f
find . -name CVS -type d -print0 | xargs -0 rm -rf
@ -202,11 +204,6 @@ 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
# use just gcc instead of [GCC 4.5.0 20100604 [gcc-4_5-branch revision 160292]..
echo '#define COMPILER "[GCC]"' >> pyconfig.h.in
# use a compilation date equivalent to the source tarball.
printf '#define DATE "%s %s %s"\n' $(date -u -r %{SOURCE0} +"%b %d %Y") >> pyconfig.h.in
printf '#define TIME "%s"\n' $(date -u -r %{SOURCE0} +"%T") >> pyconfig.h.in
########################################
# configure
########################################
@ -385,9 +382,11 @@ install -m 644 %{S:3} %{S:4} $RPM_BUILD_ROOT/etc/profile.d
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%post
%{run_ldconfig}
%postun -p /sbin/ldconfig
%postun
%{run_ldconfig}
%files idle
%defattr(644, root, root, 755)

View File

@ -1,48 +0,0 @@
Index: Lib/smtpd.py
===================================================================
--- Lib/smtpd.py.orig
+++ Lib/smtpd.py
@@ -121,7 +121,16 @@ class SMTPChannel(asynchat.async_chat):
self.__rcpttos = []
self.__data = ''
self.__fqdn = socket.getfqdn()
- self.__peer = conn.getpeername()
+ try:
+ self.__peer = conn.getpeername()
+ except socket.error as err:
+ # a race condition may occur if the other end is closing
+ # before we can get the peername
+ #self.connected = False
+ self.close()
+ if err.args[0] != errno.ENOTCONN:
+ raise
+ return
print >> DEBUGSTREAM, 'Peer:', repr(self.__peer)
self.push('220 %s %s' % (self.__fqdn, __version__))
self.set_terminator('\r\n')
@@ -291,9 +300,24 @@ class SMTPServer(asyncore.dispatcher):
localaddr, remoteaddr)
def handle_accept(self):
- conn, addr = self.accept()
+ try:
+ conn, addr = self.accept()
+ except TypeError:
+ # sometimes accept() might return None
+ return
+ except socket.error as err:
+ # ECONNABORTED might be thrown
+ if err.args[0] != errno.ECONNABORTED:
+ raise
+ return
+ else:
+ # sometimes addr == None instead of (ip, port)
+ if addr == None:
+ return
print >> DEBUGSTREAM, 'Incoming connection from %s' % repr(addr)
channel = SMTPChannel(self, conn, addr)
+ if not channel.connected:
+ return
# API for "doing something useful with the message"
def process_message(self, peer, mailfrom, rcpttos, data):

View File

@ -1,27 +0,0 @@
Index: Lib/urllib2.py
===================================================================
--- Lib/urllib2.py (Revision 84196)
+++ Lib/urllib2.py (Arbeitskopie)
@@ -821,6 +821,9 @@
self.add_password = self.passwd.add_password
self.retried = 0
+ def reset_retry_count(self):
+ self.retried = 0
+
def http_error_auth_reqed(self, authreq, host, req, headers):
# host may be an authority (without userinfo) or a URL with an
# authority
@@ -860,8 +863,10 @@
def http_error_401(self, req, fp, code, msg, headers):
url = req.get_full_url()
- return self.http_error_auth_reqed('www-authenticate',
- url, req, headers)
+ response = self.http_error_auth_reqed('www-authenticate',
+ url, req, headers)
+ self.reset_retry_count()
+ return response
class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler):