pavement

Ports, searching

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
(I know what I want but I don't know what it's called)
(Updating the search index manually)
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
== I know what I want but I don't know what it's called ==
 
== I know what I want but I don't know what it's called ==
  
Fear not: the ports tree is searchable for relevant stuff without having to resort to [[find]], [[grep]] or going through each section in the most mind-numbing way possible.
+
Fear not: the ports tree is searchable for relevant stuff without having to resort to using [[find]] or [[grep]] directly on the /usr/ports directory itself - which can be pretty slow - or going through each section in the most mind-numbing way possible.
  
First, go into /usr/ports as root and make the search index (do all of this after [[Update_the_ports_tree]].)
+
samizdata# '''make search key=browser'''
 +
 
 +
... will search for any ports that have anything to do with the key word "browser".  Unfortunately, that's a LOT of ports and a lot of info you probably don't care anything about - you might be happier using [[grep]] and [[more]] to limit the output like this:
 +
 
 +
samizdata# '''make search key=browser | grep -E "Path:|Port:|Info:" | more'''
 +
 
 +
This will limit the output to only the lines including "Path:" "Port:" or "Info:", thus sparing you the list of dependencies for each port, as well as pausing the output for you whenever the screen fills.
 +
 
 +
==I know what it's called but I don't know where it is==
 +
samizdata# '''make search name=lynx | more'''
 +
will search for any packages by the name you supply and [[pipe]] the list to the [[more]] command so you can look through it one screenful at a time.
 +
 
 +
==Updating the search index manually==
 +
This step isn't usually necessary, because part of the ports-base collection which you will usually be [[csup]]-ing on a regular basis is the INDEX-5 file itself, pregenerated for you by the nice folks who maintain the master tree.  It's also not really recommended where unnecessary, because it can take quite a lot of time to run, especially when using older/slower disks.  But if you suspect your index got corrupted, or if you're running some sort of odd non-standard ports tree (for example you don't maintain local copies of several branches of the tree, etc) you can follow this procedure to generate your own search index.
 +
 
 +
First, go into /usr/ports as root and make the search index -- making the index can take a while, so go get some coffee or something. Do all of this after you [[Update_the_ports_tree]].)
  
 
  dave@samizdata% '''su -'''
 
  dave@samizdata% '''su -'''
 
  password:
 
  password:
 
  samizdata# '''cd /usr/ports'''
 
  samizdata# '''cd /usr/ports'''
  samizdata# '''make index'''
+
  samizdata# '''make index &'''
then
+
which will make the index so that you can search the ports tree, and run it in the background so that you can do other things. After that finishes, you can search for programs by keyword(s) or by name using your locally-generated index.
samizdata# '''make search key=browser | more'''
+
 
which will search for any ports that have anything to do with the key word "browser" or
+
== External websites ==
samizdata# '''make search name=lynx | more'''
+
* [http://www.freebsdsoftware.org FreeBSD software], the browsable ports online.  
which will search for any packages by the name you supply.
+
  
  
 
[[Category: Common Tasks]]
 
[[Category: Common Tasks]]
 +
[[Category: Ports and Packages]]

Latest revision as of 21:12, 17 December 2014

Contents

[edit] I know what I want but I don't know what it's called

Fear not: the ports tree is searchable for relevant stuff without having to resort to using find or grep directly on the /usr/ports directory itself - which can be pretty slow - or going through each section in the most mind-numbing way possible.

samizdata# make search key=browser

... will search for any ports that have anything to do with the key word "browser". Unfortunately, that's a LOT of ports and a lot of info you probably don't care anything about - you might be happier using grep and more to limit the output like this:

samizdata# make search key=browser | grep -E "Path:|Port:|Info:" | more

This will limit the output to only the lines including "Path:" "Port:" or "Info:", thus sparing you the list of dependencies for each port, as well as pausing the output for you whenever the screen fills.

[edit] I know what it's called but I don't know where it is

samizdata# make search name=lynx | more

will search for any packages by the name you supply and pipe the list to the more command so you can look through it one screenful at a time.

[edit] Updating the search index manually

This step isn't usually necessary, because part of the ports-base collection which you will usually be csup-ing on a regular basis is the INDEX-5 file itself, pregenerated for you by the nice folks who maintain the master tree. It's also not really recommended where unnecessary, because it can take quite a lot of time to run, especially when using older/slower disks. But if you suspect your index got corrupted, or if you're running some sort of odd non-standard ports tree (for example you don't maintain local copies of several branches of the tree, etc) you can follow this procedure to generate your own search index.

First, go into /usr/ports as root and make the search index -- making the index can take a while, so go get some coffee or something. Do all of this after you Update_the_ports_tree.)

dave@samizdata% su -
password:
samizdata# cd /usr/ports
samizdata# make index &

which will make the index so that you can search the ports tree, and run it in the background so that you can do other things. After that finishes, you can search for programs by keyword(s) or by name using your locally-generated index.

[edit] External websites

Personal tools