Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 614008 - eselect profile: wrong regex in set_symlink
Summary: eselect profile: wrong regex in set_symlink
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: eselect (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo eselect Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2017-03-27 09:01 UTC by Manuel Mommertz
Modified: 2017-12-25 11:10 UTC (History)
0 users

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


Attachments
patch for profile.eselect (profile.eselect.diff,646 bytes, patch)
2017-03-27 15:15 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Mommertz 2017-03-27 09:01:39 UTC
I have a simple profiles.desc in my local overlay:

amd64   amd64               stable
amd64   amd64/plasma        stable
amd64   legacy/amd64        stable
amd64   legacy/amd64/plasma stable

With eselect profile I cannot select the first two profiles by name:

# eselect profile set amd64/plasma
!!! Error: amd64/plasma is not a valid profile for amd64
exiting

I found the reason in the function set_symlink:

# do a reverse lookup and find the arch associated with ${target}
parch=$(sed -n -e \
  "s|^\([[:alnum:]_-]\+\)[[:space:]].*${target}[[:space:]].*$|\1|p" \
  "${repopath}/profiles/profiles.desc")

The dot after the first [[:space::]] should be removed to only allow spaces between the architecture and the profile name. Currently sed returns two lines when trying to select amd64/plasma which fails.

Reproducible: Always
Comment 1 Ulrich Müller gentoo-dev 2017-03-27 15:15:33 UTC
Created attachment 468426 [details, diff]
patch for profile.eselect

Attached patch fix should fix the problem. Please test.

> The dot after the first [[:space::]] should be removed to only allow
> spaces between the architecture and the profile name.

Slightly different solution, [[:space:]]\+ now requires one or more whitespace characters (whereas [[:space:]]* would require zero or more which I think would not be right).
Comment 2 Manuel Mommertz 2017-05-22 05:27:38 UTC
Your are right and your patch works as expected.

Sorry for the late response, I somehow overlooked that you wrote something above the citation. Thought the fix was simple enough to be directly commited.
Comment 4 Larry the Git Cow gentoo-dev 2017-12-25 11:10:49 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=52962d756a157e0ddf24394160b6ea73dd63d3ac

commit 52962d756a157e0ddf24394160b6ea73dd63d3ac
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2017-12-25 11:05:58 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2017-12-25 11:10:28 +0000

    app-admin/eselect: Version bump.
    
    Closes: https://bugs.gentoo.org/614008
    Closes: https://bugs.gentoo.org/617572
    Closes: https://bugs.gentoo.org/640386
    Package-Manager: Portage-2.3.19, Repoman-2.3.6

 app-admin/eselect/Manifest              |  1 +
 app-admin/eselect/eselect-1.4.10.ebuild | 61 +++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+)