Bug 192633 - port-mgmt/portlint: Feature request to check for muted installation commands
Summary: port-mgmt/portlint: Feature request to check for muted installation commands
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Joe Marcus Clarke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-13 09:05 UTC by John Marino
Modified: 2014-10-08 23:42 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 John Marino freebsd_committer freebsd_triage 2014-08-13 09:05:11 UTC
A common mistake found in do-install and post-install targets is the muting of installation commands.  It's permissible to mute mkdir commands, but not install commands.  This is a request to have portlint check for this problem if it can.

excerpt of conversation on port-committers@



+--On 13 août 2014 10:49:56 +0200 John Marino <freebsd.contact@marino.st>
wrote:
| On 8/13/2014 10:40, Mathieu Arnold wrote:
|> +--On 13 août 2014 10:16:34 +0200 Thomas Zander <riggs@freebsd.org>
|> wrote:
|> | On 13 August 2014 10:04, Alexey Dokuchaev <danfe@freebsd.org> wrote:
|> |> On Wed, Aug 13, 2014 at 08:06:06AM +0200, John Marino wrote:
|> |>> It's been said, or at I how I interpreted it, that policy has already
|> |>> been established as a result of a long discussion.  And that the
|> |>> outcome is: 1) You can't mute installation commands
|> |>> 2) You may mute mkdir commands at your preference (with an implied
|> |>> it's more popular to mute mkdir than not)
|> |> 
|> |> Correct.  It's been a long tradition within the ports to do it this
|> |> way,
|> | 
|> | If that is our convention, then why not clearly defining the rules in
|> | the porter's handbook?
|> | (At least I could not find these conventions in it in a quick search.)
|> | We can hardly expect new contributors to know this if it's not in the
|> | docs.
|> 
|> I thought I wrote a bit about that, I discovered this morning that my
|> memory is not what it used to be, I'm doing that now.
| 
| Is this policy something portlint is technically capable of checking?
| if so, I don't mind opening a feature request PR for portlint to do it.
| John

I have no idea of how portlint works, so I can't comment on that, but it
would be nice if it could check that.
Comment 1 John Marino freebsd_committer freebsd_triage 2014-08-13 09:05:45 UTC
over to maintainer
Comment 2 Alexey Dokuchaev freebsd_committer freebsd_triage 2014-08-13 09:16:09 UTC
I would also add to this request: portlint(1) should whine if USES (and similar knobs) values are not sorted.
Comment 3 John Marino freebsd_committer freebsd_triage 2014-08-14 18:25:57 UTC
as long as we are hijacking this thread:

I frequently run into ports with "files" in the COMMENT definition.  There's nothing wrong with that.  However, portlint trips on it, e.g.


WARN: Makefile: possible direct use of "files" "COMMENT=        List, test, and extract compressed files in a ZIP archive" found. if so, use ${FILESDIR} instead.


Please make the "files" check smarter to not trip if it's part of a COMMENT.
Comment 4 John Marino freebsd_committer freebsd_triage 2014-08-15 12:17:12 UTC
i just ran into another port with blank lines inserted into the plist.

I think there shouldn't be blanks lines in plist.  If concurred, portlint should check for this.
Comment 5 Joe Marcus Clarke freebsd_committer freebsd_triage 2014-08-17 00:36:07 UTC
Can you share the port that has the COMMENT issue?  COMMENT should already be ignored.
Comment 6 John Marino freebsd_committer freebsd_triage 2014-08-17 08:04:33 UTC
(In reply to Joe Marcus Clarke from comment #5)
> Can you share the port that has the COMMENT issue?  COMMENT should already
> be ignored.

easy: archivers/unzip in this case
Comment 7 John Marino freebsd_committer freebsd_triage 2014-08-18 21:29:12 UTC
(In reply to Joe Marcus Clarke from comment #5)
> Can you share the port that has the COMMENT issue?  COMMENT should already
> be ignored.

Similarly, I've hit a false positive on SHEBANG_FILES a few times:

WARN: Makefile: possible direct use of "scripts" "SHEBANG_FILES=        scripts/
*.pl* scripts/*.sh" found. if so, use ${SCRIPTDIR} instead.
Comment 8 John Marino freebsd_committer freebsd_triage 2014-08-25 13:56:24 UTC
Speaking of COMMENT, it's not supposed to start with "A ", "An ", or "The ", but portlint doesn't check for this.  It seems like an easy rule to implement.

It's also not supposed to start with the name of the port, but I have no idea if this rule is implemented or not.

e.g. math/fractals

COMMENT= Fractals is an awesome snowflake generator program

Portlint could flag that.  (does it already?)
Comment 9 Joe Marcus Clarke freebsd_committer freebsd_triage 2014-09-18 18:50:19 UTC
Okay, the check for muted INSTALL_foo commands is there in CVS.  I need to look at these other requests.
Comment 10 John Marino freebsd_committer freebsd_triage 2014-09-20 07:23:48 UTC
I was just too lazy to open new PRs but if it will help you I can open one PR per request (including danfe's)
Comment 11 Joe Marcus Clarke freebsd_committer freebsd_triage 2014-09-20 13:49:38 UTC
Please.  It will be easier for me to track.
Comment 12 John Marino freebsd_committer freebsd_triage 2014-09-20 14:06:20 UTC
done
Comment 13 Joe Marcus Clarke freebsd_committer freebsd_triage 2014-10-08 23:42:39 UTC
Implemented in 2.15.5.