1 |
On 01/27/2018 01:38 AM, Zac Medico wrote: |
2 |
> On 01/27/2018 01:01 AM, Michał Górny wrote: |
3 |
>> Fix the duplicate override of DISTDIR that happens when using |
4 |
>> the 'ebuild' tool to run ebuilds. In this case, both the 'config' |
5 |
>> code and the 'prepare_build_dirs' code attempt to replace DISTDIR, |
6 |
>> and the shadow distdir symlinks end up pointing to themselves. |
7 |
>> |
8 |
>> Apparently the _prepare_fake_distdir() is passed settings containing |
9 |
>> the original DISTDIR by emerge, while ebuild passes an instance |
10 |
>> contaning the DISTDIR override. Try PORTAGE_ACTUAL_DISTDIR first |
11 |
>> to account for both cases. |
12 |
>> --- |
13 |
>> pym/portage/package/ebuild/prepare_build_dirs.py | 8 ++++---- |
14 |
>> 1 file changed, 4 insertions(+), 4 deletions(-) |
15 |
>> |
16 |
>> diff --git a/pym/portage/package/ebuild/prepare_build_dirs.py b/pym/portage/package/ebuild/prepare_build_dirs.py |
17 |
>> index 16afc3f98..0b6a3a4df 100644 |
18 |
>> --- a/pym/portage/package/ebuild/prepare_build_dirs.py |
19 |
>> +++ b/pym/portage/package/ebuild/prepare_build_dirs.py |
20 |
>> @@ -411,10 +411,10 @@ def _prepare_fake_filesdir(settings): |
21 |
>> os.symlink(real_filesdir, symlink_path) |
22 |
>> |
23 |
>> def _prepare_fake_distdir(settings, alist): |
24 |
>> - orig_distdir = settings["DISTDIR"] |
25 |
>> - settings["PORTAGE_ACTUAL_DISTDIR"] = orig_distdir |
26 |
>> - edpath = settings["DISTDIR"] = \ |
27 |
>> - os.path.join(settings["PORTAGE_BUILDDIR"], "distdir") |
28 |
> |
29 |
> Above you've removed the only code that overrode settings["DISTDIR"], |
30 |
> which is good. |
31 |
> |
32 |
>> + orig_distdir = settings.get("PORTAGE_ACTUAL_DISTDIR", |
33 |
>> + settings.get("DISTDIR")) |
34 |
>> + assert orig_distdir |
35 |
> |
36 |
> Since settings["DISTDIR"] is no longer overridden, now this is all |
37 |
> that's needed: |
38 |
> |
39 |
> orig_distdir = settings["DISTDIR"] |
40 |
|
41 |
Also, we don't need this code in the doebuild function anymore: |
42 |
|
43 |
if "PORTAGE_ACTUAL_DISTDIR" in mysettings: |
44 |
mysettings["DISTDIR"] = mysettings["PORTAGE_ACTUAL_DISTDIR"] |
45 |
del mysettings["PORTAGE_ACTUAL_DISTDIR"] |
46 |
-- |
47 |
Thanks, |
48 |
Zac |