Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 675114 - Allow overriding the location of user_patches (ie restore EPATCH_USER_SOURCE)
Summary: Allow overriding the location of user_patches (ie restore EPATCH_USER_SOURCE)
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-10 15:37 UTC by Ed Wildgoose
Modified: 2019-01-12 23:36 UTC (History)
0 users

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 Ed Wildgoose 2019-01-10 15:37:23 UTC
The ebuild documentation implies that I can set EPATCH_USER_SOURCE to override the location where I store local patches. This appears to be true for EAPI up to version 5, but not for version 6.  Up to version 5 the code is in portage eclass/epatch.class and references EPATCH_USER_SOURCE,

# @VARIABLE: EPATCH_USER_SOURCE
# @DESCRIPTION:
# Location for user patches, see the epatch_user function.
# Should be set by the user. Don't set this in ebuilds.
: ${EPATCH_USER_SOURCE:=${PORTAGE_CONFIGROOT%/}/etc/portage/patches}


However, in EAPI 6 the relevant code is defined in ..python../phase-helpers.sh, here we find:

if ___eapi_has_eapply_user; then
        eapply_user() {
                [[ ${EBUILD_PHASE} == prepare ]] || \
                        die "eapply_user() called during invalid phase: ${EBUILD_PHASE}"
                # keep path in __dyn_prepare in sync!
                local tagfile=${T}/.portage_user_patches_applied
                [[ -f ${tagfile} ]] && return
                >> "${tagfile}"

                local basedir=${PORTAGE_CONFIGROOT%/}/etc/portage/patches


So there is a hardcoded location and we cannot override it in make.conf

My use case is that I build a large (ish) number of virtual machines and I want to maintain a common "patches" directory in my custom profile. This currently requires an (error prone) solution to setup symlinks in every situation to the relevant patches location. Being able to set this in make.conf (as is possible in EAPI 5 or below) would be preferred

Feature request:
Amend the code above to be something like:

    : ${EPATCH_USER_SOURCE:=${PORTAGE_CONFIGROOT%/}/etc/portage/patches}
    local basedir=${EPATCH_USER_SOURCE}

Thanks for listening
Comment 1 Arfrever Frehtes Taifersar Arahesis 2019-01-10 22:25:07 UTC
Better name for a new variable would be USER_PATCHES_DIR or PORTAGE_USER_PATCHES_DIR.
Comment 2 Ed Wildgoose 2019-01-11 14:20:19 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #1)
> Better name for a new variable would be USER_PATCHES_DIR or
> PORTAGE_USER_PATCHES_DIR.

I'm not disagreeing, but my proposed change simply makes EAPI 6 ebuilds work the same as versions 0-5.  Your rename is a great idea, but would require updating the documentation, deprecating the old name and possibly updating the older eclass code

I think in the first instance I would prefer that we make the (very tiny) change in the EAPI6 class code so that the variable usage simply continues that of how it worked previously.  What do you think?
Comment 3 Arfrever Frehtes Taifersar Arahesis 2019-01-12 23:36:21 UTC
(In reply to Ed Wildgoose from comment #2)
> (In reply to Arfrever Frehtes Taifersar Arahesis from comment #1)
> > Better name for a new variable would be USER_PATCHES_DIR or
> > PORTAGE_USER_PATCHES_DIR.
> 
> I'm not disagreeing, but my proposed change simply makes EAPI 6 ebuilds work
> the same as versions 0-5.  Your rename is a great idea, but would require
> updating the documentation

Documentation of eclasses specifies behavior of eclasses, not package managers.
Portage is not bound by design decisions made for eclasses.

If it was otherwise, then e.g. successor of get_version_component_range (provided by versionator.eclass) could not named ver_cut (provided by package managers in EAPI >=7).