Bug 93273 - devel/portlint: is wrong when checking USE_RC_SUBR
Summary: devel/portlint: is wrong when checking USE_RC_SUBR
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Joe Marcus Clarke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-13 10:20 UTC by Ion-Mihai " IOnut " Tetcu
Modified: 2006-02-14 12:00 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 Ion-Mihai " IOnut " Tetcu 2006-02-13 10:20:03 UTC

portlint mistakes something in USE_RC_SUBR check and gives a fatal error.

How-To-Repeat: 

itetcu@it> /home/itetcu/tmp/CVS/ports/mail/dspam-devel [11:59:23] 0
 > portlint -C
 [ ... ]
FATAL: ${PORTNAME}${RC_SUFX} listed in USE_RC_SUBR, but files/${PORTNAME}${RC_SUFX}.in is missing.
1 fatal errors and 13 warnings found.
itetcu@it> /home/itetcu/tmp/CVS/ports/mail/dspam-devel [11:59:28] 1
 > make -V PORTNAME -V RC_SUFX
dspam-devel
.sh
itetcu@it> /home/itetcu/tmp/CVS/ports/mail/dspam-devel [11:59:41] 0
 > ls files/dspam-devel.sh.in
files/dspam-devel.sh.in


If the Makefile is changed to:

itetcu@it> /home/itetcu/tmp/CVS/ports/mail/dspam-devel [12:08:37] 0
 > grep RC_S Makefile
#RC_SUFX=       .sh
#USE_RC_SUBR=   ${PORTNAME}${RC_SUFX}
USE_RC_SUBR=    ${PORTNAME}

and the file exists:

itetcu@it> /home/itetcu/tmp/CVS/ports/mail/dspam-devel [12:08:44] 0
 > ls files/dspam-devel.in
files/dspam-devel.in

the error is still there:

itetcu@it> /home/itetcu/tmp/CVS/ports/mail/dspam-devel [12:11:00] 0
 > portlint -C
 [ ... ]
FATAL: ${PORTNAME} listed in USE_RC_SUBR, but files/${PORTNAME}.in is missing.
Comment 1 Erwin Lansing freebsd_committer freebsd_triage 2006-02-13 10:21:10 UTC
Responsible Changed
From-To: freebsd-ports-bugs->marcus

Over to maintainer
Comment 2 Doug Barton 2006-02-13 19:46:47 UTC
Adding the suffix as you have in this port is not necessary, or desirable.
There is already code in bsd.port.mk to handle this correctly. (Also, see
http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/93265).

If you simply remove the RC_SUFX stuff from you port, it will do the right
thing for you.

hope this helps,

Doug

-- 

	If you're never wrong, you're not trying hard enough
Comment 3 Ion-Mihai " IOnut " Tetcu 2006-02-13 20:11:01 UTC
On Mon, 13 Feb 2006 11:46:47 -0800
Doug Barton <dougb@dougbarton.us> wrote:

> Adding the suffix as you have in this port is not necessary, or
> desirable. There is already code in bsd.port.mk to handle this
> correctly. (Also, see
> http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/93265).

Yes, Pav filled that PR after a lenghty disscution with me and you, as
you probably remember ;) 

> If you simply remove the RC_SUFX stuff from you port, it will do the
> right thing for you.

Yes, however portlint still compains.

Actually the problem is that portlint to check USE_RC_SUBR looks after
the literal value (what's on the right-hand of the =):
USE_RC_SUBR= ${PORTNAME}  ---> 'files/${PORTNAME}'
USE_RC_SUBR= dsapm-devel     ---> 'files/dspm-devel'
which IMO is wrong, since there's no reason not to use the var
(${PORTNAME}) instead of writing the VAR's value by hand.



-- 
IOnut
Unregistered ;) FreeBSD "user"
Comment 4 Doug Barton 2006-02-13 20:45:50 UTC
Ion-Mihai Tetcu wrote:
> On Mon, 13 Feb 2006 11:46:47 -0800
> Doug Barton <dougb@dougbarton.us> wrote:
> 
>> Adding the suffix as you have in this port is not necessary, or
>> desirable. There is already code in bsd.port.mk to handle this
>> correctly. (Also, see
>> http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/93265).
> 
> Yes, Pav filled that PR after a lenghty disscution with me and you, as
> you probably remember ;) 

Actually I filed that particular one last night, but if Pav already has one
in, so much the better.

>> If you simply remove the RC_SUFX stuff from you port, it will do the
>> right thing for you.
> 
> Yes, however portlint still compains.

It _should_ complain about the RC_SUFX stuff, but ...

> Actually the problem is that portlint to check USE_RC_SUBR looks after
> the literal value (what's on the right-hand of the =):
> USE_RC_SUBR= ${PORTNAME}  ---> 'files/${PORTNAME}'
> USE_RC_SUBR= dsapm-devel     ---> 'files/dspm-devel'
> which IMO is wrong, since there's no reason not to use the var
> (${PORTNAME}) instead of writing the VAR's value by hand.

You're right about that. I'll try to look at the portlint code and see if
there is a way to dereference the variable to get that value.

Doug

-- 

	If you're never wrong, you're not trying hard enough
Comment 5 Joe Marcus Clarke freebsd_committer freebsd_triage 2006-02-14 03:20:42 UTC
State Changed
From-To: open->closed

Fixed in 2.8.5.
Comment 6 Ion-Mihai " IOnut " Tetcu 2006-02-14 11:51:59 UTC
On Mon, 13 Feb 2006 12:45:50 -0800
Doug Barton <dougb@dougbarton.us> wrote:

> Ion-Mihai Tetcu wrote:
> > On Mon, 13 Feb 2006 11:46:47 -0800
> > Doug Barton <dougb@dougbarton.us> wrote:
> > 
> >> Adding the suffix as you have in this port is not necessary, or
> >> desirable. There is already code in bsd.port.mk to handle this
> >> correctly. (Also, see
> >> http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/93265).
> > 
> > Yes, Pav filled that PR after a lenghty disscution with me and you,
> > as you probably remember ;) 
> 
> Actually I filed that particular one last night, but if Pav already
> has one in, so much the better.

:) sorry. It's very close to the one I remember and I looked at the
content.
 
> >> If you simply remove the RC_SUFX stuff from you port, it will do
> >> the right thing for you.
> > 
> > Yes, however portlint still compains.
> 
> It _should_ complain about the RC_SUFX stuff, but ...
> 
> > Actually the problem is that portlint to check USE_RC_SUBR looks
> > after the literal value (what's on the right-hand of the =):
> > USE_RC_SUBR= ${PORTNAME}  ---> 'files/${PORTNAME}'
> > USE_RC_SUBR= dsapm-devel     ---> 'files/dspm-devel'
> > which IMO is wrong, since there's no reason not to use the var
> > (${PORTNAME}) instead of writing the VAR's value by hand.
> 
> You're right about that. I'll try to look at the portlint code and
> see if there is a way to dereference the variable to get that value.

I see it's fixed in 2.8.5. My thanks to you and marcus@


-- 
IOnut
Unregistered ;) FreeBSD "user"