Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 113134 - gentoolkit enhancement: equery list --partial-name
Summary: gentoolkit enhancement: equery list --partial-name
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 112364
  Show dependency tree
 
Reported: 2005-11-20 23:30 UTC by Harald van Dijk (RETIRED)
Modified: 2005-12-07 10:28 UTC (History)
1 user (show)

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


Attachments
The patch (gentoolkit-0.2.1_rc1-partialname.patch,2.52 KB, patch)
2005-11-20 23:31 UTC, Harald van Dijk (RETIRED)
Details | Diff
gentoolkit-0.2.1_rc1-partialname-default.patch (gentoolkit-0.2.1_rc1-partialname-default.patch,2.52 KB, patch)
2005-11-22 07:42 UTC, Paul Varner (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Harald van Dijk (RETIRED) gentoo-dev 2005-11-20 23:30:50 UTC
(Related to bug #113032, but reported as a new bug because it's really separate
 now with simply the same inspiration.)

Attached is a patch for gentoolkit 0.2.1_rc1 which implements an additional
option --partial-name for equery list. It's useful for users not familiar with
regexes; equery list --partial-name <argument> is basically equivalent to equery
list --full-regex '.*<argument>.*' except that the argument is automatically
escaped if --full-regex is not given. Good idea? Bad idea? Other comments?
Comment 1 Harald van Dijk (RETIRED) gentoo-dev 2005-11-20 23:31:33 UTC
Created attachment 73281 [details, diff]
The patch
Comment 2 walt 2005-11-21 06:13:51 UTC
Perfect -- now equery is easier to use than qpkg.  Thanks!
Comment 3 Paul Varner (RETIRED) gentoo-dev 2005-11-21 10:29:04 UTC
I think the patch is a good idea.  The only question in my mind is do we make
this behavior the default and switch the current default behavior to be an option?
Comment 4 Harald van Dijk (RETIRED) gentoo-dev 2005-11-21 13:42:40 UTC
That sounds like a good idea. It might cause problems if scripts rely on the
current behaviour, but personally, I doubt there are any such scripts yet.

Using --full-name for such an option may make the meaning of --full-regex
unclear, by the way. What would be the right thing to call it?
Comment 5 Paul Varner (RETIRED) gentoo-dev 2005-11-21 15:12:28 UTC
My thinking would be to call the option --exact-name
Comment 6 Paul Varner (RETIRED) gentoo-dev 2005-11-22 07:42:05 UTC
Created attachment 73376 [details, diff]
gentoolkit-0.2.1_rc1-partialname-default.patch

Attached is a patch against rc1 that makes partial name matching the default
behavior.  The option to get the current behavior is -e or --exact-name.
Comment 7 walt 2005-11-22 14:27:28 UTC
I like it.  Just to make sure I understand:  your -e flag does not expect or want
regexps, right?  I can use regexps fine with -f but not with -e.  This makes good
sense to me, but I just want to make sure everyone agrees.

As for the default behavior, it's perfect AFAICT.  It even finds the right
packages when I search for + or ++ so this seems a big improvement over qpkg.
Comment 8 Harald van Dijk (RETIRED) gentoo-dev 2005-11-23 08:34:22 UTC
Thanks for updating the patch. I like the --exact-name option name.

And:
> Just to make sure I understand:  your -e flag does not expect or want
> regexps, right?  I can use regexps fine with -f but not with -e.  This makes good
> sense to me, but I just want to make sure everyone agrees.

It's probably the best way to go. If you want to use -e with regexes, you can
simply pass both the -e and the -f option.
Comment 9 Paul Varner (RETIRED) gentoo-dev 2005-11-23 11:08:31 UTC
Fixed in gentoolkit-0.2.1_rc2
Comment 10 Paul Varner (RETIRED) gentoo-dev 2005-11-23 11:11:54 UTC
I changed the behavior slightly before committing. Using --full-regex implies
--exact-name, otherwise regular expression searches didn't work correctly. 
However, using --exact-name does not imply that you are using a regular expression.
Comment 11 Harald van Dijk (RETIRED) gentoo-dev 2005-11-23 11:58:25 UTC
> I changed the behavior slightly before committing. Using --full-regex implies
> --exact-name, otherwise regular expression searches didn't work correctly. 

Ah, okay. I had tried it, but apparently not well enough :) If you could give me
an example of what fails, I'll try to find a fix for a future version.
Comment 12 Paul Varner (RETIRED) gentoo-dev 2005-11-23 19:53:50 UTC
Okay, I must have been smoking something since I can't find what regular
expression that I was using to cause problems.  I know that it had to do with
using '+' and '*' but everything I've tried appears to be working correctly. So
the question becomes, do we want to have partial name matching be the default
for regular expressions as well or have them be exact matches?
Comment 13 Harald van Dijk (RETIRED) gentoo-dev 2005-11-23 22:55:43 UTC
Making exact matches the default for regexes would require adding a
-E/--no-exact-name option in addition to the --exact-name option, and even
though exact matches are probably more useful with regexes, the interaction
between -e, -E, and -f may cause unnecessary confusion. For example, what would
equery list -E -f do? Both partial and exact matching would be a reasonable
choice, I think, so it would not be clear (at least to me) what it would
actually do.

And having partial matches as the default regardless of whether regexes are used
is easier to implement :)
Comment 14 Jakub Moc (RETIRED) gentoo-dev 2005-11-24 05:20:06 UTC
Wow, it's much better now, thanks!
Comment 15 Paul Varner (RETIRED) gentoo-dev 2005-12-07 10:28:46 UTC
Partial name matching is now default for reqular expressions as well.  Will be
released with gentoolkit-0.2.1_rc3