Bug 183864 - ports-mgmt/portlint: feature request
Summary: ports-mgmt/portlint: feature request
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Walter Schwarzenfeld
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-11 15:50 UTC by Mark Felder
Modified: 2019-08-18 12:09 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Felder freebsd_committer freebsd_triage 2013-11-11 15:50:00 UTC
I'm slowly amassing a list of things that should really be picked up by portlint. Here's what I have noted so far:

unnecessary double tab indentation
plist entries ending in /
${INSTALL}, ${MKDIR}, etc ending in /
@${INSTALL}  (install getting silenced)
${PREFIX}/man/man# should be ${MAN#PREFIX} (maybe not; seems broken since STAGE)
USES superceding old declaration. ex: USES= perl5  vs USE_PERL5=yes
pkg-descr whitespace at EOL
-ACNC is not the default, but should be
PTHREAD_CFLAGS and PTHREAD_LIBS should be flagged
OPTIONS_DEFINE that aren't used or OPTIONS_DEFAULT that don't exist should error
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2013-11-12 02:47:30 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-ports-bugs

ports PR.
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2013-11-12 02:47:46 UTC
Responsible Changed
From-To: freebsd-ports-bugs->marcus

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 3 Joe Marcus Clarke freebsd_committer freebsd_triage 2013-11-28 18:35:28 UTC
State Changed
From-To: open->feedback

Hey, Mark.  I'm trying to get a handle on these specific requests.  What 
would really help are some example ports that exhibit the problems you're 
describing so I can see the issues myself and/or test possible solutions. 

In particular, the MAN comment is a bit nebulous.  And what do you mean by 
unnecessary double-tab indention?  Thanks.
Comment 4 Mark Felder freebsd_committer freebsd_triage 2013-11-29 15:12:25 UTC
Hi Marcus,

I=92ll try to explain these:

> unnecessary double tab indentation

The Makefile should not have multiple tabs after a variable.

example:  USES=3D	perl5

There should only ever be one tab after the =3D

> plist entries ending in /

There is never a reason for entries in the pkg-plist to end with a /. =
This mostly applies to @dirrm or @dirrmtry entries. There are ports in =
the tree that do have this. You can find them with this:=20

find /usr/ports -name pkg-plist -exec egrep "@dir.*/$" {} \;

> ${INSTALL}, ${MKDIR}, etc ending in /

Same idea as above. These entries in Makefiles should not end in /

> @${INSTALL} (install getting silenced)

INSTALL should never be silenced; these actions should always be shown =
to the user.

> ${PREFIX}/man/man# should be ${MAN#PREFIX} (maybe not; seems broken =
since STAGE)

${MAN#PREFIX} was the correct way to handle man pages so someone could =
actually define a different PREFIX for all man pages. Last I checked it =
doesn=92t work with STAGE, which is probably a bug that I need to =
report.

> USES superceding old declaration. ex: USES=3D perl5 vs USE_PERL5=3Dyes

Fairly self explanatory. We should update portlint to identify these old =
USE_* when we migration things to USES

> pkg-descr whitespace at EOL

Whitespace characters at end of lines in pkg-descr should be detected

> -ACNC is not the default, but should be

Default portlint operation should invoke -ACNC which is much more useful =
than the default operation

> PTHREAD_CFLAGS and PTHREAD_LIBS should be flagged

These have been dead since FreeBSD 6 I believe. They should not be =
permitted in Makefiles.

> OPTIONS_DEFINE that aren't used or OPTIONS_DEFAULT that don't exist =
should error

If OPTIONS_DEFINE or OPTIONS_DEFAULT declares things that aren=92t used =
it should throw an error. It could be due to a spelling error or perhaps =
the person working on the port forgot to actually add its functionality =
in the form of:

.if ${PORT_OPTIONS:MFOO}

or

FOO_USES=3D, FOO_BUILD_DEPENDS=3D, FOO_LIB_DEPENDS, etc.


hope that helps
Comment 5 Mark Felder freebsd_committer freebsd_triage 2014-06-09 19:37:49 UTC
Request for support for understanding @sample in pkg-plist


Thanks :-)
Comment 6 Joe Marcus Clarke freebsd_committer freebsd_triage 2014-06-09 19:41:13 UTC
(In reply to Mark Felder from comment #5)
> Request for support for understanding @sample in pkg-plist
> 
> 
> Thanks :-)

Can you point me to a "sample" port :-) ?
Comment 7 Mark Felder freebsd_committer freebsd_triage 2014-06-09 20:30:58 UTC
I can do you one better --

http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/plist-config.html

That has the syntax. We should probably throw an error if @sample is used but the config file referenced doesn't end in .sample
Comment 8 Joe Marcus Clarke freebsd_committer freebsd_triage 2014-06-09 20:33:56 UTC
(In reply to Mark Felder from comment #7)
> I can do you one better --
> 
> http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/plist-
> config.html
> 
> That has the syntax. We should probably throw an error if @sample is used
> but the config file referenced doesn't end in .sample

Thanks, but a sample port will help me test the code.  I can find one, but if you have one in mind it saves me time.
Comment 9 Mark Felder freebsd_committer freebsd_triage 2014-06-09 20:48:24 UTC
I just committed sysutils/clsync which you can test it on
Comment 10 Joe Marcus Clarke freebsd_committer freebsd_triage 2014-06-14 03:06:35 UTC
Have a look at http://www.marcuscom.com:8080/cgi-bin/cvsweb.cgi/portlint/portlint.pl.diff?r1=1.315&r2=1.316&f=h .  Seems to be working.
Comment 11 Mark Felder freebsd_committer freebsd_triage 2016-11-12 17:23:06 UTC
Another feature request:

"Never use INSTALL_LIB to install static .a files, INSTALL_LIB is only
for dynamic .so libraries. Use INSTALL_DATA in this case."
Comment 12 Walter Schwarzenfeld freebsd_triage 2018-01-12 14:47:16 UTC
Is this still relevant?
Comment 13 Walter Schwarzenfeld freebsd_triage 2018-11-07 13:11:08 UTC
ping!
Comment 14 Walter Schwarzenfeld freebsd_triage 2019-08-18 12:09:41 UTC
I cannot check if all of these things are fixed. But this PR is very old and a lot of things had changed.
I close here with overcome  by events.

If there is somethings left, please reopen a new PR (with a new "wishlist").