list of installed ports?

ale said:
portversion -v (from ports-mgmt/portupgrade) is a lot faster (about 6s vs. 70s here).

It does require an additional port. Pkg_version and pkg_info are part of the base OS. I also doubt the speed. It takes a while for portversion to collect data before it produces output. Pkg_version immediately starts producing output. Which probably accounts for the apparent difference in speed.
 
SirDice said:
It does require an additional port. Pkg_version and pkg_info are part of the base OS.
Obviously, but if the OP is using portupgrade for upgrading his ports, portversion is free.

SirDice said:
I also doubt the speed. It takes a while for portversion to collect data before it produces output. Pkg_version immediately starts producing output. Which probably accounts for the apparent difference in speed.
Apparent?
Code:
$ time `pkg_version -v > /dev/null`

real	1m15.667s
user	0m41.320s
sys	0m12.968s

$ time `portversion -v > /dev/null`

real	0m7.332s
user	0m5.066s
sys	0m1.199s
(with 749 installed ports)
 
Don't forget that portupgrade (and hence portversion) require two separate databases be installed and kept up-to-date (portsdb and pkgdb). All the portupgrade tools use these databases to pull their info, they don't use the /usr/ports/INDEX* or /var/db/pkg/* directly.

While it's not common, it is possible for the separate databases used by the portupgrade tools to become out-of-sync with the actual data in /var/db/pkg/* and/or /usr/ports/INDEX*, in which case you get incorrect results when using portversion.

Hence why, even though it may be slower, it's generally safer/more accurate to use pkg_version. (Plus, it's always nice to use the built-in tools.) :)

Just something to keep in mind.
 
Code:
ls -lac /var/db/pkg
-l -a -c == "lack", for that reason, I always have used it,
even aliasing it to a shorter version (one word)
............
I wouldn't have posted it here, but its output seems
easier to read (the names are on the right of the screen).
(its usage here, maybe not in other instances).
......................

Also weekly it may be wise to
Code:
ls -lac /var/db/pkg | tee -a vardMODA.YR
(month day year)
and copy it elsewhere. (You may be at another
computer wondering what ports you have installed and
have a backup copy available).
 
Thanks for the info. Been meaning to have a useful easy to refer to list of what ports are installed that can be emailed somewhere else regularly, and this has done the trick perfectly.
 
I did find a pointer to pkg in the mean time. When this thread shows up in a search (which is how I found it), it will now have more useful information. From somewhere else, the command I found to use is

pkg query --all '%o %n-%v %R'
 
Back
Top