Bug 161011

Summary: www/dillo2 includes PORTSDIR/Mk file directly
Product: Ports & Packages Reporter: Chris Rees <utisoft>
Component: Individual Port(s)Assignee: Brendan Fabeny <bf>
Status: Closed FIXED    
Severity: Affects Only Me CC: des
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Chris Rees 2011-09-25 17:00:21 UTC
	des@ noticed that dillo2 is one of the many ports that directly includes bsd.openssl.mk rather than using USE_OPENSSL.

	While I was there, I also switched pre.mk for options.mk. I've done some basic tests, and I don't think I broke any OPTIONS, but perhaps you should run your own tests too.

- Use USE_OPENSSL and bsd.port.options.mk

Fix: 

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.--liYyX2M72ytNpxSrxCLadbbbwa9Mf2DTtX5mTWRmyyR80IXm
Content-Type: text/plain; name="dillo2.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="dillo2.diff"

Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/www/dillo2/Makefile,v
retrieving revision 1.53
diff -u -r1.53 Makefile
--- Makefile	30 Jul 2011 08:19:11 -0000	1.53
+++ Makefile	25 Sep 2011 15:54:35 -0000
@@ -38,7 +38,7 @@
 		SSL		"Enable (experimental) https support" On \
 		THREADED_DNS	"Enable re-entrant resolver library" On
 
-.include <bsd.port.pre.mk>
+.include <bsd.port.options.mk>
 
 .ifdef(WITH_COOKIES)
 CONFIGURE_ARGS+=	--enable-cookies
@@ -60,7 +60,7 @@
 
 .ifdef(WITH_SSL)
 CONFIGURE_ARGS+=	--enable-ssl
-.include "${PORTSDIR}/Mk/bsd.openssl.mk"
+USE_OPENSSL=	yes
 .else
 CONFIGURE_ARGS+=	--disable-ssl
 .endif
