Bug 192161

Summary: ports-mgmt/portlint: 100-char patch filename rule incorrectly includes path
Product: Ports & Packages Reporter: John Marino <marino>
Component: Individual Port(s)Assignee: Joe Marcus Clarke <marcus>
Status: Closed FIXED    
Severity: Affects Some People CC: koobs
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description John Marino freebsd_committer freebsd_triage 2014-07-27 11:19:21 UTC
Revision 361618 added this rule among others: 
* Check to make sure patch file names contain no more than 100 characters. 

I believe the rule wants the filename of the patch to be less than 100 characters, but the check is counting the entire path.

For example,
> cd /usr/ports/deskutils/cairo-dock-plugins
> portlint
(only warnings seen)

but then when the ports tree is in a non-standard location:

root@Niner:~ # cd /home/marino/svnhub/freebsd-ports/deskutils/cairo-dock-plugins/
root@Niner:/home/marino/svnhub/freebsd-ports/deskutils/cairo-dock-plugins # portlint
WARN: Makefile: TERMINAL appears in PORT_OPTIONS:M, but is not listed in OPTIONS_DEFINE.
WARN: Makefile: Consider adding support for a NLS knob to conditionally disablegettext support.
WARN: Makefile: Consider defining LICENSE.
FATAL: /usr/home/marino/svnhub/freebsd-ports/deskutils/cairo-dock-plugins/files/
patch-Dbus__interfaces__vala__CMakeLists.txt: make sure patch file names contain
 no more than 100 characters.
1 fatal error and 3 warnings found.


So that's why I think the rule is looking at the length of the entire path, and not the length of just the filename of the patch.  I've seen this on a few ports now.
Comment 1 John Marino freebsd_committer freebsd_triage 2014-07-27 11:20:19 UTC
Hi Marcus, can you verify what I'm seeing in portlint is a bug?
Thanks,
John
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2014-07-27 11:38:02 UTC
I reported this to marcus@ cc demon@ then forwarded to portmgr@ with no response, so including original email below for reference to a second reproduction:

===============

FATAL:
/usr/local/poudriere/data/.m/10i386-koobs/ref/usr/ports/devel/py-setuptools/files/patch-setuptools__command__install_egg_info.py:
make sure patch file names contain no more than 100 characters.

is this (including characters in path-to-file) expected?

`svn status` is:

[/usr/home/koobs/repos/freebsd/ports/devel/py-setuptools] ss
M       Makefile
M       distinfo
A       files/patch-setuptools__command__install_egg_info.py
D       files/patch-setuptools_command_install_egg_info.py
Comment 3 Joe Marcus Clarke freebsd_committer freebsd_triage 2014-07-28 06:37:20 UTC
Can you try this and see if it helps:

http://www.marcuscom.com/cgi-bin/cvsweb.cgi/portlint/portlint.pl.diff?r1=1.325&r2=1.326&f=h
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2014-07-28 06:59:11 UTC
Works for me on patch file reported in comment 2, thanks Marcus! :)

Also, ports-mgmt/portlint needs a LICENSE update (BSD -> BSD[X]CLAUSE)
Comment 5 John Marino freebsd_committer freebsd_triage 2014-07-28 07:05:00 UTC
same here, it now works for the cairo-dock example.
Comment 6 commit-hook freebsd_committer freebsd_triage 2014-07-28 13:21:30 UTC
A commit references this bug:

Author: marcus
Date: Mon Jul 28 13:21:07 UTC 2014
New revision: 363150
URL: http://svnweb.freebsd.org/changeset/ports/363150

Log:
  Update to 2.15.4.

  Use File::Basename so that only the patch filename is checked for the 100
  character limit.

  PR:		192161

Changes:
  head/ports-mgmt/portlint/Makefile
  head/ports-mgmt/portlint/src/portlint.pl
Comment 7 Joe Marcus Clarke freebsd_committer freebsd_triage 2014-07-28 13:22:18 UTC
Fix has been committed.  Thanks for the report!