On 01/27/2018 01:38 AM, Zac Medico wrote:
> On 01/27/2018 01:01 AM, Michał Górny wrote:
>> Fix the duplicate override of DISTDIR that happens when using
>> the 'ebuild' tool to run ebuilds. In this case, both the 'config'
>> code and the 'prepare_build_dirs' code attempt to replace DISTDIR,
>> and the shadow distdir symlinks end up pointing to themselves.
>>
>> Apparently the _prepare_fake_distdir() is passed settings containing
>> the original DISTDIR by emerge, while ebuild passes an instance
>> contaning the DISTDIR override. Try PORTAGE_ACTUAL_DISTDIR first
>> to account for both cases.
>> ---
>>  pym/portage/package/ebuild/prepare_build_dirs.py | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/pym/portage/package/ebuild/prepare_build_dirs.py 
>> b/pym/portage/package/ebuild/prepare_build_dirs.py
>> index 16afc3f98..0b6a3a4df 100644
>> --- a/pym/portage/package/ebuild/prepare_build_dirs.py
>> +++ b/pym/portage/package/ebuild/prepare_build_dirs.py
>> @@ -411,10 +411,10 @@ def _prepare_fake_filesdir(settings):
>>                      os.symlink(real_filesdir, symlink_path)
>>  
>>  def _prepare_fake_distdir(settings, alist):
>> -    orig_distdir = settings["DISTDIR"]
>> -    settings["PORTAGE_ACTUAL_DISTDIR"] = orig_distdir
>> -    edpath = settings["DISTDIR"] = \
>> -            os.path.join(settings["PORTAGE_BUILDDIR"], "distdir")
> 
> Above you've removed the only code that overrode settings["DISTDIR"],
> which is good.
> 
>> +    orig_distdir = settings.get("PORTAGE_ACTUAL_DISTDIR",
>> +                    settings.get("DISTDIR"))
>> +    assert orig_distdir
> 
> Since settings["DISTDIR"] is no longer overridden, now this is all
> that's needed:
> 
> orig_distdir = settings["DISTDIR"]

Also, we don't need this code in the doebuild function anymore:

if "PORTAGE_ACTUAL_DISTDIR" in mysettings:
        mysettings["DISTDIR"] = mysettings["PORTAGE_ACTUAL_DISTDIR"]
        del mysettings["PORTAGE_ACTUAL_DISTDIR"]
-- 
Thanks,
Zac

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to