From owner-svn-ports-head@FreeBSD.ORG Thu Mar 21 02:55:33 2013 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BA042626; Thu, 21 Mar 2013 02:55:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9EBF125E; Thu, 21 Mar 2013 02:55:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2L2tXmp091858; Thu, 21 Mar 2013 02:55:33 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2L2tXXe091855; Thu, 21 Mar 2013 02:55:33 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201303210255.r2L2tXXe091855@svn.freebsd.org> From: Bryan Drewery Date: Thu, 21 Mar 2013 02:55:33 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r314799 - in head: Mk Tools/scripts ports-mgmt/dialog4ports X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Mar 2013 02:55:33 -0000 Author: bdrewery Date: Thu Mar 21 02:55:32 2013 New Revision: 314799 URL: http://svnweb.freebsd.org/changeset/ports/314799 Log: - Remove prompt for dialog4ports. Dialog4Ports is a required part of ports 'make config' now. This is seen as not much different than any other dependency. - Allow dialog4ports to work with INSTALL_AS_USER by building and using the port's WRKDIR version through a Tools/scripts wrapper - Add NO_DIALOG for 'config' as well. - Fix D4P environment variables not passing to dialog4ports: D4PHEIGHT, D4PWIDTH, D4PFULLSCREEN Reviewed by: miwi, bapt, rum1cro@yandex.ru Tested by: miwi, bapt, rum1cro@yandex.ru Tested by: bdrewery (small exp-run) Requested by: many Added: head/Tools/scripts/dialog4ports.sh (contents, props changed) Modified: head/Mk/bsd.port.mk head/ports-mgmt/dialog4ports/Makefile Modified: head/Mk/bsd.port.mk ============================================================================== --- head/Mk/bsd.port.mk Thu Mar 21 02:54:52 2013 (r314798) +++ head/Mk/bsd.port.mk Thu Mar 21 02:55:32 2013 (r314799) @@ -6088,7 +6088,13 @@ D4P_ENV= PKGNAME="${PKGNAME}" \ OPTIONS_MULTI="${OPTIONS_MULTI}" \ OPTIONS_SINGLE="${OPTIONS_SINGLE}" \ OPTIONS_RADIO="${OPTIONS_RADIO}" \ - OPTIONS_GROUP="${OPTIONS_GROUP}" + OPTIONS_GROUP="${OPTIONS_GROUP}" \ + DIALOG4PORTS="${DIALOG4PORTS}" \ + PORTSDIR="${PORTSDIR}" \ + MAKE="${MAKE}" \ + D4PHEIGHT="${D4PHEIGHT}" \ + D4PWIDTH="${D4PWIDTH}" \ + D4PFULLSCREEN="${D4PFULLSCREEN}" .if exists(${PKGHELP}) D4P_ENV+= PKGHELP="${PKGHELP}" .endif @@ -6147,11 +6153,12 @@ do-config: .endif @TMPOPTIONSFILE=$$(mktemp -t portoptions); \ trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \ - ${SETENV} ${D4P_ENV} ${DIALOG4PORTS} > $${TMPOPTIONSFILE} || { \ + ${SETENV} ${D4P_ENV} ${SH} ${PORTSDIR}/Tools/scripts/dialog4ports.sh $${TMPOPTIONSFILE} || { \ ${RM} -f $${TMPOPTIONSFILE}; \ ${ECHO_MSG} "===> Options unchanged"; \ exit 0; \ }; \ + ${ECHO_CMD}; \ if [ ! -e $${TMPOPTIONSFILE} ]; then \ ${ECHO_MSG} "===> No user-specified options to save for ${PKGNAME}"; \ exit 0; \ @@ -6183,21 +6190,13 @@ do-config: .endif .endif # do-config -.if !target(config-depend) -config-depend: -.if !exists(${DIALOG4PORTS}) && !defined(NO_DIALOG) - @echo -n "dialog4ports isn't installed, do you want to install it now? [Y/n] "; \ - read answer; \ - case $$answer in \ - [Nn]|[Nn][Oo]) \ - exit 1; \ - esac; \ - cd ${PORTSDIR}/ports-mgmt/dialog4ports; ${MAKE} install clean -.endif -.endif - .if !target(config) -config: pre-config config-depend do-config +.if !defined(NO_DIALOG) +config: pre-config do-config +.else +config: + @${ECHO_MSG} "===> Skipping 'config' as NO_DIALOG is defined" +.endif .endif # config .if !target(config-recursive) Added: head/Tools/scripts/dialog4ports.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/Tools/scripts/dialog4ports.sh Thu Mar 21 02:55:32 2013 (r314799) @@ -0,0 +1,37 @@ +#! /bin/sh +# $FreeBSD$ +# Maintainer: portmgr@FreeBSD.org +set -e + +if [ -z "${DIALOG4PORTS}" -o -z "${PORTSDIR}" -o -z "${MAKE}" ]; then + echo "DIALOG4PORTS, MAKE and PORTSDIR required in environment." >&2 + exit 1 +fi + +: ${DIALOGPORT:=ports-mgmt/dialog4ports} +: ${DIALOGNAME:=dialog4ports} + +OPTIONSFILE="$1" + +if ! [ -e $DIALOG4PORTS ]; then + # If INSTALL_AS_USER is set then just build and use the WRKDIR version + if [ -n "${INSTALL_AS_USER}" ]; then + if ! [ -d "${PORTSDIR}/${DIALOGPORT}" ]; then + echo "===> Skipping 'config' as ${DIALOGPORT} is not checked out" >&2 + exit 1 + fi + DIALOG4PORTS=$(${MAKE} -C ${PORTSDIR}/${DIALOGPORT} -V DIALOG4PORTS) + if ! [ -e "${DIALOG4PORTS}" ]; then + echo "===> Building ${DIALOGNAME} as it is required for the config dialog" + ${MAKE} -C ${PORTSDIR}/${DIALOGPORT} -D NO_DIALOG clean build + fi + else + # Build+install through su-install as normal + echo "===> Building/installing ${DIALOGNAME} as it is required for the config dialog" + ${MAKE} -C ${PORTSDIR}/${DIALOGPORT} -D NO_DIALOG clean install + # Need to clean again as it can't run twice in 1 call above + ${MAKE} -C ${PORTSDIR}/${DIALOGPORT} -D NO_DIALOG clean + fi +fi + +exec $DIALOG4PORTS > $OPTIONSFILE Modified: head/ports-mgmt/dialog4ports/Makefile ============================================================================== --- head/ports-mgmt/dialog4ports/Makefile Thu Mar 21 02:54:52 2013 (r314798) +++ head/ports-mgmt/dialog4ports/Makefile Thu Mar 21 02:55:32 2013 (r314799) @@ -24,6 +24,12 @@ MAKE_JOBS_SAFE= yes .include +## This is used by 'make config' via Tools/scripts/dialog4ports.sh +## Use caution in changing +.if !exists(${DIALOG4PORTS}) +DIALOG4PORTS= ${WRKSRC}/dialog4ports +.endif + .if ${OSVERSION} < 900030 DISTFILES= ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX} \ ${DIALOGNAME}.tgz:dialog