Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 403215 - profile.eselect breaks when overlay contains '-gentoo' substring
Summary: profile.eselect breaks when overlay contains '-gentoo' substring
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: 2012-02-11 22:05 UTC by Ulrich Müller
Modified: 2012-04-11 19:32 UTC (History)
1 user (show)

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


Attachments
Patch for profile.eselect (profile.eselect.patch,627 bytes, patch)
2012-02-11 22:05 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Müller gentoo-dev 2012-02-11 22:05:54 UTC
Created attachment 301609 [details, diff]
Patch for profile.eselect

Reported by Sergei Trofimovich <slyfox@gentoo.org>:

Before patching:
    $ ./_inst/bin/eselect profile list
    !!! Error: Cannot get list of repositories
    !!! Error: Failed to get a list of valid profiles
    exiting
After patching:
    $ ./_inst/bin/eselect profile list
    !!! Warning: Both /etc/make.profile and /etc/portage/make.profile exist.
    !!! Warning: Using /etc/make.profile for now.
    Available profile symlink targets:
      [1]   default/linux/amd64/10.0 *
      [2]   default/linux/amd64/10.0/selinux
      [3]   default/linux/amd64/10.0/desktop
      ...

List of my repository names:
   gentoo gentoo-haskell local-cross-overlay slyfox-gentoo
The last one 'slyfox-gentoo' matched against '\bgentoo\b'
('-' is a nonword character) and broke horribly.
Comment 1 Ulrich Müller gentoo-dev 2012-02-11 22:30:58 UTC
Thanks for pointing this out. There's a small problem with your patch: ^ and $ don't match beginning and end of line, but beginning and end of pattern. Therefore the second substitution won't have any effect at all.

However, this can be cured by adding the "m" flag to the substitution. Can you try if the following change fixes the problem for you:

-		| sed "s/[[:space:]]\+/\n/g;s/\b${DEFAULT_REPO}\b/ &/" \
+		| sed "s/[[:space:]]\+/\n/g;s/^${DEFAULT_REPO}\$/ &/gm" \
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2012-02-12 05:19:31 UTC
(In reply to comment #1)
> Thanks for pointing this out. There's a small problem with your patch: ^ and $
> don't match beginning and end of line, but beginning and end of pattern.
> Therefore the second substitution won't have any effect at all.
> 
> However, this can be cured by adding the "m" flag to the substitution. Can you
> try if the following change fixes the problem for you:
> 
> -        | sed "s/[[:space:]]\+/\n/g;s/\b${DEFAULT_REPO}\b/ &/" \
> +        | sed "s/[[:space:]]\+/\n/g;s/^${DEFAULT_REPO}\$/ &/gm" \

Oh, my sed is very weak. Looks like I was very lucky having 'gentoo' alphasorted properly.

Your change works for me as well.

Thanks!
Comment 3 Ulrich Müller gentoo-dev 2012-02-12 08:21:47 UTC
<http://sources.gentoo.org/cgi-bin/viewvc.cgi/eselect?view=revision&revision=865>

+2012-02-12  Ulrich Müller  <ulm@gentoo.org>
+
+       * modules/profile.eselect (get_repos): Fix regular expression
+       for overlays, bug 403215. Thanks to Sergei Trofimovich
+       <slyfox@gentoo.org>.
+
Comment 4 Ulrich Müller gentoo-dev 2012-04-11 19:32:03 UTC
This is fixed in eselect-1.3.1.