The pkg version command will be used as the difference confirmation command after updating the ports tree managed by pkg (8) used after FreeBSD 8.1-RELEASE.
Multiple versions are managed in the lang category, and if you use pkg version while using a non-standard version, the comparison target will not be found and the difference will be displayed correctly, so how to deal with it.
For example python
> pkg version -I | grep py
py39-Babel-2.8.0 ?
py39-Jinja2-2.11.2_1 ?
py39-alabaster-0.7.6 ?
py39-certifi-2020.12.5 ?
py39-cffi-1.14.4 ?
py39-chardet-3.0.4_3 ?
py39-cryptography-2.9.2 ?
py39-cython-0.29.21 =
...
As of this writing, python defaults to 3.7
How to find the default version
> grep PYTHON_DEFAULT /usr/ports/Mk/bsd.default-versions.mk
PYTHON_DEFAULT?= 3.7
If you are told to read man, until then: rolling_eyes:
switch"-Result of "P" addition
> pkg version -P | grep py
py39-Babel-2.8.0 =
py39-Jinja2-2.11.2_1 =
py39-alabaster-0.7.6 =
py39-certifi-2020.12.5 =
py39-cffi-1.14.4 =
py39-chardet-3.0.4_3 =
py39-cryptography-2.9.2 =
py39-cython-0.29.21 =
...
It looks like this. However, when displaying, it is no longer a comparison from/usr/ports/INDEX- *, and it takes a certain amount of time if there are a large number of skeleton tanned and inscored.
As an application of this command and switch, write an alias that displays the version when the ports tree is newer than the installed version.
alias pkgold '/usr/sbin/pkg version -vPl"<" | /usr/bin/tr -d "<"'
Recommended Posts