# ports-mgmt/portlint - FATAL warnings on original ports



## T-Daemon (Apr 9, 2021)

After the transition to git I'm in the process of updating a port (net/intel-ix-kmod), exercising creating patches with devel/git, to submit it afterwards. Following the Porters Handbook one of the procedures in testing the port is checking it with ports-mgmt/portlint (chapters 3.5 Checking the Port with portlint and 10.2. Portlint).

After making the changes to the Makefile, I run ports-mgmt/portlint with the result having _FATAL_ warnings. Running it on the original, unmodified port has the same outcome:


```
/usr/ports/net/intel-ix-kmod # portlint -A
FATAL: Makefile: [2]: header should be followed by $FreeBSD$.
WARN: Makefile: NETMAP_AUTO is listed in OPTIONS_DEFINE, but no PORT_OPTIONS:MNETMAP_AUTO appears in this slave Makefile.  Make sure it appears in the master's Makefile.
WARN: Makefile: NETMAP_ON is listed in OPTIONS_DEFINE, but no PORT_OPTIONS:MNETMAP_ON appears in this slave Makefile.  Make sure it appears in the master's Makefile.
WARN: Makefile: NETMAP_OFF is listed in OPTIONS_DEFINE, but no PORT_OPTIONS:MNETMAP_OFF appears in this slave Makefile.  Make sure it appears in the master's Makefile.
FATAL: Makefile: no $FreeBSD$ line in comment section.
WARN: Makefile: new ports should not set PORTREVISION.
WARN: Makefile: new ports should not set PORTEPOCH.
FATAL: Makefile: extra item "DISTFILES" placed in the MAINTAINER section.
FATAL: Makefile: extra item "_MAN_SOURCE" placed in the MAINTAINER section.
FATAL: Makefile: extra item "MAINTAINER" placed in the LICENSE section.
FATAL: Makefile: extra item "COMMENT" placed in the LICENSE section.
6 fatal errors and 5 warnings found.
```
Regarding the _FATAL_ about `$FreeBSD$`, those keywords are removed from the Makefiles.

Regarding the _FATAL_ warnings of placement in the wrong section, if I compare Chapter 15. Order of Variables in Port Makefiles (bsd.port.mk as well) and the blocks in the original ports Makefile, they check out. I tested ports-mgmt/portlint on other ports and a lot of them returned _FATAL_ warnings similar to the above.

Is ports-mgmt/portlint outdated and not anymore fit for use fore testing ports? Or am I hitting here a bug? No bug report found with this incident. Before submitting a PR, does someone know something more about this which may clarify that behavior?

I have installed ports-mgmt/portlint from a shallow cloned ports tree and updated main HEAD before. The port was updated last on 2021-04-06.


----------



## zirias@ (Apr 9, 2021)

T-Daemon said:


> Is ports-mgmt/portlint outdated and not anymore fit for use fore testing ports? Or am I hitting here a bug? No bug report found with this incident. Before submitting a PR, does anyone know something more about this which may clarify that behavior?


I think the errors about things being in the wrong section are correct. It just happens that not all ports are properly tested with portlint before being committed 

As for the `$FreeBSD$` tag, the removal of these tags just happened a few days (?) ago. So I'd consider it a bug in portlint, it should be updated (and possibly do the opposite: issue a FATAL when such a tag is found, as there were quite a few commits hunting down these tags suddenly re-emerging by accident).


----------



## T-Daemon (Apr 10, 2021)

Zirias said:


> I think the errors about things being in the wrong section are correct. It just happens that not all ports are properly tested with portlint before being committed


Indeed. After seen the result in this specific port, I tested other ports, some of them returned fatal errors justly, but in case of net/intel-ix-kmod the result is false positive, as it was in a few other ports. 

According to the order of variables all _FALSE_ marked in this port are in the right place (haven't found a documentation for _MAN_SOURCE). 

The best procedure here is, after running portlint, in case of fatal warnings refering to blocks, compare the result with the porters handbook.


----------



## Jose (Apr 10, 2021)

T-Daemon said:


> After the transition to git I'm in the process of updating a port (net/intel-ix-kmod)...


Total newb here, but the `-A` flag turns on `-N`, which is for checking newly submitted ports according to the portlint(1) man page.


T-Daemon said:


> Regarding the _FATAL_ about `$FreeBSD$`, those keywords are removed from the Makefiles.


This is definitely a bug, and I can't find a bugzilla record for it. You should file it.


----------



## T-Daemon (Apr 11, 2021)

Jose said:


> Total newb here ...


Not total but newb here too.


Jose said:


> ... but the `-A` flag turns on `-N`, which is for checking newly submitted ports according to the portlint(1) man page.


Thanks for the effort to look it up in the manual. True, but `-A` can be run on an existing ports as well. In the porters handbook the `-A` option is described as "_the most thorough_". Testing the above port with `portlint` alone, with the `-A` or `-C` options set, the outcome is the same: False positive results.

The porters handbook states:

```
"Do not blindly follow the output of portlint. It is a static lint tool and sometimes gets things wrong."

and

"Since portlint uses heuristics to try to figure out errors, it can produce false positive warnings. In addition,
occasionally something that is flagged as a problem really cannot be done in any other way due to limitations
in the ports framework."
```
Knowing that I didn't expect it can be this extensive. Last year I submitted a few patches to update ports, but I didn't encounter false positive results.



Jose said:


> This is definitely a bug, and I can't find a bugzilla record for it. You should file it.


Someone else was faster: PR 254968


----------

