From the man page:
The pkg_version command is used to produce a report of non-base software packages
installed using the pkg_add(1) command. Version numbers are compared against an index
file, to see which packages might need updating.
Basically this program will tell you how your currently installed port version numbers
compare to what is in your /usr/ports source tree. Just running the
command pkg_version will display the port name and whether its equal to the
current cvsup version, less than the current version, or unknown
pkg_version -v will display some information about the version information
for both currently installed ports and what you have in your ports source tree
pkg_version -l'flag' will limit the output to certain flags, ie.
- pkg_version -l '<' will display all ports that are not up to date
- pkg_version -l'=' will display all up to date ports
pkg_version -c will display the required commands to upgrade all installed
ports to the current version. (see below for a note on the -c
option).
Putting these together you can run pkg_version -vl'<' to check your
version numbers against what's in the ports tree to see what needs to be upgraded and pkg_version
-cv'<' to display the commands needed to upgrade your ports. Taking this
one step further you could pipe the last command to a shell interpreter to do it for you. pkg_version
-cv'<' | sh does just that. Note that some ports might fail during this
procedure, you should manually take care of upgrading those ports and then run this
procedure again.
Note that this method is not recommended. The recommended way of doing this is to
redirect the output of pkg_version -cv'<' to a file and edit the contents so
that it contains the ports you wish to update. For example pkg_version
-cv'<' > test.sh, you would then edit the file and delete the ports you wish
to not update and run the file, sh test.sh
16 March 2001 - David wrote in with an update:
You now have to run:
pkg_version -cl'<' | grep -v echo | grep -v exit | sh
to pipe it to sh. This changed in 4.3. Apparently they don't think you
should pipe it to the shell, which can have its problems.
|