Hi gadget42
... when i use the "provides" function and search for "ps" it reports many results. how would the uninitiated decide which to use? ...
Good question.
The following was performed on TC10 x86 using the command line for
provides instead of the GUI. The only difference is the command line
requires quotes and the GUI
can not handle quotes.
Trying to find which extension provides a program can be a frustrating
experience, especially with short names like ps or dd which will return
many results. A search for ps returned 580 results:
tc@E310:~$ provides.sh ps | wc -l
580
tc@E310:~$
The reason for so many matches is provides searches for a match anywhere
in the string, not an exact match. Searching for the calendar program called
cal returns 2661 results:
tc@E310:~$ provides.sh cal | wc -l
2661
tc@E310:~$
That's because it's also matching on every usr/lo
cal/ string in the provides.db
file. That's important because we can use that to create a more precise match by
including some path information.
We know cal is a program so it's probably in a bin or sbin directory. We can cover
both cases with a search like this:
tc@E310:~$ provides.sh "bin\/cal"
ax25-apps.tcz
fox-apps.tcz
fox.tcz
util-linux.tcz
valgrind.tcz
xastir.tcz
tc@E310:~$
Notice we need to escape the path separator "/" with a backslash "\".
As I said earlier, command line, use quotes. GUI, don't use quotes.
Let's see what happens for ps:
tc@E310:~$ provides.sh "bin\/ps"
aspell-dev.tcz
ghostscript.tcz
gnutls3.6.tcz
gnutls.tcz
lcms2.tcz
libcap-ng.tcz
libpsl.tcz
pax-utils.tcz
postgresql-10-client.tcz
postgresql-10.tcz
postgresql-11-client.tcz
postgresql-11.tcz
postgresql-12-client.tcz
postgresql-12.tcz
postgresql-9.5-client.tcz
postgresql-9.5.tcz
postgresql-9.6-client.tcz
postgresql-9.6.tcz
procps-ng.tcz
procps.tcz
pstree.tcz
putty.tcz
sc.tcz
tc@E310:~$
23 results.
Lets lengthen the path a little:
tc@E310:~$ provides.sh "local\/bin\/ps"
aspell-dev.tcz
ghostscript.tcz
gnutls3.6.tcz
gnutls.tcz
lcms2.tcz
libcap-ng.tcz
libpsl.tcz
pax-utils.tcz
procps-ng.tcz
procps.tcz
pstree.tcz
putty.tcz
sc.tcz
tc@E310:~$
That's a little better.
The previous search was picking up this from the postgresql extensions:
/usr/local/pgsql10/bin/psql
That brings me to another point.
Some extensions have another sub-directory between local and bin, sbin, or lib
as you just saw:
/usr/local/pgsql10/bin/psql
Just something to keep in mind when performing searches.