Solved Automating port search in UPDATING file

I'm modifying my script for port maintainance to work at best it can. The previous version of the script was written in javascript (node) because I wish to implement a TUI (npm/blessed) but I never done it, the new script is written in sh.
However, the problem I had (and still have) is relative to parsing /usr/ports/UPDATING, the command pkg is affected too. The format of the "AFFECTS:" field is not always parsable in an easy way, I noticed this defect relative to the entry:

Code:
20240529:
  AFFECTS: users of python
  ...

both my script and pkg updating skip it, with the result I realized too late that I should have taken action. I know I always have to read the file, but I wish to skip this step.

I do not know if this (the forum) is the right place to ask if it's possible to change the "AFFECTS:" field in a more parsable way. This field should only keep a list of ports (in canonical form category/port) separated by commas, still using regular expressions and make.conf variables (I'm not sure about this, the variables), for example

Code:
AFFECTS: lang/python*
AFFECTS: USES=nodejs, www/node*, www/npm*, www/yarn*
AFFECTS: lang/php8[13]

without "users of " or any other comments, moving those comments in the description.

The command pkg updating show all the entries relative to the installed ports for any date. My old script do the same but show only the entries after the date the package was installed (or updated) for each installed port. My new script do the same but need a more in depth parsing and should show the entries that in any case I can't find a port correspondance, like the one above. Yes, it contain 'python', unfortunately I search for a 'category/port' name. Parsing all words to find a port correspondance is more expensive and prone to misinterpretation like in the entry:
Code:
20240723:
  AFFECTS: users of databases/postgresql* and other software using PostgreSQL to run
  ...
It should be
Code:
20240723:
  AFFECTS: databases/postgresql*
  Also affects other software using PostgreSQL to run.
  ...
The port 'and' exists: sysutils/and - Auto Nice Daemon

Thanks for your patience
 
Hello!
You can try to use extended grep
Bash:
grep -o -E '[[:alnum:]]{2,}/[[:alnum:]]{2,}\*?'

I have such result in your python case:
lang/python*
www/node*
www/npm*
www/yarn*
lang/php8
 
[…] The format of the "AFFECTS:" field is not always parsable in an easy way, I noticed this defect relative to the entry:
Code:
20240529:
  AFFECTS: users of python
  ...
both my script and pkg updating skip it, […]
Currently, the recommended style according to the porter’s handbook is, quote: 🧩
If upgrading the port requires special steps like changing configuration files or running a specific program, it must be documented in this file. The format of an entry in this file is:​
Code:
YYYYMMDD:
  AFFECTS: users of portcategory/portname
  AUTHOR: Your name <Your email address>

  Special instructions
As far as I can tell​
Bash:
pkg updating -i 'python'
matches “users of python” and other free‑form AFFECTS entries, but it may – as you already mentioned – produce false positives for port names like and. 🙄

I think a harmonization would be appropriate, too, 📋 but there are several non‑standard Affects‑clauses, for example:​
  • […] ports depending on category/name
  • ports using Apache Software License 2.0
  • […] when upgrading via port builds on the host
  • […] and related libraries/applications
  • users who set port options in make.conf
It may therefore be more sensible to show everything and exclude only notices that with absolute certainty do not affect you.🚮
 
Back
Top