1 |
commit: 989d3afa60f33f990a777c254afe4dfe4e248f3a |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Apr 28 09:06:24 2020 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Apr 28 09:09:24 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=989d3afa |
7 |
|
8 |
dev-python/python-distutils-extra: Fix --skip-build support |
9 |
|
10 |
Closes: https://bugs.gentoo.org/718394 |
11 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
12 |
|
13 |
.../python-distutils-extra-2.44-skip-build.patch | 63 ++++++++++++++++++++++ |
14 |
...build => python-distutils-extra-2.44-r1.ebuild} | 1 + |
15 |
2 files changed, 64 insertions(+) |
16 |
|
17 |
diff --git a/dev-python/python-distutils-extra/files/python-distutils-extra-2.44-skip-build.patch b/dev-python/python-distutils-extra/files/python-distutils-extra-2.44-skip-build.patch |
18 |
new file mode 100644 |
19 |
index 00000000000..f2a19990ed3 |
20 |
--- /dev/null |
21 |
+++ b/dev-python/python-distutils-extra/files/python-distutils-extra-2.44-skip-build.patch |
22 |
@@ -0,0 +1,63 @@ |
23 |
+From 4f5e11110ce9cc3f511c798acfc009ce5db4e9ef Mon Sep 17 00:00:00 2001 |
24 |
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o> |
25 |
+Date: Tue, 28 Apr 2020 10:48:18 +0200 |
26 |
+Subject: [PATCH] Fix install_auto command with --skip-build |
27 |
+ |
28 |
+python-distutils-extra seems to rely on a very bad practice of modifying |
29 |
+internal state (file lists) in middle of `build` commands. As a result, |
30 |
+if the package is installed via `build` command followed by `install |
31 |
+--skip-build` (since everything was built already!), most of the files |
32 |
+are not installed. |
33 |
+ |
34 |
+Ideally, this would be resolved by making internal state updates |
35 |
+independent of `build` command execution. However, given that |
36 |
+the package is not really alive and worth the effort, let's settle |
37 |
+on a cheap hack of calling all `build_*` subcommands from `install` |
38 |
+if `--skip-build` is used. This partially reverses what standard |
39 |
+distutils `install` command does but it will rebuild only the data files |
40 |
+rather than all C extensions. |
41 |
+ |
42 |
+Modify tests to use `--skip-build` unconditionally to test this better. |
43 |
+Testing both scenarios probably makes little sense. |
44 |
+--- |
45 |
+ DistUtilsExtra/auto.py | 7 +++++++ |
46 |
+ test/auto.py | 5 +++-- |
47 |
+ 2 files changed, 10 insertions(+), 2 deletions(-) |
48 |
+ |
49 |
+diff --git a/DistUtilsExtra/auto.py b/DistUtilsExtra/auto.py |
50 |
+index ea15183..db45f7a 100644 |
51 |
+--- a/DistUtilsExtra/auto.py |
52 |
++++ b/DistUtilsExtra/auto.py |
53 |
+@@ -711,6 +711,13 @@ class sdist_auto(distutils.command.sdist.sdist): |
54 |
+ |
55 |
+ class install_auto(distutils.command.install.install): |
56 |
+ def run(self): |
57 |
++ # run build_* subcommands to get file lists if install command |
58 |
++ # won't run 'build' for us |
59 |
++ if self.skip_build: |
60 |
++ self.run_command('build_help') |
61 |
++ self.run_command('build_i18n') |
62 |
++ self.run_command('build_icons') |
63 |
++ |
64 |
+ # install files from etc/ |
65 |
+ if os.path.isdir('etc'): |
66 |
+ # work around a bug in copy_tree() which fails with "File exists" on |
67 |
+diff --git a/test/auto.py b/test/auto.py |
68 |
+index b9644ba..15780c6 100755 |
69 |
+--- a/test/auto.py |
70 |
++++ b/test/auto.py |
71 |
+@@ -873,8 +873,9 @@ print ('import iamnota.module') |
72 |
+ ''' |
73 |
+ self.install_tree = tempfile.mkdtemp() |
74 |
+ |
75 |
+- return self.setup_py(['install', '--no-compile', '--prefix=/usr', |
76 |
+- '--root=' + self.install_tree]) |
77 |
++ self.setup_py(['build']) |
78 |
++ return self.setup_py(['install', '--no-compile', '--skip-build', |
79 |
++ '--prefix=/usr', '--root=' + self.install_tree]) |
80 |
+ |
81 |
+ def installed_files(self): |
82 |
+ '''Return list of file paths in install tree.''' |
83 |
+-- |
84 |
+2.26.2 |
85 |
+ |
86 |
|
87 |
diff --git a/dev-python/python-distutils-extra/python-distutils-extra-2.44.ebuild b/dev-python/python-distutils-extra/python-distutils-extra-2.44-r1.ebuild |
88 |
similarity index 94% |
89 |
rename from dev-python/python-distutils-extra/python-distutils-extra-2.44.ebuild |
90 |
rename to dev-python/python-distutils-extra/python-distutils-extra-2.44-r1.ebuild |
91 |
index 7b03b650654..459bb16f3d8 100644 |
92 |
--- a/dev-python/python-distutils-extra/python-distutils-extra-2.44.ebuild |
93 |
+++ b/dev-python/python-distutils-extra/python-distutils-extra-2.44-r1.ebuild |
94 |
@@ -32,6 +32,7 @@ BDEPEND=" |
95 |
|
96 |
PATCHES=( |
97 |
"${FILESDIR}"/python-distutils-extra-2.44-test.patch |
98 |
+ "${FILESDIR}"/python-distutils-extra-2.44-skip-build.patch |
99 |
) |
100 |
|
101 |
python_test() { |