From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1ShOX1-0002NQ-4B for garchives@archives.gentoo.org; Wed, 20 Jun 2012 17:17:27 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3058EE08BB; Wed, 20 Jun 2012 17:17:05 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 03E9BE08BB for ; Wed, 20 Jun 2012 17:17:04 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6821E1B400B for ; Wed, 20 Jun 2012 17:17:04 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 279C1E5435 for ; Wed, 20 Jun 2012 17:17:03 +0000 (UTC) From: "Paul Varner" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Paul Varner" Message-ID: <1340207776.5178cca2df2b35a273ea97b15cbf011a4a08cb66.fuzzyray@gentoo> Subject: [gentoo-commits] proj/gentoolkit:gentoolkit commit in: bin/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: bin/euse X-VCS-Directories: bin/ X-VCS-Committer: fuzzyray X-VCS-Committer-Name: Paul Varner X-VCS-Revision: 5178cca2df2b35a273ea97b15cbf011a4a08cb66 X-VCS-Branch: gentoolkit Date: Wed, 20 Jun 2012 17:17:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 000e4d24-29c3-48ad-8ae4-d0b955919691 X-Archives-Hash: 4bc99ae9b8cb1da7209d12ba2ddb3e74 commit: 5178cca2df2b35a273ea97b15cbf011a4a08cb66 Author: Paul Varner gentoo org> AuthorDate: Wed Jun 20 15:56:16 2012 +0000 Commit: Paul Varner gentoo org> CommitDate: Wed Jun 20 15:56:16 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoolkit.gi= t;a=3Dcommit;h=3D5178cca2 Add support for ':' in the profiles parent file for bug 414961. Bug #414961 allows ':' shorthand to resolve to the ${PORTDIR}/profiles A value before the ':' references the repository, no value means gentoo Example: local:base would refer to the profiles directory in the repository path owned by the 'local' repository --- bin/euse | 27 ++++++++++++++++++++++++++- 1 files changed, 26 insertions(+), 1 deletions(-) diff --git a/bin/euse b/bin/euse index 4d2c15d..85ff924 100755 --- a/bin/euse +++ b/bin/euse @@ -16,6 +16,10 @@ EPREFIX=3D${EPREFIX:-$(portageq envvar EPREFIX)} ETC=3D"${EPREFIX}/etc" USR_SHARE_PORTAGE=3D"${EPREFIX}/usr/share/portage" =20 +# Arrays containing the known repository names and repository profile pa= ths +PORTAGE_REPOS=3D( $(portageq get_repos ${EPREFIX}/) ) +PORTAGE_REPO_PATHS=3D( $(portageq get_repo_path ${EPREFIX}/ ${PORTAGE_RE= POS[@]}) ) + # define error functions so they can be used immediately fatal() { echo -e "ERROR: ${*}" @@ -433,6 +437,12 @@ get_all_make_conf() { # General method of collecting the contents of a profile # 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 gento= o +# +# Example: local:base would refer to the profiles directory in the repos= itory +# path owned by the 'local' repository +# # Arguments: # $1 - Filename (make.profile) # [$2] - Current directory (unspecified means to start at the top) @@ -446,10 +456,25 @@ traverse_profile() { if [[ -f "${curdir}/parent" ]]; then for parent in $(egrep -v '(^#|^ *$)' ${curdir}/parent); do # Bug 231394, handle parent path being absolute + index=3D$(expr index "${parent}" :) if [[ ${parent:0:1} =3D=3D "/" ]]; then pdir=3D"$(get_real_path ${parent})" - else + elif [[ $index -eq 0 ]]; then pdir=3D"$(get_real_path ${curdir}/${parent})" + else + # We have a path with a colon shortcut + let i=3D$index-1 + repo=3D"${parent:0:${i}}" + [[ -z "${repo}" ]] && repo=3D"gentoo" + parent=3D"${parent:$index}" + limit=3D${#PORTAGE_REPOS[@]} + for ((i=3D0; i < limit ; i++)); do + if [[ ${repo} =3D=3D ${PORTAGE_REPOS[i]} ]]; then + parent=3D"${PORTAGE_REPO_PATHS[i]}/profiles/${parent}" + break + fi + done + pdir=3D"$(get_real_path ${parent})" fi rvalue=3D"${rvalue} $(traverse_profile ${1} ${pdir})" done