Bug 255520

Summary: ports-mgmt/portlint: portlint-2.19.5 report FATAL of comment section
Product: Ports & Packages Reporter: Tatsuki Makino <tatsuki_makino>
Component: Individual Port(s)Assignee: Joe Marcus Clarke <marcus>
Status: Closed FIXED    
Severity: Affects Many People CC: jwb, loader
Priority: --- Flags: bugzilla: maintainer-feedback? (marcus)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch none

Description Tatsuki Makino 2021-04-30 21:33:07 UTC
After $FreeBSD$ is removed, the Makefile with PORTNAME on the 1st line will have FATAL about the section.

Example from multimedia/libopenshot
> portlint /usr/ports/multimedia/libopenshot/
FATAL: Makefile: non-comment line in comment section.
FATAL: Makefile: extra item "MAINTAINER" placed in the PORTNAME section.
FATAL: Makefile: extra item "COMMENT" placed in the PORTNAME section.
FATAL: Makefile: PORTNAME has to be there.
WARN: Makefile: PORTVERSION/DISTVERSION is set externally to this port's Makefile, but this port is not configured as a slave port.
WARN: Makefile: CATEGORIES is set externally to this port's Makefile, but this port is not configured as a slave port.
FATAL: Makefile: extra item "LICENSE" placed in the MAINTAINER section.
FATAL: Makefile: extra item "LICENSE_FILE" placed in the MAINTAINER section.
WARN: Makefile: COMMENT is set externally to this port's Makefile, but this port is not configured as a slave port.
FATAL: Makefile: extra item "BUILD_DEPENDS" placed in the LICENSE section.
FATAL: Makefile: extra item "LIB_DEPENDS" placed in the LICENSE section.
8 fatal errors and 3 warnings found.

Makefiles with the comment "created by" do not cause problems.

Example from astro/geographiclib
> portlint /usr/ports/astro/geographiclib/
looks fine.
Comment 1 Fukang Chen freebsd_committer 2021-05-01 06:21:11 UTC
Created attachment 224586 [details]
patch

- checks if there's a comment section
- comment out some $rcsidstr errors
Comment 2 Jason W. Bacon freebsd_committer 2021-05-04 12:59:33 UTC
I've been seeing the same issue for the past week or so.

The workaround is adding a comment on line 1 without $FreeBSD$, e.g.

# Created by: Name <email>

But then this has to be removed before commit.
Comment 3 commit-hook freebsd_committer 2021-05-14 17:16:33 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=122c3ecb51c4a8057d09d1699a962dd1987e8061

commit 122c3ecb51c4a8057d09d1699a962dd1987e8061
Author:     Joe Marcus Clarke <marcus@FreeBSD.org>
AuthorDate: 2021-05-14 16:57:48 +0000
Commit:     Joe Marcus Clarke <marcus@FreeBSD.org>
CommitDate: 2021-05-14 17:15:44 +0000

    ports-mgmt/portlint: Update to 2.19.6

    * Allow ports without any leading comment section [1]
      loader@ submitted a patch on which this was based
    * Add a check to make sure the license is actually valid
    PR:             255520 [1]

 ports-mgmt/portlint/Makefile        |  2 +-
 ports-mgmt/portlint/src/portlint.pl | 57 ++++++++++++++++++++++---------------
 2 files changed, 35 insertions(+), 24 deletions(-)
Comment 4 Joe Marcus Clarke freebsd_committer 2021-05-14 17:18:29 UTC
Fixed in 2.19.6.  Thanks!