Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 137565 - man emerge doesn't mention the use of @ in --search
Summary: man emerge doesn't mention the use of @ in --search
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 136244
  Show dependency tree
 
Reported: 2006-06-22 05:09 UTC by Michal Suchanek
Modified: 2006-06-23 12:46 UTC (History)
0 users

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 Michal Suchanek 2006-06-22 05:09:14 UTC
$ equery d virtual/xft
[ Searching for packages depending on virtual/xft... ]
net-libs/gecko-sdk-1.7.13
x11-libs/fltk-1.1.7
x11-libs/pango-1.10.3
x11-libs/cairo-1.0.4
x11-libs/vte-0.12.2
app-office/abiword-2.2.11

 $ emerge -tD =x11-libs/cairo-1.0.4
>>> --tree implies --pretend... adding --pretend to options.

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[ebuild   R   ] x11-libs/cairo-1.0.4  

 $ emerge -s virtual/x11
Searching...   
[ Results for search key : virtual/x11 ]
[ Applications found : 0 ]
 
So is thare a virtual/x11? Which one? Or why is it not merged if there is none?
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-06-22 05:20:47 UTC
(In reply to comment #0)
>  $ emerge -s virtual/x11
> Searching...   
> [ Results for search key : virtual/x11 ]
> [ Applications found : 0 ]
> 
> So is thare a virtual/x11? Which one? Or why is it not merged if there is none?

Well, this search is wrong, and fails equally for any virtual or non-virtual package.

# emerge -s net-www/apache
Searching...   
[ Results for search key : net-www/apache ]
[ Applications found : 0 ]

# emerge -s x11 | grep virtual
*  virtual/x11

That said, virtual/* is never meant to be emerged directly and there's not much sense in searching for them. 

There are tons of better alternatives to the slow portage search, like esearch:

# esearch -F virtual/x11
[ Results for search key : virtual/x11 ]
[ Applications found : 1 ]

*  virtual/x11
      Latest version available: 7.0-r2
      Latest version installed: [ Not Installed ]
      Size of downloaded files: [no/bad digest]
      Homepage:    http://www.gentoo.org/proj/en/desktop/x/x11/
      Description: Virtual for the core X11 implementation
      License:     GPL-2

or eix, or whatever...
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2006-06-22 05:26:33 UTC
Also, you can only search for the 'new style' virtuals, the old ones are not ebuilds, so there's nothing to search for.

Anyway, forgot to close this, not a bug.
Comment 3 Michal Suchanek 2006-06-22 06:02:55 UTC
oh, it is said to be a regular expression but it cannot match '/'.
Weird.
Comment 4 Marius Mauch (RETIRED) gentoo-dev 2006-06-22 07:49:37 UTC
It can match /, it just looks at the package name only by default (without the category). To include the category you can prefix the search string with @, e.g.
emerge -s @virtual/.*
I'll agree that this is not the most intuitive way to handle it.
Comment 5 Michal Suchanek 2006-06-22 08:56:58 UTC
Not ony unintuitive but also undocumented. At least I cannot find anything about that in the emerge man page.
Comment 6 Simon Stelling (RETIRED) gentoo-dev 2006-06-22 09:44:48 UTC
the documentation issue is fixed starting from rev 3605:

Index: emerge.1
===================================================================
--- emerge.1    (revision 3593)
+++ emerge.1    (working copy)
@@ -153,11 +153,13 @@
 .BR "\-\-search " (\fB\-s\fR)
 Searches for matches of the supplied string in the portage tree.
 The \-\-search string is a regular expression.  For example, \fBemerge
-\-\-search "^kde"\fR searches for any package that starts with "kde";
+\-\-search "^kde"\fR searches for any package whose name starts with "kde";
 \fBemerge \-\-search "gcc$"\fR searches for any package that ends with
 "gcc"; \fBemerge \-\-search "office"\fR searches for any package that
-contains the word "office".  If you want to search the package
-descriptions as well, use the \fB\-\-searchdesc\fR action.
+contains the word "office".  If you want to include the category into the
+search string, prepend an @: \fBemerge --search "@^dev-java.*jdk"\fR.
+If you want to search the package descriptions as well, use the
+\fB\-\-searchdesc\fR action.
 .TP
 .BR "\-\-searchdesc " (\fB\-S\fR)
 Matches the search string against the description field as well as
Comment 7 Zac Medico gentoo-dev 2006-06-23 12:46:21 UTC
This has been released in 2.1.1_pre1-r2.