From c2f1f461417d3037b77695d30a4b76b159ab2073 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Tue, 18 Jun 2013 20:57:21 -0400 Subject: [PATCH] euse: fix looking up portage-2 style parent paths with empty repo name When a parent is defined as ":path/to/profile" the blank name before the colon means the current repo, not the "gentoo" repo. --- bin/euse | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/euse b/bin/euse index 6997b2b..7efb03f 100755 --- a/bin/euse +++ b/bin/euse @@ -448,7 +448,7 @@ get_all_make_conf() { # component by traversing through the cascading profile # # Bug #414961 allows ':' shorthand to resolve to the ${PORTDIR}/profiles -# A value before the ':' references the repository, no value means gentoo +# A value before the ':' references the repository, no value means same repo # # Example: local:base would refer to the profiles directory in the repository # path owned by the 'local' repository @@ -475,12 +475,15 @@ traverse_profile() { # We have a path with a colon shortcut let i=$index-1 repo="${parent:0:${i}}" - [[ -z "${repo}" ]] && repo="gentoo" parent="${parent:$index}" limit=${#PORTAGE_REPOS[@]} for ((i=0; i < limit ; i++)); do - if [[ ${repo} == ${PORTAGE_REPOS[i]} ]]; then - parent="${PORTAGE_REPO_PATHS[i]}/profiles/${parent}" + repo_profiles="${PORTAGE_REPO_PATHS[i]}/profiles" + if [[ "${repo}" == ${PORTAGE_REPOS[i]} ]] || \ + ( [[ -z "${repo}" ]] && + [[ "${curdir}" == ${repo_profiles}/* ]] ) + then + parent="${repo_profiles}/${parent}" break fi done -- 1.8.1.5