Skip site navigation (1)Skip section navigation (2)
Date:      Mon,  3 Jan 2005 09:04:49 +1100 (EST)
From:      Edwin Groothuis <edwin@mavetju.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/75727: [patch] bsd.port.mk - use default OPTIONS when doing PACKAGE_BUILDING
Message-ID:  <20050102220449.AE46D60EA@k7.mavetju>
Resent-Message-ID: <200501022210.j02MAPnO086020@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         75727
>Category:       ports
>Synopsis:       [patch] bsd.port.mk - use default OPTIONS when doing PACKAGE_BUILDING
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 02 22:10:25 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Edwin Groothuis
>Release:        FreeBSD 5.2.1-RELEASE i386
>Organization:
-
>Environment:
System: FreeBSD k7.mavetju 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #7: Tue Sep 21 23:13:39 EST 2004 root@k7.mavetju:/usr/src-5.2.1/sys/i386/compile/k7 i386

>Description:

Two issues:

- when running PACKAGE_BUILDING or BATCH, OPTIONS isn't honoured.
- when creating INDEX files, OPTIONS isn't honoured.

>How-To-Repeat:

$ cd /usr/ports/databases/libdri-drivers

$ make -V OPTIONS
MYSQL   "With MySQL Driver" on  MSQL    "With MSQL Driver" off  PGSQL   "With PostgreSQL Driver" on  SQLITE     "With SQLite Driver" off

$ PACKAGE_BUILDING=1 make all-depends-list
/usr/ports/databases/libdbi
/usr/ports/devel/gettext
/usr/ports/devel/libtool15

Expected:
$ PACKAGE_BUILDING=1 make all-depends-list
/usr/ports/converters/libiconv
/usr/ports/databases/libdbi
/usr/ports/databases/mysql40-client
/usr/ports/databases/postgresql7
/usr/ports/devel/gettext
/usr/ports/devel/gmake
/usr/ports/devel/libtool13
/usr/ports/devel/libtool15
/usr/ports/lang/perl5
/usr/ports/security/openssl

>Fix:

This patch only fixes it for when PACKAGE_BUILDING is set. I'm not
familiar enough with the building system to know what is set when
"make index" is called. With regarding to BATCH, the 
"if defined(PACKAGE_BUILDING)" could be replace with
"if defined(PACKAGE_BUILDING) || (defined(BATCH) && !exists(${_OPTIONSFILE}))"
and you have the same features there. It still doesn't help with
the "make index", but that's just one step away.

Oh, and zero additional shell commands.

--- /home/edwin/cvs/ports/Mk/bsd.port.mk	Sun Jan  2 18:42:08 2005
+++ bsd.port.mk	Sun Jan  2 22:14:56 2005
@@ -1044,15 +1044,42 @@
 .else
 UNIQUENAME?=	${PKGNAMEPREFIX}${PORTNAME}
 .endif
+
+# Options infrastructure definitions
 OPTIONSFILE?=	${PORT_DBDIR}/${UNIQUENAME}/options
 _OPTIONSFILE!=	${ECHO_CMD} "${OPTIONSFILE}"
 .if defined(OPTIONS)
-.if exists(${_OPTIONSFILE}) && !make(rmconfig)
-.include "${_OPTIONSFILE}"
-.endif
-.if exists(${_OPTIONSFILE}.local)
-.include "${_OPTIONSFILE}.local"
-.endif
+. if defined(PACKAGE_BUILDING)
+.  if defined(OPTIONS)
+REALOPTIONS=${OPTIONS:C/".*"//g}
+.   for O in ${REALOPTIONS}
+RO:=${O}
+.    if ${RO:L} == off
+WITHOUT:=	${WITHOUT} ${OPT}
+.    endif
+.    if ${RO:L} == on
+WITH:=		${WITH} ${OPT}
+.    endif
+OPT:=${RO}
+.   endfor
+.  endif
+.  for W in ${WITH}
+WITH_${W}:=	true
+.  endfor
+.  for W in ${WITHOUT}
+WITHOUT_${W}:=	true
+.  endfor
+. undef WITH
+. undef WITHOUT
+. undef RO
+. undef REALOPTIONS
+. endif
+. if exists(${_OPTIONSFILE}) && !make(rmconfig)
+.  include "${_OPTIONSFILE}"
+. endif
+. if exists(${_OPTIONSFILE}.local)
+.  include "${_OPTIONSFILE}.local"
+. endif
 .endif
 
 # check for old, crufty, makefile types, part 1:
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050102220449.AE46D60EA>