Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F165105606
D4832.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
13 KB
Referenced Files
None
Subscribers
None
D4832.id.diff
View Options
Index: head/lang/python27/Makefile
===================================================================
--- head/lang/python27/Makefile
+++ head/lang/python27/Makefile
@@ -2,6 +2,7 @@
PORTNAME= python27
PORTVERSION= ${PYTHON_PORTVERSION}
+PORTREVISION= 1
CATEGORIES= lang python ipv6
MASTER_SITES= PYTHON/ftp/python/${PORTVERSION}
DISTNAME= Python-${PORTVERSION}
Index: head/lang/python27/files/patch-Lib_distutils_command_install__lib.py
===================================================================
--- head/lang/python27/files/patch-Lib_distutils_command_install__lib.py
+++ head/lang/python27/files/patch-Lib_distutils_command_install__lib.py
@@ -0,0 +1,34 @@
+From 9934ce31b8447667f71c211e559a8de71e8263db Mon Sep 17 00:00:00 2001
+From: Brendan Molloy <brendan@bbqsrc.net>
+Date: Mon, 4 Jan 2016 23:14:06 +1100
+Subject: [PATCH] Check bytecode file actually exists and tests
+
+Should solve issue 20397, where using the --record argument results
+in files that failed to generate bytecode files are added to the
+record file nonetheless.
+---
+ Lib/distutils/command/install_lib.py | 17 +++++++++++++----
+ Lib/distutils/tests/test_install_lib.py | 8 ++++++--
+ 2 files changed, 19 insertions(+), 6 deletions(-)
+
+--- Lib/distutils/command/install_lib.py.orig 2015-12-05 19:46:56 UTC
++++ Lib/distutils/command/install_lib.py
+@@ -168,10 +168,14 @@ class install_lib(Command):
+ ext = os.path.splitext(os.path.normcase(py_file))[1]
+ if ext != PYTHON_SOURCE_EXTENSION:
+ continue
+- if self.compile:
+- bytecode_files.append(py_file + "c")
+- if self.optimize > 0:
+- bytecode_files.append(py_file + "o")
++
++ pyc_file = py_file + "c"
++ if self.compile and os.path.isfile(pyc_file):
++ bytecode_files.append(pyc_file)
++
++ pyo_file = py_file + "o"
++ if self.optimize > 0 and os.path.isfile(pyo_file):
++ bytecode_files.append(pyo_file)
+
+ return bytecode_files
+
Index: head/lang/python27/files/patch-Lib_distutils_tests_test__install__lib.py
===================================================================
--- head/lang/python27/files/patch-Lib_distutils_tests_test__install__lib.py
+++ head/lang/python27/files/patch-Lib_distutils_tests_test__install__lib.py
@@ -0,0 +1,30 @@
+From 9934ce31b8447667f71c211e559a8de71e8263db Mon Sep 17 00:00:00 2001
+From: Brendan Molloy <brendan@bbqsrc.net>
+Date: Mon, 4 Jan 2016 23:14:06 +1100
+Subject: [PATCH] Check bytecode file actually exists and tests
+
+Should solve issue 20397, where using the --record argument results
+in files that failed to generate bytecode files are added to the
+record file nonetheless.
+---
+ Lib/distutils/command/install_lib.py | 17 +++++++++++++----
+ Lib/distutils/tests/test_install_lib.py | 8 ++++++--
+ 2 files changed, 19 insertions(+), 6 deletions(-)
+
+--- Lib/distutils/tests/test_install_lib.py.orig 2015-12-05 19:46:57 UTC
++++ Lib/distutils/tests/test_install_lib.py
+@@ -64,8 +64,12 @@ class InstallLibTestCase(support.Tempdir
+ cmd.distribution.packages = [pkg_dir]
+ cmd.distribution.script_name = 'setup.py'
+
+- # get_output should return 4 elements
+- self.assertGreaterEqual(len(cmd.get_outputs()), 2)
++ # Create rubbish, uncompilable file
++ f = os.path.join(pkg_dir, 'rubbish.py')
++ self.write_file(f, 'rubbish()')
++
++ # get_output should return 3 elements
++ self.assertEqual(len(cmd.get_outputs()), 3)
+
+ def test_get_inputs(self):
+ pkg_dir, dist = self.create_dist()
Index: head/lang/python32/Makefile
===================================================================
--- head/lang/python32/Makefile
+++ head/lang/python32/Makefile
@@ -2,6 +2,7 @@
PORTNAME= python32
PORTVERSION= ${PYTHON_PORTVERSION}
+PORTREVISION= 1
CATEGORIES= lang python ipv6
MASTER_SITES= PYTHON/ftp/python/${PORTVERSION}
DISTNAME= Python-${PORTVERSION}
Index: head/lang/python32/files/patch-Lib_distutils_command_install__lib.py
===================================================================
--- head/lang/python32/files/patch-Lib_distutils_command_install__lib.py
+++ head/lang/python32/files/patch-Lib_distutils_command_install__lib.py
@@ -0,0 +1,34 @@
+From 9934ce31b8447667f71c211e559a8de71e8263db Mon Sep 17 00:00:00 2001
+From: Brendan Molloy <brendan@bbqsrc.net>
+Date: Mon, 4 Jan 2016 23:14:06 +1100
+Subject: [PATCH] Check bytecode file actually exists and tests
+
+Should solve issue 20397, where using the --record argument results
+in files that failed to generate bytecode files are added to the
+record file nonetheless.
+
+--- Lib/distutils/command/install_lib.py.orig 2014-10-12 06:52:02 UTC
++++ Lib/distutils/command/install_lib.py
+@@ -165,11 +165,18 @@ class install_lib(Command):
+ if ext != PYTHON_SOURCE_EXTENSION:
+ continue
+ if self.compile:
+- bytecode_files.append(imp.cache_from_source(
+- py_file, debug_override=True))
++ candidate = imp.cache_from_source(
++ py_file, debug_override=True)
++
++ if os.path.isfile(candidate):
++ bytecode_files.append(candidate)
++
+ if self.optimize > 0:
+- bytecode_files.append(imp.cache_from_source(
+- py_file, debug_override=False))
++ candidate = imp.cache_from_source(
++ py_file, debug_override=False)
++
++ if os.path.isfile(candidate):
++ bytecode_files.append(candidate)
+
+ return bytecode_files
+
Index: head/lang/python33/Makefile
===================================================================
--- head/lang/python33/Makefile
+++ head/lang/python33/Makefile
@@ -2,7 +2,7 @@
PORTNAME= python33
PORTVERSION= ${PYTHON_PORTVERSION}
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= lang python ipv6
MASTER_SITES= PYTHON/ftp/python/${PORTVERSION}
DISTNAME= Python-${PORTVERSION}
Index: head/lang/python33/files/patch-Lib_distutils_command_install__lib.py
===================================================================
--- head/lang/python33/files/patch-Lib_distutils_command_install__lib.py
+++ head/lang/python33/files/patch-Lib_distutils_command_install__lib.py
@@ -0,0 +1,34 @@
+From 9934ce31b8447667f71c211e559a8de71e8263db Mon Sep 17 00:00:00 2001
+From: Brendan Molloy <brendan@bbqsrc.net>
+Date: Mon, 4 Jan 2016 23:14:06 +1100
+Subject: [PATCH] Check bytecode file actually exists and tests
+
+Should solve issue 20397, where using the --record argument results
+in files that failed to generate bytecode files are added to the
+record file nonetheless.
+
+--- Lib/distutils/command/install_lib.py.orig 2014-10-12 06:52:02 UTC
++++ Lib/distutils/command/install_lib.py
+@@ -165,11 +165,18 @@ class install_lib(Command):
+ if ext != PYTHON_SOURCE_EXTENSION:
+ continue
+ if self.compile:
+- bytecode_files.append(imp.cache_from_source(
+- py_file, debug_override=True))
++ candidate = imp.cache_from_source(
++ py_file, debug_override=True)
++
++ if os.path.isfile(candidate):
++ bytecode_files.append(candidate)
++
+ if self.optimize > 0:
+- bytecode_files.append(imp.cache_from_source(
+- py_file, debug_override=False))
++ candidate = imp.cache_from_source(
++ py_file, debug_override=False)
++
++ if os.path.isfile(candidate):
++ bytecode_files.append(candidate)
+
+ return bytecode_files
+
Index: head/lang/python34/Makefile
===================================================================
--- head/lang/python34/Makefile
+++ head/lang/python34/Makefile
@@ -3,7 +3,7 @@
PORTNAME= python34
PORTVERSION= ${PYTHON_PORTVERSION}
-PORTREVISION= 0
+PORTREVISION= 1
CATEGORIES= lang python ipv6
MASTER_SITES= PYTHON/ftp/python/${PORTVERSION}
DISTNAME= Python-${PORTVERSION}
Index: head/lang/python34/files/patch-Lib_distutils_command_install__lib.py
===================================================================
--- head/lang/python34/files/patch-Lib_distutils_command_install__lib.py
+++ head/lang/python34/files/patch-Lib_distutils_command_install__lib.py
@@ -0,0 +1,35 @@
+From 9934ce31b8447667f71c211e559a8de71e8263db Mon Sep 17 00:00:00 2001
+From: Brendan Molloy <brendan@bbqsrc.net>
+Date: Mon, 4 Jan 2016 23:14:06 +1100
+Subject: [PATCH] Check bytecode file actually exists and tests
+
+Should solve issue 20397, where using the --record argument results
+in files that failed to generate bytecode files are added to the
+record file nonetheless.
+
+--- Lib/distutils/command/install_lib.py.orig 2016-01-08 12:38:49 UTC
++++ Lib/distutils/command/install_lib.py
+@@ -165,11 +165,19 @@ class install_lib(Command):
+ if ext != PYTHON_SOURCE_EXTENSION:
+ continue
+ if self.compile:
+- bytecode_files.append(importlib.util.cache_from_source(
+- py_file, debug_override=True))
++ candidate = importlib.util.cache_from_source(
++ py_file, debug_override=True)
++
++ if os.path.isfile(candidate):
++ bytecode_files.append(candidate)
++
+ if self.optimize > 0:
+- bytecode_files.append(importlib.util.cache_from_source(
+- py_file, debug_override=False))
++ candidate = importlib.util.cache_from_source(
++ py_file, debug_override=False)
++
++ if os.path.isfile(candidate):
++ bytecode_files.append(candidate)
++
+
+ return bytecode_files
+
Index: head/lang/python35/Makefile
===================================================================
--- head/lang/python35/Makefile
+++ head/lang/python35/Makefile
@@ -3,6 +3,7 @@
PORTNAME= python
DISTVERSION= ${PYTHON_PORTVERSION}
+PORTREVISION= 1
CATEGORIES= lang python ipv6
MASTER_SITES= PYTHON/ftp/python/${PYTHON_PORTVERSION}
PKGNAMESUFFIX= ${PYTHON_SUFFIX}
Index: head/lang/python35/files/patch-Lib_distutils_command_install__lib.py
===================================================================
--- head/lang/python35/files/patch-Lib_distutils_command_install__lib.py
+++ head/lang/python35/files/patch-Lib_distutils_command_install__lib.py
@@ -0,0 +1,41 @@
+From 9934ce31b8447667f71c211e559a8de71e8263db Mon Sep 17 00:00:00 2001
+From: Brendan Molloy <brendan@bbqsrc.net>
+Date: Mon, 4 Jan 2016 23:14:06 +1100
+Subject: [PATCH] Check bytecode file actually exists and tests
+
+Should solve issue 20397, where using the --record argument results
+in files that failed to generate bytecode files are added to the
+record file nonetheless.
+---
+ Lib/distutils/command/install_lib.py | 17 +++++++++++++----
+ Lib/distutils/tests/test_install_lib.py | 8 ++++++--
+ 2 files changed, 19 insertions(+), 6 deletions(-)
+
+--- Lib/distutils/command/install_lib.py.orig 2015-12-07 01:39:07 UTC
++++ Lib/distutils/command/install_lib.py
+@@ -164,12 +164,21 @@ class install_lib(Command):
+ ext = os.path.splitext(os.path.normcase(py_file))[1]
+ if ext != PYTHON_SOURCE_EXTENSION:
+ continue
++
+ if self.compile:
+- bytecode_files.append(importlib.util.cache_from_source(
+- py_file, optimization=''))
++ candidate = importlib.util.cache_from_source(
++ py_file, optimization='')
++
++ if os.path.isfile(candidate):
++ bytecode_files.append(candidate)
++
+ if self.optimize > 0:
+- bytecode_files.append(importlib.util.cache_from_source(
+- py_file, optimization=self.optimize))
++ candidate = importlib.util.cache_from_source(
++ py_file, optimization=self.optimize)
++
++ if os.path.isfile(candidate):
++ bytecode_files.append(candidate)
++
+
+ return bytecode_files
+
Index: head/lang/python35/files/patch-Lib_distutils_tests_test__install__lib.py
===================================================================
--- head/lang/python35/files/patch-Lib_distutils_tests_test__install__lib.py
+++ head/lang/python35/files/patch-Lib_distutils_tests_test__install__lib.py
@@ -0,0 +1,33 @@
+From 9934ce31b8447667f71c211e559a8de71e8263db Mon Sep 17 00:00:00 2001
+From: Brendan Molloy <brendan@bbqsrc.net>
+Date: Mon, 4 Jan 2016 23:14:06 +1100
+Subject: [PATCH] Check bytecode file actually exists and tests
+
+Should solve issue 20397, where using the --record argument results
+in files that failed to generate bytecode files are added to the
+record file nonetheless.
+---
+ Lib/distutils/command/install_lib.py | 17 +++++++++++++----
+ Lib/distutils/tests/test_install_lib.py | 8 ++++++--
+ 2 files changed, 19 insertions(+), 6 deletions(-)
+
+--- Lib/distutils/tests/test_install_lib.py.orig 2015-12-07 01:39:07 UTC
++++ Lib/distutils/tests/test_install_lib.py
+@@ -64,11 +64,15 @@ class InstallLibTestCase(support.Tempdir
+ cmd.distribution.ext_modules = [Extension('foo', ['xxx'])]
+ cmd.distribution.packages = ['spam']
+ cmd.distribution.script_name = 'setup.py'
++
++ # Create rubbish, uncompilable file
++ f = os.path.join(project_dir, 'spam', 'rubbish.py')
++ self.write_file(f, 'rubbish()')
+
+ # get_outputs should return 4 elements: spam/__init__.py and .pyc,
+- # foo.import-tag-abiflags.so / foo.pyd
++ # foo.import-tag-abiflags.so / foo.pyd and rubbish.py (no .pyc)
+ outputs = cmd.get_outputs()
+- self.assertEqual(len(outputs), 4, outputs)
++ self.assertEqual(len(outputs), 5, outputs)
+
+ def test_get_inputs(self):
+ project_dir, dist = self.create_dist()
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Aug 7, 2:19 AM (13 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36143345
Default Alt Text
D4832.id.diff (13 KB)
Attached To
Mode
D4832: lang/python{27,3*}: Backport upstream issue 20397 patches
Attached
Detach File
Event Timeline
Log In to Comment