Bug 240359 - ports-mgmt/portlint: Comments in sections (eg: USES/LICENSE) throws FATAL false positives
Summary: ports-mgmt/portlint: Comments in sections (eg: USES/LICENSE) throws FATAL fal...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Joe Marcus Clarke
URL:
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2019-09-06 07:11 UTC by Kubilay Kocak
Modified: 2020-03-02 22:24 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (marcus)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kubilay Kocak freebsd_committer freebsd_triage 2019-09-06 07:11:51 UTC
The following block:

LICENSE=        MIT
#LICENSE_FILE=  Not yet packaged in sdist

# Actually 2.7, 3.4+
USES=           python
USE_PYTHON=     autoplist distutils


Results in the following portlint output:

===> Validating port with portlint
FATAL: Makefile: extra item "USES" placed in the LICENSE section.
FATAL: Makefile: extra item "USE_PYTHON" placed in the LICENSE section.
2 fatal errors and 0 warnings found.

Expected outcome:

looks fine.

This issue may be more generic in nature, and exhibit itself in other rules relating to block/section identification or order
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2019-09-06 07:13:20 UTC
Forgot to note, in case it helps with analysis or a fix, removing any *one* of the comments results in expected behaviour: looks fine.
Comment 2 Joe Marcus Clarke freebsd_committer freebsd_triage 2020-03-02 22:01:18 UTC
So there's a parsing instruction that merges <comment><blank line><comment> into one section.  Essentially, this is pulling up USES into LICENSE.  This is a commented part of the code, so at some point someone wanted this.  I'm removing the parsing for now to see who complains.
Comment 3 commit-hook freebsd_committer freebsd_triage 2020-03-02 22:23:45 UTC
A commit references this bug:

Author: marcus
Date: Mon Mar  2 22:23:11 UTC 2020
New revision: 527653
URL: https://svnweb.freebsd.org/changeset/ports/527653

Log:
  Update to 2.18.11

  * No longer warn for manpages installed under share/man [1]
  * Remove code to combine comments and blank lines in a section [2]
  * Remove code to combine comments and blank lines [3]
  * USE_PYQT sets the necessary QT USES [4]
  * Only warn on lack of INSTALLS_ICONS when USES=gnome is set [5]
  * Check for files that have been patched multiple times [6]

  PR:		240359 [2]
  		244480 [3]
  		240445 [4]
  		244039 [5]
  		243600 [6]
  Submitted by:	0mp [1] [5]
  		vladimir.chukharev@gmail.com [4]
  		swills [6]
  Differential Revision:	D23896 [1]

Changes:
  head/ports-mgmt/portlint/Makefile
  head/ports-mgmt/portlint/src/portlint.pl
Comment 4 Joe Marcus Clarke freebsd_committer freebsd_triage 2020-03-02 22:24:21 UTC
Fixed in 2.18.11.