Bug 195889

Summary: check-plist does not respect @comment
Product: Ports & Packages Reporter: Dmitry Marakasov <amdmi3>
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: Closed Works As Intended    
Severity: Affects Many People    
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description Dmitry Marakasov freebsd_committer freebsd_triage 2014-12-11 13:52:07 UTC
As shown by the example below, check-plist target does not respect @comment statements in pkg-plist: @comment'ed @dir which is invisible to pkg, is though treated by check plist as regular @dir.

% cat Makefile
PORTNAME=       testport
PORTVERSION=    0.0.0
CATEGORIES=     sysutils
DISTFILES=      #

MAINTAINER=     amdmi3@FreeBSD.org
COMMENT=        #

NO_BUILD=       yes

do-install:
        ${MKDIR} ${STAGEDIR}${PREFIX}/testdir

.include <bsd.port.mk>
% cat pkg-plist 
% sudo make clean stage check-plist 2>&1 | grep -A1 "Checking for items in STAGEDIR"
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: @dir testdir
% echo "@dir testdir" > pkg-plist 
% sudo make clean stage check-plist 2>&1 | gerp -A1 "Checking for items in STAGEDIR"
===> Checking for items in STAGEDIR missing from pkg-plist
===> Checking for items in pkg-plist which are not in STAGEDIR
% echo "@comment @dir testdir" > pkg-plist                                      
% sudo make clean stage check-plist 2>&1 | gerp -A1 "Checking for items in STAGEDIR"
===> Checking for items in STAGEDIR missing from pkg-plist
===> Checking for items in pkg-plist which are not in STAGEDIR
% echo -n > pkg-plist 
% sudo make clean stage check-plist 2>&1 | gerp -A1 "Checking for items in STAGEDIR"
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: @dir testdir
Comment 1 Antoine Brodin freebsd_committer freebsd_triage 2014-12-28 21:35:38 UTC
Yes, you can use @comment to whitelist orphans,  this is a feature not a bug
Comment 2 Dmitry Marakasov freebsd_committer freebsd_triage 2014-12-29 02:04:54 UTC
This is bug as it changes meaning of @comment. There should be another directive with clear meaning like @ignore, while @comment should do what it means - make an entry invisible to anything what parses plist.
Comment 3 Dmitry Marakasov freebsd_committer freebsd_triage 2016-04-13 12:53:26 UTC
I don't think this can be closed while the problem remains. I at least demand a comment.
Comment 4 Mathieu Arnold freebsd_committer freebsd_triage 2016-04-13 14:10:49 UTC
Well, antoine already said that, but...

It works as intended, if you have "@comment file" and that "file" is here, it is ignored.

If you want to work on a different implementation, please do so, provide a patch, and open a PR about it.

But I repeat, @comment works as intended.