From looking at the module code, it appears the eselect profiles module does not support profiles that are in overlays. I now manually link to the profile. Reproducible: Always
I'll evaluate a patch for submission.
(In reply to comment #1) > I'll evaluate a patch for submission. > No comment since then, removing myself from CC
I need this enhancement also. Will make this possibility at the future?
(In reply to comment #3) > I need this enhancement also. Will make this possibility at the future? Read comment #1 again. ;)
*** Bug 359023 has been marked as a duplicate of this bug. ***
Created attachment 266113 [details] /usr/share/eselect/modules/profile.eselect In the last version made a typo. Notes on a CHROOT in curent version: * If the profile is selected from the ROOT != / , in <CHROOT>/etc/make.conf should be source ../var/lib/layman/make.conf not source /var/lib/layman/make.conf * I do not know - it's a bug or a feature (possibly - I misunderstood the logic of portageq and expect different answer), but PORTAGE_CONFIGROOT=${ROOT} ROOT=${ROOT} portageq portdir_overlay looking for ways to overlay with respect to /, not $ ROOT and therefore to work properly in a chroot overlays must meet the same in the basic system
(In reply to comment #6) > Created attachment 266113 [details] > /usr/share/eselect/modules/profile.eselect Thank you for the update. I'd much prefer if you could attach a patch against the newest version in <http://sources.gentoo.org/cgi-bin/viewvc.cgi/eselect/trunk/>. > * I do not know - it's a bug or a feature (possibly - I misunderstood the > logic of portageq and expect different answer), but > PORTAGE_CONFIGROOT=${ROOT} ROOT=${ROOT} portageq portdir_overlay > looking for ways to overlay with respect to /, not $ ROOT > and therefore to work properly in a chroot overlays must meet the same in the > basic system Not sure if I have fully understood you here, but this sounds like bug 358185.
Created attachment 266131 [details] /usr/share/eselect/modules/profile.eselect Support make.profile in the /etc/portage directory as you requested, modified version of the latest version from SVN
Also note that the path of layman's make.conf is set in /etc/layman/layman.cfg, you cannot assume it is /var/lib/layman/make.conf
> Also note that the path of layman's make.conf is set in /etc/layman/layman.cfg, > you cannot assume it is /var/lib/layman/make.conf many thanks, but in this profile.eselct I don't use layman cfg file > * If the profile is selected from the ROOT != / , in <CHROOT>/etc/make.conf > should be > source ../var/lib/layman/make.conf > not > source /var/lib/layman/make.conf It's more of a hint, there are no errors in the utility portageq? but anyway thanks a lot.
Created attachment 266411 [details, diff] Add support selecting profile from overlay > Thank you for the update. I'd much prefer if you could attach a patch against the newest version in Thid is a patch to the last version(for now) of the profile.eselect this solves the problem from the subject this is the same as https://bugs.gentoo.org/attachment.cgi?id=266131 . but deleted unnecessary comments. And in a diff
Created attachment 266489 [details, diff] Add support selecting profile from overlay Hm.. in the latest patch I made a small mistake - do not pay attention to the function set_symlink() use a variable to initialize the $target > [[ -z "${target}" ]] && die -q "Target \"${target}\" doesn't appear to be valid!" Now corrected, checked - everything works. This is a patch to http://sources.gentoo.org/cgi-bin/viewvc.cgi/eselect/trunk/modules/profile.eselect?view=markup&pathrev=810
Another minor point: In eselect, we can't call functions like canonicalise or portageq in global scope, so the code in line 14 and following should be moved into a function (that is called for the different actions). No need to post another update though; I'll take care of it.
Created attachment 284575 [details] complete rerite HELO ppl. take look at this. original profile.eselect code is too ugly for me, so I did my own
(In reply to comment #14) > Created attachment 284575 [details] > complete rerite Thanks. If you want this to be reviewed for inclusion: 1. Please base it on a current version of profile.eselect. For example, your new version doesn't support the new /etc/portage location any more. 2. Since this is not a rewrite from scratch, a patch is much preferred, even if changes are large. 3. Please don't mix functional changes with style changes or purely cosmetic stuff like whitespace, because that makes it harder to see the important things. (The patch in comment #12 also suffered from this, BTW.) 4. Calls to portageq are expensive, so better avoid them inside of a loop. "portageq get_repo_path" can accept a list of arguments. 5. Usage of ${ROOT} and ${EROOT} in front of ${repo_path} is not consistent. (And I'm not sure if any of them belongs there at all. Best would be to test this with a non-trivial ROOT.)
(In reply to comment #15) > (In reply to comment #14) > > Created attachment 284575 [details] > > complete rerite > > Thanks. If you want this to be reviewed for inclusion: I wanna this to be reviewed for bugs including st.5.: > 5. Usage of ${ROOT} and ${EROOT} in front of ${repo_path} is not consistent. > (And I'm not sure if any of them belongs there at all. Best would be to > test this with a non-trivial ROOT.) Testing this should make me sure in my vision of profile.eselect functionality. Help of society will be appreciated.
Comment on attachment 284575 [details] complete rerite # -*-eselect-*- vim: ft=eselect # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id: profile.eselect 820 2011-07-07 18:03:44Z ulm $ # This is a portage-only module. inherit package-manager DESCRIPTION="Manage the make.profile symlink" MAINTAINER="eselect@gentoo.org" SVN_DATE='$Date: 2011-07-07 20:03:44 +0200 (Thu, 07 Jul 2011) $' VERSION=$(svn_date_to_version "${SVN_DATE}") # get location of make.profile symlink get_symlink_location() { local oldloc=${EROOT%/}/etc/make.profile local newloc=${EROOT%/}/etc/portage/make.profile if [[ -e ${oldloc} ]]; then MAKE_PROFILE=${oldloc} if [[ -e ${newloc} ]]; then write_warning_msg "Both ${oldloc} and ${newloc} exist." write_warning_msg "Using ${MAKE_PROFILE} for now." fi else MAKE_PROFILE=${newloc} fi } # get a list of valid profiles find_targets() { # declaring local arrays local -a repos=( $( portageq get_repos "/" ) ) repospaths=( $( portageq get_repo_path "/" ${repos[@]} ) ) # declaring local vars local arch=$( arch ) reposnum=${#repos[@]} repospathsnum=${#repospaths[@]} reponum p; # empty $arch & $repos leads to north-north-west^Wexit [[ -z ${arch} ]] && [[ -z ${repos} ]] && { echo "Errorr: cannot determine arch and repos">/dev/stderr; return 1; } # Portageq sanity check: $reposnum & $repospathsnum must be equal [[ "${reposnum}" != "${repospathsnum}" ]] && { echo "Errorr: unexpected portageq answer">/dev/stderr; return 1; } for(( reponum=0; $reponum<$reposnum; reponum++ ));do [[ -r ${ROOT}/${repospaths[$reponum]}/profiles/profiles.desc ]] && \ # parsing profiles.desc for $arch suitable profiles for p in $( sed -n -e \ "s|^${arch}[[:space:]]\+\([^[:space:]]\+\).*$|${repos[$reponum]}:\1|p" "${ROOT}${repospaths[$reponum]}/profiles/profiles.desc" ); # printing "overlay-name:profile-dir" pairs do echo ${p}; done done } # remove make.profile symlink remove_symlink() { rm "${MAKE_PROFILE}" } # set the make.profile symlink set_symlink() { local portdir=$(portageq portdir) target=${1} force=${2} arch=$( arch ) parch repo repo_path [[ -z ${target} ]] && die -q "Target \"${1}\" doesn't appear to be valid!" local -a targets=( $(find_targets ) ) [[ -z ${targets} ]] && die -q "Failed to get a list of valid profiles" if is_number "${target}" ; then target=${targets[target - 1]}; fi repo=${target%:*} repopath=$( portageq get_repo_path / ${repo} ) target=${target#*:} if [[ -n ${target} && -d ${ROOT}${repopath}/profiles/${target} ]];then # if the profile was explicitly specified (rather than a number) # double check and make sure it's valid [[ -z ${arch} && -z "${force}" ]] && return 1 # do a reverse lookup and find the arch associated with ${target} parch=$(sed -n -e \ "s|^\([[:alnum:]]\+\)[[:space:]].*${target}[[:space:]].*$|\1|p" \ "${ROOT}${repopath}/profiles/profiles.desc") if [[ ${arch} != ${parch} && -z "${force}" ]] ; then die -q "${target} is not a valid profile for ${arch}" fi fi if [[ -d ${ROOT}${repopath}/profiles/${target} ]]; then # we must call remove_symlink() here instead of calling # it from do_set(), since if the link is removed, we # cannot determine $ARCH in find_targets() if [[ -L ${EROOT}/etc/make.profile ]] ; then remove_symlink || die -q "Couldn't remove current make.profile symlink" fi # set relative symlink ln -s "$(relative_name "${EROOT}${repopath}/profiles/${target}" "${EROOT}/etc")" "${EROOT}/etc/make.profile" # check if the resulting symlink is sane if [[ $(canonicalise "${EROOT}/etc/make.profile") \ != "$(canonicalise "${EROOT}")"/* ]]; then write_warning_msg "Strange path. Check ${EROOT}/etc/make.profile symlink" fi else die -q "Target \"${1}\" doesn't appear to be valid at all!" fi } ### show action ### describe_show() { echo "Show the current make.profile symlink" } do_show() { get_symlink_location write_list_start "Current ${MAKE_PROFILE} symlink:" if [[ -L ${MAKE_PROFILE} ]]; then local link=$(canonicalise "${MAKE_PROFILE}") local portdir=$(portageq portdir) local profiledir=$(canonicalise "${ROOT}${portdir}/profiles") link=${link##${profiledir}/} write_kv_list_entry "${link}" "" else write_kv_list_entry "(unset)" "" fi } ### list action ### describe_list() { echo "List available profile symlink targets" } do_list() { local portdir profiledir active targets targets=( $(find_targets) ) [[ -z ${targets} ]] && die -q "Failed to get a list of valid profiles" get_symlink_location portdir=$(portageq portdir) profiledir=$(canonicalise "${ROOT}${portdir}/profiles") active=$(canonicalise "${MAKE_PROFILE}") active=${active##${profiledir}/} if [[ -n ${targets[@]} ]]; then local i for (( i = 0; i < ${#targets[@]}; i++ )); do [[ ${targets[i]} == ${active} ]] \ && targets[i]=$(highlight_marker "${targets[i]}") done fi write_list_start "Available profile symlink targets:" write_numbered_list "${targets[@]}" } ### set action ### describe_set() { echo "Set a new profile symlink target" } describe_set_parameters() { echo "<target>" } describe_set_options() { echo "target : Target name or number (from 'list' action)" echo "--force : Forcibly set the symlink" } do_set() { local force if [[ $1 == "--force" ]]; then force=1 shift fi [[ -z $1 ]] && die -q "You didn't tell me what to set the symlink to" [[ $# -gt 1 ]] && die -q "Too many parameters" get_symlink_location if [[ -e ${MAKE_PROFILE} ]] && [[ ! -L ${MAKE_PROFILE} ]]; then die -q "${MAKE_PROFILE} exists but is not a symlink" else set_symlink "$1" ${force} || die -q "Couldn't set a new symlink" fi }
Created attachment 284687 [details] complete reerite complete reerite set_symlink() & find_targets() functions on latest profile.eselect
(In reply to comment #17) > Comment on attachment 284575 [details] > complete rerite Sorry for that comment #17 - it can be safely deleted
@Portage team: I need your advice. There are now two alternative patches that use different portageq calls to obtain a list of overlays/repositories. The first one (attachment 266489 [details, diff]) uses "portageq portdir" and "portageq portdir_overlay", whereas the second one (attachment 284687 [details]) uses "portageq get_repos" and "portageq get_repo_path". Are there any strong reasons for using the one or the other? The second approach seems to have the advantage that it also makes the repositories' names available.
Maybe "portageq get_repos" and "portageq get_repo_path" are better if you want to abstract away the idea of PORTDIR and PORTDIR_OVERLAY being separate entities rather than just having a single big list of repositories. Other than that, either approach is fine.
Created attachment 284781 [details] profile.eselect new version Here's a new version, based on lashzcore's patch. I've added more changes in do_show and do_list so that the active will be recognised. Please test.
(In reply to comment #22) > I've added more changes in do_show and do_list so that the active will be > recognised. s/active/active profile/
Committed to SVN, revision 832. Because the changes are quite intrusive, the module should really see some testing before the release. So who volunteers as guinea pig? ;-)
BTW, http://devmanual.gentoo.org/profiles/profiles.desc/index.html ?
(In reply to comment #25) > BTW, http://devmanual.gentoo.org/profiles/profiles.desc/index.html ? Different issue → Please open a new bug (file it under "Product: Doc Other" and "Component: Devmanual").
Created attachment 294431 [details] completed reerite as file
Created attachment 294433 [details] completed reerite as a patch
(In reply to comment #28) > Created attachment 294433 [details] > completed reerite as a patch Could you please add an explanation what features are still missing, in your opinion, and why a further (rather intrusive) rewrite would be necessary? The tip version already supports overlays: <http://sources.gentoo.org/cgi-bin/viewvc.cgi/eselect/trunk/modules/profile.eselect?view=markup> (For convenience, there's also a live ebuild: app-admin/eselect-9999)
Created attachment 294437 [details, diff] completed reerite as a patch Just added support for make.profile in /etc/portage Well, current svn version is two times bigger and seems to have fuzzy logic. My version is more flexible for adding new features, whatever it may be. I'm not asking to commit this to repo, but you may do 8) -- cheers
Support for overlays is included with eselect-1.3. Thank you for bringing this up.