Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 427644 - app-portage/eix-0.25.5 has broken regexps support
Summary: app-portage/eix-0.25.5 has broken regexps support
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Third-Party Tools (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Martin Väth
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-22 14:06 UTC by Maxim Kammerer
Modified: 2012-07-24 13:55 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim Kammerer 2012-07-22 14:06:42 UTC
Upgrade from 0.23.10 to 0.25.5 broke regular expressions support.

# eix -c 'kudzu|pyrenamer'
[N] sec-policy/selinux-kudzu (--): SELinux policy for kudzu
[N] sys-apps/kudzu (~1.2.83-r1): Red Hat Hardware detection tools
[N] sys-apps/pyrenamer (~0.6.0): Mass rename files
[N] sys-libs/libkudzu (1.2.57.1): Red Hat Hardware detection tools
Found 4 matches.

# eix -c '(kudzu|pyrenamer)'
[N] dev-python/rhpl (~0.219): Library of python code used by Red Hat Linux programs
[N] sys-apps/hwsetup (1.2-r2): Hardware setup program from Knoppix - used only on LiveCD
[N] sys-apps/kudzu (~1.2.83-r1): Red Hat Hardware detection tools
[N] sys-libs/libkudzu (1.2.57.1): Red Hat Hardware detection tools
Found 4 matches.

# eix -c '\<kudzu\>|\<pyrenamer\>'
[N] sys-libs/libkudzu (1.2.57.1): Red Hat Hardware detection tools

In short, weird behavior. A symptom of wrong results seems to be that eix takes a significantly longer time before producing them.

Did not find a relevant commit in eix git after 0.25.5 tag.

qsearch works fine on same input.
Comment 1 Martin Väth 2012-07-22 16:37:06 UTC
What you are probably expecting is that the options -s (--name)
and -r (--regex) are always the default - they are not;
if you want to force them you must specify them.

By default, eix uses a heuristics on your expresseion to guess
which match field and which match algorithm you "probably" meant
and chooses this algorithm if you did not specify any other.
The heuristics is defined in DEFAULT_MATCH_FIELD and
DEFAULT_MATCH_ALGORITHM (The default content of these variables
has changed several times in various eix versions).

If you do not like the heuristics, you can fix your choice by putting
DEFAULT_MATCH_FIELD=name
DEAFULT_MATCH_ALGORITHM=regex
into your /etc/eixrc file.
Comment 2 Maxim Kammerer 2012-07-22 16:51:31 UTC
(In reply to comment #1)
> What you are probably expecting is that the options -s (--name)
> and -r (--regex) are always the default - they are not;
> if you want to force them you must specify them.

You are right -- I tried forcing -r (with no effect), but didn't realize that -s is also determined heuristically. Feel free to close as INVALID. Although, perhaps DEFAULT_MATCH_FIELD heuristic can be improved, since something simple like "eix -c '(kudzu|pyrenamer)'" makes it select something other than -s (does it select --deps by any chance?).
Comment 3 Martin Väth 2012-07-22 17:49:16 UTC
(In reply to comment #2)
> Although, perhaps DEFAULT_MATCH_FIELD heuristic can be improved, since
> something simple like "eix -c '(kudzu|pyrenamer)'" makes it select something
> other than -s (does it select --deps by any chance?).

$ eix --print DEFAULT_MATCH_FIELD
[\ ] description [@] set http.*: homepage / category/name
GPL|BSD|Art license [<>=!()] deps name

Yep, using any of the symbols <>=!() causes a search in deps
(which BTW takes much longer, because not only the package name but
the data of all versions of every package must be checked.)

You are right that perhaps () should be removed from this list.
On the other hand, () may be "simple" for regular expresssions,
but it is not that "simple" for all other search algorithms.
The heuristics could be improved if it would take the selected
match algorithm into account, but perhaps such a big magic is
too confusing.
Comment 4 Martin Väth 2012-07-22 18:06:43 UTC
The "simple" fix (removing ()) is now in eix's git master on BerliOS
(>=eix-0.26.1). Probably, the "complex" fix (making field/algorithm
selection depending on each other) will not be implemented; I think
it would cause more confusion than help.
Comment 5 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-07-24 13:55:04 UTC
+*eix-0.26.1 (24 Jul 2012)
+
+  24 Jul 2012; Jeremy Olexa <darkside@gentoo.org> -eix-0.26.0.ebuild,
+  -files/eix-0.26.0-tools.patch, +eix-0.26.1.ebuild, metadata.xml:
+  Version bump from upstream for bug fixes (closes Gentoo bugs 425512, 426256,
+  427644)