Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#60868 closed defect (fixed)

port lint PortGroup false alarm when "PortGroup" appears in string

Reported by: essandess (Steve Smith) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone: MacPorts 2.7.0
Component: base Version:
Keywords: lint PortGroup Cc: ryandesign (Ryan Carsten Schmidt)
Port:

Description

port lint produces a false alarm when the word PortGroup appears in a string.

Example Portfile: https://github.com/macports/macports-ports/blob/fe68b73c76d793aa022455ac4f84a4e0d5ca2083/graphics/opencv4/Portfile

--->  Verifying Portfile for opencv4
Error: Line 59 repeats inclusion of PortGroup make

But line 59 has PortGroup as a string: https://github.com/macports/macports-ports/blob/fe68b73c76d793aa022455ac4f84a4e0d5ca2083/graphics/opencv4/Portfile#L59

            ui_error "\n\ngithub PortGroup: Error: \${worksrcpath} does not exist after extracting distfiles. This might indicate that the author or project is different than set in the Portfile due to a rename at GitHub. Please examine the extracted directory in ${workpath} and try to correct the Portfile by either changing the author or project or adding the worksrcdir option with the correct directory name.\n"

Change History (3)

comment:1 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

We should do two things:

  1. We should fix port lint so that this usage does not trigger a warning
  2. You should fix the portfile so that it does not print an error message that claims to be from the github portgroup

comment:2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to ryandesign
Resolution: fixed
Status: newclosed

In 3d4c5c65451a3b2519a97d63c8f54a9553fb109e/macports-base (master):

Make port lint more precise

port lint now analyzes the portfile more precisely. This both avoids
some false positives (where we were finding the string "PortGroup" when
it occurred within an error message) and handles situations we weren't
handling before (whitespace before certain keywords).

Closes: #60868

comment:3 Changed 4 years ago by jmroot (Joshua Root)

Milestone: MacPorts 2.7.0
Note: See TracTickets for help on using tickets.