packages: python3/python3.spec, python3/python3-bug11254.patch (NEW) - adde...

wrobell wrobell at pld-linux.org
Sun May 22 03:15:25 CEST 2011


Author: wrobell                      Date: Sun May 22 01:15:25 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- added patch to fix bug 11254
- rel. 0.3

---- Files affected:
packages/python3:
   python3.spec (1.47 -> 1.48) , python3-bug11254.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/python3/python3.spec
diff -u packages/python3/python3.spec:1.47 packages/python3/python3.spec:1.48
--- packages/python3/python3.spec:1.47	Sat May 21 22:33:52 2011
+++ packages/python3/python3.spec	Sun May 22 03:15:20 2011
@@ -35,7 +35,7 @@
 Summary(uk.UTF-8):	Мова програмування дуже високого рівня з X-інтерфейсом
 Name:		python3
 Version:	%{py_ver}
-Release:	0.2
+Release:	0.3
 Epoch:		1
 License:	PSF
 Group:		Applications
@@ -45,6 +45,7 @@
 Patch1:		%{name}-ac_fixes.patch
 Patch2:		%{name}-lib64.patch
 Patch3:		%{name}-noarch_to_datadir.patch
+Patch4:		%{name}-bug11254.patch
 URL:		http://www.python.org/
 BuildRequires:	autoconf
 BuildRequires:	bluez-libs-devel
@@ -443,6 +444,7 @@
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 %build
 %{__autoconf}
@@ -908,6 +910,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.48  2011/05/22 01:15:20  wrobell
+- added patch to fix bug 11254
+- rel. 0.3
+
 Revision 1.47  2011/05/21 20:33:52  wrobell
 - more lib64 fixes
 - ver. 0.2

================================================================
Index: packages/python3/python3-bug11254.patch
diff -u /dev/null packages/python3/python3-bug11254.patch:1.1
--- /dev/null	Sun May 22 03:15:25 2011
+++ packages/python3/python3-bug11254.patch	Sun May 22 03:15:20 2011
@@ -0,0 +1,80 @@
+diff --git a/Lib/distutils/tests/test_build_py.py b/Lib/distutils/tests/test_build_py.py
+--- a/Lib/distutils/tests/test_build_py.py
++++ b/Lib/distutils/tests/test_build_py.py
+@@ -3,6 +3,7 @@
+ import os
+ import sys
+ import io
++import imp
+ import unittest
+ 
+ from distutils.command.build_py import build_py
+@@ -57,9 +58,11 @@ class BuildPyTestCase(support.TempdirMan
+         self.assertEqual(len(cmd.get_outputs()), 3)
+         pkgdest = os.path.join(destination, "pkg")
+         files = os.listdir(pkgdest)
+-        self.assertTrue("__init__.py" in files)
+-        self.assertTrue("__init__.pyc" in files)
+-        self.assertTrue("README.txt" in files)
++        byte_compiled_files = os.listdir(os.path.join(pkgdest, "__pycache__"))
++        self.assertIn("__init__.py", files)
++        self.assertIn("__init__.{}.pyc".format(imp.get_tag()),
++                      byte_compiled_files)
++        self.assertIn("README.txt", files)
+ 
+     def test_empty_package_dir (self):
+         # See SF 1668596/1720897.
+diff --git a/Lib/distutils/tests/test_install_lib.py b/Lib/distutils/tests/test_install_lib.py
+--- a/Lib/distutils/tests/test_install_lib.py
++++ b/Lib/distutils/tests/test_install_lib.py
+@@ -1,6 +1,7 @@
+ """Tests for distutils.command.install_data."""
+ import sys
+ import os
++import imp
+ import unittest
+ 
+ from distutils.command.install_lib import install_lib
+@@ -36,14 +37,19 @@ class InstallLibTestCase(support.Tempdir
+                          'byte-compile not supported')
+     def test_byte_compile(self):
+         pkg_dir, dist = self.create_dist()
++        cache_dir = os.path.join(pkg_dir, '__pycache__')
+         cmd = install_lib(dist)
+         cmd.compile = cmd.optimize = 1
+ 
+         f = os.path.join(pkg_dir, 'foo.py')
+         self.write_file(f, '# python file')
+         cmd.byte_compile([f])
+-        self.assertTrue(os.path.exists(os.path.join(pkg_dir, 'foo.pyc')))
+-        self.assertTrue(os.path.exists(os.path.join(pkg_dir, 'foo.pyo')))
++        compiled_file = os.path.join(cache_dir,
++                                     "foo.{}.pyc".format(imp.get_tag()))
++        optimized_file = os.path.join(cache_dir,
++                                      "foo.{}.pyo".format(imp.get_tag()))
++        self.assertTrue(os.path.exists(compiled_file))
++        self.assertTrue(os.path.exists(optimized_file))
+ 
+     def test_get_outputs(self):
+         pkg_dir, dist = self.create_dist()
+diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py
+--- a/Lib/distutils/util.py
++++ b/Lib/distutils/util.py
+@@ -6,7 +6,7 @@ one of the other *util.py modules.
+ 
+ __revision__ = "$Id$"
+ 
+-import sys, os, string, re
++import sys, os, string, re, imp
+ from distutils.errors import DistutilsPlatformError
+ from distutils.dep_util import newer
+ from distutils.spawn import spawn
+@@ -533,7 +533,7 @@ byte_compile(files, optimize=%r, force=%
+             # Terminology from the py_compile module:
+             #   cfile - byte-compiled file
+             #   dfile - purported source filename (same as 'file' by default)
+-            cfile = file + (__debug__ and "c" or "o")
++            cfile = imp.cache_from_source(file, debug_override=not optimize)
+             dfile = file
+             if prefix:
+                 if file[:len(prefix)] != prefix:
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/python3/python3.spec?r1=1.47&r2=1.48&f=u



More information about the pld-cvs-commit mailing list