Workaround for the problem that? Is displayed when checking the version when using non-standard perl | python with pkg version

background

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.

Concrete example

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

Solved with switch "-P"

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.

Advanced version

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

Workaround for the problem that? Is displayed when checking the version when using non-standard perl | python with pkg version
Workaround for the problem that sys.argv is not passed when executing a Python script with only the file name in Python2.7 on Windows
Workaround for the problem that UTF-8 Japanese mail cannot be sent with Flask-Mail (Python3)
When Selenium tells me that the Chrome driver version is different (Python)
Investigate the cause when an error is thrown when python3.8 is not found when using lambda-uploader with python3.8
Solved the problem that the image was not displayed in ROMol when loaded with PandasTools.LoadSDF.
There is a pattern that the program did not stop when using Python threading
Solution when the image cannot be displayed with tkinter [python]
Miscellaneous notes that I tried using python for the matter
This and that for using Step Functions with CDK + Python
A memo for when pip3 is installed with python2.7 for some reason
How to write what to do when an application is first displayed in Qt for Python with Designer
What is the python underscore (_) for?
When using MeCab with virtualenv python
Precautions when using six with Python 2.5
Notify using Notification Center when the execution environment is macOS in Python
A useful note when using Python for the first time in a while
Problem that even if Pool.close () is done with Python multiprocessing, the process remains paused and the memory increases steadily.
Intuitive explanation that does not rely on mathematical formulas for the Monty Hall problem and simulation with Python
How to deal with the problem that Japanese characters are garbled when outputting logs using JSON log formatter
Try to find the probability that it is a multiple of 3 and not a multiple of 5 when one is removed from a card with natural numbers 1 to 100 using Ruby and Python.
Behind the flyer: Using Docker with Python
Python memo using perl --format is convenient.
[python, multiprocessing] Behavior for exceptions when using multiprocessing
Working with OpenStack using the Python SDK
Tips for using python + caffe with TSUBAME
Even if the development language is changed to python3 in Cloud9, version 2 is displayed in python --version
It seems that the version of pyflakes is not the latest when flake8 is installed
A solution to the problem that the Python version in Conda cannot be changed
When writing tests with python unittests, use doCleanups for setUps that can fail
Are Php / Ruby / Python that only runs when the file is called directly
About the problem that the python version of Google App Engine does not mesh
When using PyQtGraph with Python Pyside, pay attention to the order of import
[For beginners] Unexpected behavior if "\" is included when setting the path in Python
[Python] Solution to the problem that elements are linked when copying a list
Notify slack when the switch sales page is updated ~ slack bot development with python ③ ~