Opened 17 years ago

Closed 17 years ago

Last modified 15 years ago

#13260 closed enhancement (fixed)

Relax the port lint categories check

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone: MacPorts 1.7.0
Component: base Version: 1.6.0
Keywords: Cc: ryandesign (Ryan Carsten Schmidt), nox@…
Port:

Description

port lint complains if it finds an invalid category, e.g.:

$ sudo port lint phpmyadmin
--->  Verifying Portfile for phpmyadmin
Warning: Line 2 should be a newline (after RCS tag)
Warning: Line 40 has trailing whitespace before newline
Error: Unknown category: php
--->  1 errors and 2 warnings found.
$

Convincing arguments were made on the mailing list that this check should be relaxed. Yes, there is no category directory "php" but so what if extra "virtual" categories are listed?

I think lint should be changed so that it only checks that the first listed category is in fact the directory the port is in -- or at least that the directory the port is in is one of the categories in the list. So here, phpmyadmin's categories list "www php databases" would be valid because the phpmyadmin port is in the www directory.

Change History (11)

comment:1 Changed 17 years ago by afb@…

Owner: changed from macports-dev@… to afb@…
Status: newassigned

comment:2 Changed 17 years ago by afb@…

Just laziness on implementing

comment:3 Changed 17 years ago by afb@…

Resolution: fixed
Status: assignedclosed

Fixed, r30985.

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

Resolution: fixed
Status: closedreopened

Well, r30985 makes it so that lint only checks the first listed category instead of all of them. That's a good improvement. But it doesn't yet do what I really want, which is described above: it should check that the category listed first is also the directory the port is in. For example, the php5 port now passes lint with no category errors, but the port says "categories lang php www" when the port is in fact in the www directory. lint should issue a warning that "www" should be the first listed category. Also, r30985 doesn't change the fact that lint still uses its own internal list of valid categories. If lint were changed to just match the first category with the directory the port is in, no such list would be necessary, and lint could automatically adapt to any new category directories that get created in the future.

comment:5 Changed 17 years ago by nox@…

Cc: nox@… added

Ryan: Didn't you opened #13263 for this second problem?

comment:6 Changed 17 years ago by afb@…

Resolution: fixed
Status: reopenedclosed

Checking directory is #13263, hardcoding the primary categories is "OK" (for now) - reclosing.

comment:7 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: closedreopened

#13263 is a different issue. That one is for the directory the portfile is in. For example, the portfile for qtsharp was stored in the directory devel/qtcsharp (note the extra c). That deserves a warning.

#13260 is all about categories. For example, the port php5 lists "lang" as its first category, but the php5 directory resides in the www directory (not the lang directory). That deserves a warning too.

Alternately, I would be happy if we merely made sure that the category directory the port is in is any of the categories listed in the portfile (in which case the php5 port would not get a warning, because "www" is listed (just not first)).

Whichever way we go, the documentation should be updated too.

comment:8 Changed 17 years ago by afb@…

Owner: changed from afb@… to ryandesign@…
Status: reopenednew

As I see it, both issues above about checking directory of Portfile - thus #13263. The regular portlint checks only do static reading of the actual Portfile contents.

I'll add a check for directory before opening the file, but I'm leaving this ticket.

comment:9 Changed 17 years ago by afb@…

Directory check added in r30996.

comment:10 Changed 17 years ago by afb@…

Resolution: fixed
Status: newclosed

Checking both directory (port name) and parent directory (primary group) in r33560.

comment:11 Changed 15 years ago by jmroot (Joshua Root)

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