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:
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
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:
It should be
The port 'and' exists: sysutils/and - Auto Nice Daemon
Thanks for your patience
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
...
Code:
20240723:
AFFECTS: databases/postgresql*
Also affects other software using PostgreSQL to run.
...
Thanks for your patience