FreeBSD Bugzilla – Attachment 39065 Details for
Bug 61683
[PATCH] bsd.port.mk: enhanced OPTIONS handling
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 6.39 KB, created by
Oliver Eikemeier
on 2004-01-21 20:00:35 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Oliver Eikemeier
Created:
2004-01-21 20:00:35 UTC
Size:
6.39 KB
patch
obsolete
>Index: Mk/bsd.port.mk >=================================================================== >RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v >retrieving revision 1.480 >diff -u -r1.480 bsd.port.mk >--- Mk/bsd.port.mk 20 Jan 2004 22:27:01 -0000 1.480 >+++ Mk/bsd.port.mk 21 Jan 2004 18:48:01 -0000 >@@ -70,7 +70,7 @@ > # PKGNAMESUFFIX - Suffix to specify compilation options. Optional. > # Do not define this in your Makefile. > # UNIQUENAME - A name for your port that is globally unique. By default, >-# this is set to ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX} >+# this is set to ${LATEST_LINK} when set, ${PKGNAMEPREFIX}${PORTNAME} else > # DISTNAME - Name of port or distribution used in generating > # WRKSRC and DISTFILES below (default: > # ${PORTNAME}-${PORTVERSION}). >@@ -1019,13 +1019,20 @@ > # where 'make config' records user configuration options > PORT_DBDIR?= /var/db/ports > >-UNIQUENAME?=${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX} >-OPTIONSFILE?=${PORT_DBDIR}/${UNIQUENAME}/options >-.if exists(${OPTIONSFILE}) >-.include "${OPTIONSFILE}" >+.if defined(LATEST_LINK) >+UNIQUENAME?= ${LATEST_LINK} >+.else >+UNIQUENAME?= ${PKGNAMEPREFIX}${PORTNAME} >+.endif >+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 exists(${OPTIONSFILE}.local) >-.include "${OPTIONSFILE}.local" > .endif > > # check for old, crufty, makefile types, part 1: >@@ -2888,7 +2895,7 @@ > ################################################################ > .if (!defined(OPTIONS) || defined(CONFIG_DONE) || \ > defined(PACKAGE_BUILDING) || defined(BATCH) || \ >- exists(${OPTIONSFILE}) || exists(${OPTIONSFILE}.local)) >+ exists(${_OPTIONSFILE}) || exists(${_OPTIONSFILE}.local)) > _OPTIONS_OK=yes > .endif > >@@ -2965,6 +2972,13 @@ > .else > @${DO_NADA} > .endif >+.if defined(_OPTIONS_READ) >+ @${ECHO_MSG} "===> Found saved configuration for ${_OPTIONS_READ}" >+.if ${OPTIONSFILE} != ${_OPTIONSFILE} >+ @${ECHO_MSG} "===> *** CAUTION *** Using wrong configuration file ${_OPTIONSFILE}" >+.endif >+.endif >+ > > # Warn user about deprecated packages. Advisory only. > >@@ -4903,10 +4917,14 @@ > .if !defined(OPTIONS) > @${ECHO_MSG} "===> No options to configure" > .else >- @(${MKDIR} ${PORT_DBDIR}/${UNIQUENAME} 2> /dev/null) || \ >- (${ECHO_MSG} "===> Cannot create ${PORT_DBDIR}/${UNIQUENAME}, check permissions"; exit 1) >- -@if [ -e ${OPTIONSFILE} ]; then \ >- . ${OPTIONSFILE}; \ >+.if ${OPTIONSFILE} != ${_OPTIONSFILE} >+ @${ECHO_MSG} "===> Using wrong configuration file ${_OPTIONSFILE}" >+ @exit 1 >+.endif >+ @(${MKDIR} `dirname ${_OPTIONSFILE}` 2> /dev/null) || \ >+ (${ECHO_MSG} "===> Cannot create `dirname ${_OPTIONSFILE}`, check permissions"; exit 1) >+ -@if [ -e ${_OPTIONSFILE} ]; then \ >+ . ${_OPTIONSFILE}; \ > fi; \ > set ${OPTIONS} XXX; \ > while [ $$# -gt 3 ]; do \ >@@ -4916,7 +4934,6 @@ > withoutvar=WITHOUT_$$1; \ > withval=$$(eval ${ECHO_CMD} $$\{$${withvar}\}); \ > withoutval=$$(eval ${ECHO_CMD} $$\{$${withoutvar}\}); \ >- ${ECHO_CMD} $${withval}; \ > if [ ! -z "$${withval}" ]; then \ > val=on; \ > elif [ ! -z "$${withoutval}" ]; then \ >@@ -4926,10 +4943,10 @@ > fi; \ > DEFOPTIONS="$${DEFOPTIONS} $$1 \"$$2\" $${val}"; \ > shift 3; \ >- done > /dev/null; \ >+ done; \ > TMPOPTIONSFILE=$$(mktemp -t portoptions); \ > trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \ >- ${SH} -c "${DIALOG} --checklist \"Options for ${PORTNAME} ${PORTVERSION}\" 21 70 15 $${DEFOPTIONS} 2> $${TMPOPTIONSFILE}"; \ >+ ${SH} -c "${DIALOG} --checklist \"Options for ${PKGNAME:C/-([^-]+)$/ \1/}\" 21 70 15 $${DEFOPTIONS} 2> $${TMPOPTIONSFILE}"; \ > status=$$?; \ > if [ $${status} -ne 0 ] ; then \ > ${RM} -f $${TMPOPTIONSFILE}; \ >@@ -4937,19 +4954,21 @@ > exit 0; \ > fi; \ > if [ ! -e ${TMPOPTIONSFILE} ]; then \ >- ${ECHO_MSG} "===> No user-specified options to save for ${PORTNAME}"; \ >+ ${ECHO_MSG} "===> No user-specified options to save for ${PKGNAME}"; \ > exit 0; \ > fi; \ > SELOPTIONS=$$(${CAT} $${TMPOPTIONSFILE}); \ > ${RM} -f $${TMPOPTIONSFILE}; \ >- ${ECHO_MSG} "# This file is auto-generated by 'make config'. No user-servicable parts" > ${OPTIONSFILE}; \ >- ${ECHO_MSG} "# inside!" >> ${OPTIONSFILE}; \ >+ ${ECHO_CMD} "# This file is auto-generated by 'make config'." > ${_OPTIONSFILE}; \ >+ ${ECHO_CMD} "# No user-servicable parts inside!" >> ${_OPTIONSFILE}; \ >+ ${ECHO_CMD} "# Options for ${PKGNAME}" >> ${_OPTIONSFILE}; \ >+ ${ECHO_CMD} "_OPTIONS_READ=${PKGNAME}" >> ${_OPTIONSFILE}; \ > for i in $${OPTIONSLIST}; do \ > ${ECHO_CMD} $${SELOPTIONS} | ${GREP} -qw $${i}; \ > if [ $$? -eq 0 ]; then \ >- ${ECHO_CMD} WITH_$${i}=true >> ${OPTIONSFILE}; \ >+ ${ECHO_CMD} WITH_$${i}=true >> ${_OPTIONSFILE}; \ > else \ >- ${ECHO_CMD} WITHOUT_$${i}=true >> ${OPTIONSFILE}; \ >+ ${ECHO_CMD} WITHOUT_$${i}=true >> ${_OPTIONSFILE}; \ > fi; \ > done > .endif >@@ -4957,9 +4976,28 @@ > > .if !target(showconfig) > showconfig: >-.if exists(${OPTIONSFILE}) >- @${ECHO_MSG} "===> The following configuration options are set for ${PORTNAME}"; \ >- ${GREP} -v ^# ${OPTIONSFILE} >+.if defined(OPTIONS) && exists(${_OPTIONSFILE}) >+ @${ECHO_MSG} "===> The following configuration options are set for ${PKGNAME}:" >+ -@if [ -e ${_OPTIONSFILE} ]; then \ >+ . ${_OPTIONSFILE}; \ >+ fi; \ >+ set ${OPTIONS} XXX; \ >+ while [ $$# -gt 3 ]; do \ >+ defaultval=$$3; \ >+ withvar=WITH_$$1; \ >+ withoutvar=WITHOUT_$$1; \ >+ withval=$$(eval ${ECHO_CMD} $$\{$${withvar}\}); \ >+ withoutval=$$(eval ${ECHO_CMD} $$\{$${withoutvar}\}); \ >+ if [ ! -z "$${withval}" ]; then \ >+ val=on; \ >+ elif [ ! -z "$${withoutval}" ]; then \ >+ val=off; \ >+ else \ >+ val="$$3 (default)"; \ >+ fi; \ >+ ${ECHO_MSG} " $$1=$${val} \"$$2\""; \ >+ shift 3; \ >+ done > .else > @${ECHO_MSG} "===> No configuration options are set for this port" > .if defined(OPTIONS) >@@ -4970,12 +5008,12 @@ > > .if !target(rmconfig) > rmconfig: >-.if exists(${OPTIONSFILE}) >- -@${ECHO_MSG} "===> Removing user-configured options for ${PORTNAME}"; \ >- ${RM} -f ${OPTIONSFILE}; \ >- ${RMDIR} ${PORT_DBDIR}/${UNIQUENAME} >+.if defined(OPTIONS) && exists(${_OPTIONSFILE}) >+ -@${ECHO_MSG} "===> Removing user-configured options for ${PKGNAME}"; \ >+ ${RM} -f ${_OPTIONSFILE}; \ >+ ${RMDIR} `dirname ${_OPTIONSFILE}` > .else >- @${ECHO_MSG} "===> No user-specified options configured for ${PORTNAME}" >+ @${ECHO_MSG} "===> No user-specified options configured for ${PKGNAME}" > .endif > .endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 61683
: 39065