Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 294437 Details for
Bug 265264
app-admin/eselect: profiles module does not support profiles in overlays
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
completed reerite as a patch
profile.eselect.patch (text/plain), 8.09 KB, created by
Lash the Core
on 2011-12-01 13:33:32 UTC
(
hide
)
Description:
completed reerite as a patch
Filename:
MIME Type:
Creator:
Lash the Core
Created:
2011-12-01 13:33:32 UTC
Size:
8.09 KB
patch
obsolete
>--- profile.eselect.old 2011-09-25 17:34:43.000000000 +0400 >+++ profile.eselect 2011-12-01 17:07:58.000000000 +0400 >@@ -1,157 +1,30 @@ > # -*-eselect-*- vim: ft=eselect > # Copyright 1999-2011 Gentoo Foundation > # Distributed under the terms of the GNU General Public License v2 >-# $Id: profile.eselect 845 2011-09-25 13:27:36Z ulm $ >+# $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-09-25 15:27:36 +0200 (Sun, 25 Sep 2011) $' >+SVN_DATE='$Date: 2011-07-07 18:03:44Z $' > 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() { >- local arch p portdir=$1 >- [[ -n ${portdir} ]] || portdir=$(portageq portdir) >- >- arch=$(arch) >- [[ -z ${arch} ]] && return 1 >- >- for p in $(sed -n -e "s|^${arch}[[:space:]]\+\([^[:space:]]\+\).*$|\1|p" \ >- "${ROOT}${portdir}/profiles/profiles.desc") >- do >- echo ${p} >- 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 targets arch parch >- >- if is_number "${target}"; then >- targets=( $(find_targets "${portdir}") ) >- [[ -z ${targets} ]] && die -q "Failed to get a list of valid profiles" >- target=${targets[target-1]} >- elif [[ -n ${target} && -d ${ROOT}${portdir}/profiles/${target} ]] >- then >- # if the profile was explicitly specified (rather than a number) >- # double check and make sure it's valid >- arch=$(arch) >- [[ -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}${portdir}/profiles/profiles.desc") >- >- if [[ ${arch} != ${parch} && -z ${force} ]]; then >- die -q "${target} is not a valid profile for ${arch}" >- fi >- fi >- >- if [[ -z ${target} ]]; then >- die -q "Target \"$1\" doesn't appear to be valid!" >- elif [[ -d ${ROOT}${portdir}/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 ${MAKE_PROFILE} ]]; then >- remove_symlink \ >- || die -q "Couldn't remove current ${MAKE_PROFILE} symlink" >- fi >- ln -s "$(relative_name \ >- "${ROOT}${portdir}" "${MAKE_PROFILE%/*}")/profiles/${target}" \ >- "${MAKE_PROFILE}" >- # check if the resulting symlink is sane >- if [[ $(canonicalise "${MAKE_PROFILE}") \ >- != "$(canonicalise "${EROOT}")"/* ]]; then >- write_warning_msg \ >- "Strange path. Check ${MAKE_PROFILE} symlink" >- fi >- else >- die -q "Target \"$1\" doesn't appear to be valid!" >- fi >-} >- >-### show action ### >- > describe_show() { >- echo "Show the current make.profile symlink" >+ echo "Show the current make.profile symlink target" > } > >-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>" >+ echo "<target> [--force]" > } > > describe_set_options() { >@@ -159,20 +32,93 @@ > echo "--force : Forcibly set the symlink" > } > >-do_set() { >- local force >- if [[ $1 == "--force" ]]; then >- force=1 >- shift >+doit(){ >+# variables >+ # define arch >+ local -rx arch=$( arch ) >+ # repos array >+ declare -arx repos=( $( get_repositories ) ) >+ #paths to repos array >+ declare -arx repospaths=( $( portageq get_repo_path '/' ${repos[@]} ) ) >+ local p rp >+ declare -ax targets=( >+ $( for rp in ${repospaths[@]}; do >+ [[ -r "${rp}/profiles/profiles.desc" ]] && \ >+ for p in $(sed -n -e "s|^${arch}[[:space:]]\+\([^[:space:]]\+\).*$|\1|p"\ >+ "${rp}/profiles/profiles.desc" ); do echo ${rp}/profiles/${p}; done >+ done ) \ >+ ) >+ [[ -z ${targets} ]] && die -q "Failed to get a list of valid profiles" >+ 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 >+ [[ -L "${MAKE_PROFILE}" ]] && local -rx activelink=$(canonicalise "${MAKE_PROFILE}") >+ [[ -z ${activelink} ]] && write_warning_msg "Unable to get active profile symlink" >+# let's do it >+ case "$DO" in >+ dolist) >+ if [[ -n ${targets[@]} ]] ; then >+ local i >+ for (( i = 0 ; i < ${#targets[@]} ; i = i + 1 )) ; do >+ [[ ${targets[i]} == ${activelink} ]] \ >+ && targets[i]=$(highlight_marker "${targets[i]}") >+ done >+ fi >+ write_list_start "Available profile symlink targets:" >+ write_numbered_list "${targets[@]}" >+ ;; >+ doset) >+ local force >+ if [[ ${1} == "--force" ]] ; then >+ force=${1} >+ shift >+ fi >+ local target=${1} >+ [[ -z ${target} ]] && die -q "You didn't tell me what to set the symlink to" >+ if is_number "${target}" ]]; then target=${targets[target - 1]}; fi >+ [[ -z ${target} ]] && die -q "No such target" >+ [[ -d "${target}" ]] || die -q "Target isn't a directory" >+ [[ -z ${arch} && ${force} != "--force" ]] && die -q "Unable to determine arch and symlinking not forced" >+ # do a reverse lookup and find the arch associated with ${target} >+ parch=$(sed -n -e \ >+ "s|^\([[:alnum:]]\+\)[[:space:]].*${target#*profiles/}[[:space:]].*$|\1|p" \ >+ "${ROOT}${target%profiles/*}/profiles/profiles.desc") >+ [[ ${arch} != ${parch} && ${force} != "--force" ]] && die -q "${target} is not a valid profile for ${arch}" >+ rm ${MAKE_PROFILE} || die -q "Couldn't remove current ${MAKE_PROFILE} symlink" >+ ln -s "$(relative_name "${EROOT}${target}" "${MAKE_PROFILE%/*}")" "${MAKE_PROFILE}" >+ # check if the resulting symlink is sane >+ if [[ $(canonicalise "${MAKE_PROFILE}") \ >+ != "$(canonicalise "${EROOT}")"/* ]]; then >+ write_warning_msg "Strange path. Check ${MAKE_PROFILE} symlink" >+ fi >+ ;; >+ doshow) >+ write_list_start "Current ${MAKE_PROFILE} symlink:" >+ [[ -n "$activelink" ]] && write_kv_list_entry "${activelink}" "" || \ >+ write_kv_list_entry "(unset)" "" >+ ;; >+ esac >+} > >- [[ -z $1 ]] && die -q "You didn't tell me what to set the symlink to" >- [[ $# -gt 1 ]] && die -q "Too many parameters" >+do_list() { >+ declare -rx DO="dolist" >+ doit $@ >+} > >- 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 >+do_set() { >+ declare -rx DO="doset" >+ doit $@ >+} >+ >+do_show() { >+ declare -rx DO="doshow" >+ doit $@ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 265264
:
266113
|
266131
|
266411
|
266489
|
284575
|
284687
|
284781
|
294431
|
294433
| 294437