Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 248470 - app-admin/eselect: 'eselect profile' can't set some profiles
Summary: app-admin/eselect: 'eselect profile' can't set some profiles
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo eselect Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-23 22:08 UTC by Thomas Bellman
Modified: 2009-04-08 05:24 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch anchoring the searches better (eselect-profile-prefix.patch,658 bytes, patch)
2008-11-23 22:11 UTC, Thomas Bellman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Bellman 2008-11-23 22:08:22 UTC
eselect profile can't set a named profile, if the name of the
profile is a prefix of another profile.  For example, the profile
default/linux/x86/2008.0 can't be set, since there are (several)
other profiles whose name begins with that string:

    # /usr/bin/eselect profile set default/linux/x86/2008.0
    !!! Error: default/linux/x86/2008.0 is not a valid profile for x86
    Killed

This happens in at least versions 1.0.10 and 1.0.11-r1, of
app-admin/eselect.

The bug is in the function set_symlink() (in profile.eselect),
which does:

    parch=$(sed -n -e "s|^\([[:alnum:]]\+\)[[:space:]].*${target}.*$|\1|p" \
	    ${ROOT}/${portdir}/profiles/profiles.desc)

In the current profiles.desc, this will also match the desktop,
developer, and server sub-profiles.  $parch will thus be set to
the value

    x86
    x86
    x86
    x86

(four "x86" separated with newlines), which does not match $arch,
which is set to just "x86".

The solution is to "anchor" the end of the match better, like
this:

    parch=$(sed -n -e "s|^\([[:alnum:]]\+\)[[:space:]].*${target}[[:space:]].*$|\1|p" \
	    ${ROOT}/${portdir}/profiles/profiles.desc)
Comment 1 Thomas Bellman 2008-11-23 22:11:46 UTC
Created attachment 173078 [details, diff]
Patch anchoring the searches better

The above mentioned fix as a patch (unified context diff), against app-admin/eselect-1.0.11-r1.
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-04-08 05:24:39 UTC
(In reply to comment #1)
> Created an attachment (id=173078) [edit]
> Patch anchoring the searches better
> 
> The above mentioned fix as a patch (unified context diff), against
> app-admin/eselect-1.0.11-r1.
> 

Thanks! committed in -r2

http://sources.gentoo.org/viewcvs.py/eselect/trunk/modules/profile.eselect?r1=307&r2=397