@@ -94,4 +94,4 @@
 	${INSTALL_MAN} ${WRKSRC}/doc/* ${DOCSDIR}
 .endif
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2011-09-25 17:00:32 UTC
Responsible Changed
From-To: freebsd-ports-bugs->bf

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 h h 2011-09-25 18:25:28 UTC
Chris Rees <utisoft@hotmail.com> writes:

>>Description:
> 	des@ noticed that dillo2 is one of the many ports that directly includes bsd.openssl.mk rather than using USE_OPENSSL.
>
> 	While I was there, I also switched pre.mk for options.mk. I've

While? AFAIK, USE_* cannot be included *after* pre.mk because there is
no OPTIONSFILE processing in post.mk. Another example is ports/148637.
But unlike USE_* flags OPTIONSFILE (the value) cannot depend on the
*contents* of foo.mk before options.mk.

The former can be fixed by using options.mk instead of pre.mk, the
latter by adding yet another bunch of .include directives *before*
options.mk and including OPTIONSFILE one more time inside pre.mk for a
case when USE_* is defined conditionally *after* options.mk.

> done some basic tests, and I don't think I broke any OPTIONS, but
> perhaps you should run your own tests too.

It passes mine, too.

  $ make check-sanity -dd |& sed -n '/\.include/!d; /options$/p; /openssl/p'
  .include /var/db/ports/dillo2/options
  .include /usr/ports/Mk/bsd.openssl.mk

But if I do *not* change pre.mk to options.mk

  $ make check-sanity -dd |& sed -n '/\.include/!d; /options$/p; /openssl/p'
  .include /var/db/ports/dillo2/options

  $ make check-sanity USE_OPENSSL= -dd |& sed -n '/\.include/!d; /options$/p; /openssl/p'
  .include /var/db/ports/dillo2/options
  .include /usr/ports/Mk/bsd.openssl.mk

>
> - Use USE_OPENSSL and bsd.port.options.mk
Comment 3 Chris Rees freebsd_committer freebsd_triage 2011-09-25 19:10:49 UTC
On 25 September 2011 18:25, h h <aakuusta@gmail.com> wrote:
> Chris Rees <utisoft@hotmail.com> writes:
>
>>>Description:
>> =A0 =A0 =A0 des@ noticed that dillo2 is one of the many ports that direc=
tly includes bsd.openssl.mk rather than using USE_OPENSSL.
>>
>> =A0 =A0 =A0 While I was there, I also switched pre.mk for options.mk. I'=
ve
>
> While? AFAIK, USE_* cannot be included *after* pre.mk because there is
> no OPTIONSFILE processing in post.mk. Another example is ports/148637.
> But unlike USE_* flags OPTIONSFILE (the value) cannot depend on the
> *contents* of foo.mk before options.mk.

Don't worry, I've examined the situation closely, and I assure you
I've got this bit right :) I think you may have my sentence the wrong
way round-- it was pre.mk, it's now options.mk.

Have a look at my braindump and complaints at:

http://wiki.freebsd.org/SimplifyingMkIncludes

> The former can be fixed by using options.mk instead of pre.mk, the
> latter by adding yet another bunch of .include directives *before*
> options.mk and including OPTIONSFILE one more time inside pre.mk for a
> case when USE_* is defined conditionally *after* options.mk.
>
>> done some basic tests, and I don't think I broke any OPTIONS, but
>> perhaps you should run your own tests too.
>
> It passes mine, too.
>
> =A0$ make check-sanity -dd |& sed -n '/\.include/!d; /options$/p; /openss=
l/p'
> =A0.include /var/db/ports/dillo2/options
> =A0.include /usr/ports/Mk/bsd.openssl.mk
>
> But if I do *not* change pre.mk to options.mk
>
> =A0$ make check-sanity -dd |& sed -n '/\.include/!d; /options$/p; /openss=
l/p'
> =A0.include /var/db/ports/dillo2/options
>
> =A0$ make check-sanity USE_OPENSSL=3D -dd |& sed -n '/\.include/!d; /opti=
ons$/p; /openssl/p'
> =A0.include /var/db/ports/dillo2/options
> =A0.include /usr/ports/Mk/bsd.openssl.mk
>

Thanks hugely for checking for me though :)

Chris
Comment 4 b. f. 2011-09-25 19:41:41 UTC
On 9/25/11, h h <aakuusta@gmail.com> wrote:
> The following reply was made to PR ports/161011; it has been noted by GNATS.
>
> From: h h <aakuusta@gmail.com>
> To: Chris Rees <crees@FreeBSD.org>
> Cc: bug-followup@FreeBSD.org,  des@FreeBSD.org
> Subject: Re: ports/161011: www/dillo2 includes PORTSDIR/Mk file directly
> Date: Sun, 25 Sep 2011 17:25:28 +0000
>
>  Chris Rees <utisoft@hotmail.com> writes:
>
>  >>Description:
>  > 	des@ noticed that dillo2 is one of the many ports that directly includes
> bsd.openssl.mk rather than using USE_OPENSSL.
>  >
>  > 	While I was there, I also switched pre.mk for options.mk. I've
>
>  While? AFAIK, USE_* cannot be included *after* pre.mk because there is
>  no OPTIONSFILE processing in post.mk. Another example is ports/148637.
>  But unlike USE_* flags OPTIONSFILE (the value) cannot depend on the
>  *contents* of foo.mk before options.mk.

I'm a little confused by the above.  The openssl handling must be done
after the options are read, so that WITH_SSL is properly (un)defined
(as properly, that is, as is possible with the current fragile
options-handling in Ports),  but before the pre-makefile section,
where USE_OPENSSL is acted upon -- I don't see what these other
details, or the other PR, have to do with this case.

b.
Comment 5 Chris Rees 2011-09-30 20:53:03 UTC
Hey,

Would you be OK to commit/approve this? I'll get another committer to 
review it if it's a little contentious, but it concerns me that people 
copy/paste stuff like this!

Chris

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Comment 6 dfilter service freebsd_committer freebsd_triage 2011-10-04 11:08:08 UTC
bf          2011-10-04 10:07:59 UTC

  FreeBSD ports repository

  Modified files:
    security/tor         Makefile 
    security/tor-devel   Makefile 
    www/dillo2           Makefile 
  Log:
  use a more common form of openssl handling
  
  PR:             161011
  Submitted by:   crees
  
  Revision  Changes    Path
  1.117     +4 -3      ports/security/tor-devel/Makefile
  1.76      +4 -3      ports/security/tor/Makefile
  1.54      +3 -3      ports/www/dillo2/Makefile
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 7 Brendan Fabeny freebsd_committer freebsd_triage 2011-10-04 11:13:18 UTC
State Changed
From-To: open->closed

Committed. Thanks!