Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 612972 - Portage should use a consistent value for DISTDIR in the ebuild environment
Summary: Portage should use a consistent value for DISTDIR in the ebuild environment
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL: https://archives.gentoo.org/gentoo-po...
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 649712 645194
  Show dependency tree
 
Reported: 2017-03-18 06:54 UTC by Ulrich Müller
Modified: 2018-06-03 16:42 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Müller gentoo-dev 2017-03-18 06:54:22 UTC
In EAPI 6 ebuilds can apply patches in default_src_prepare by assigning the PATCHES variable in global scope. For example:

PATCHES=( "${DISTDIR}"/foo.patch )

Similar to FILESDIR, DISTDIR should have the same value in global scope as it has in the src_* phases. Otherwise, PATCHES could contain a file that is not in ${A}, which defeats the purpose of having a fake DISTDIR.
Comment 1 Larry the Git Cow gentoo-dev 2018-01-26 14:59:06 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=8aa99e78bb89615bb25044183e160a7bf7facc2d

commit 8aa99e78bb89615bb25044183e160a7bf7facc2d
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2018-01-25 08:29:07 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2018-01-26 14:58:59 +0000

    portage.package.ebuild.config: Override DISTDIR unconditionally
    
    Ensure that DISTDIR is always defined to the path to the shadow
    directory. This ensures that PMS rules for consistent value are
    followed, and that no global scope calls should be able to access
    the distfile directory. This also ensures that global-scope assignments
    (e.g. in PATCHES) do not work around the shadow directory.
    
    Bug: https://bugs.gentoo.org/612972
    Reviewed-by: Zac Medico <zmedico@gentoo.org>

 pym/portage/package/ebuild/config.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)}