Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 567504 - eutils.eclass, libtool.eclass: Improve eutils_elt_patch_dir(), libtool_elt_patch_dir()
Summary: eutils.eclass, libtool.eclass: Improve eutils_elt_patch_dir(), libtool_elt_pa...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All All
: Normal enhancement
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-03 22:44 UTC by Arfrever Frehtes Taifersar Arahesis
Modified: 2016-05-23 18:42 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 Arfrever Frehtes Taifersar Arahesis 2015-12-03 22:44:54 UTC
The comments above eutils_elt_patch_dir() and libtool_elt_patch_dir() are partially incorrect. Value of ECLASSDIR does not depend on which eclasses are in current repository or inherited from master repositories.

The actual algorithm for values of PORTDIR and ECLASSDIR in ebuild environment in EAPIs in which these variables are set in ebuild environment is:
  PORTDIR is location of first element from this list:
    master repositories of current repository + [current repository]
  ECLASSDIR is ${PORTDIR}/eclass
    (${ECLASSDIR} can refer to nonexistent directory.)

The comments and analysis of the code of eutils_elt_patch_dir() and libtool_elt_patch_dir() suggest that the code should be rather:

_EUTILS_ECLASSDIR_LOCAL=${BASH_SOURCE[0]%/*}
eutils_elt_patch_dir() {
    local d="${_EUTILS_ECLASSDIR_LOCAL}/ELT-patches"
    if [[ ! -d ${d} ]] ; then
        d="${ECLASSDIR}/ELT-patches"
    fi
    if [[ ! -d ${d} ]] ; then
        die "ELT-patches cannot be found"
    fi
    echo "${d}"
}

Similarly for libtool_elt_patch_dir().


(Neither current code nor suggested code work in situation in which ELT-patches is located only in repository different than repository with eutils.eclass / libtool.eclass and different than first master repository. Support for this edge case would require something like master_repositories() and repository_path() functions, which are not available in EAPI={0,1,2,3,4,5,6}.)
Comment 1 SpanKY gentoo-dev 2015-12-03 23:35:21 UTC
the current code works and is based on real world testing.  do you have a use case where it is not working ?  if not, i'd prefer to just leave the code alone.