From owner-svn-ports-all@FreeBSD.ORG Wed Oct 9 23:01:55 2013 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 90451A34; Wed, 9 Oct 2013 23:01:55 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6D9522D0A; Wed, 9 Oct 2013 23:01:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99N1tYv089353; Wed, 9 Oct 2013 23:01:55 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99N1t2M089343; Wed, 9 Oct 2013 23:01:55 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310092301.r99N1t2M089343@svn.freebsd.org> From: Bryan Drewery Date: Wed, 9 Oct 2013 23:01:55 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r329935 - in head: Mk Mk/Scripts Tools/scripts X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Oct 2013 23:01:55 -0000 Author: bdrewery Date: Wed Oct 9 23:01:54 2013 New Revision: 329935 URL: http://svnweb.freebsd.org/changeset/ports/329935 Log: - Move dialog4ports.sh to more appropriate new directory Mk/Scripts as it is related to infrastructure/framework and a required portmgr- maintained script With hat: portmgr Added: head/Mk/Scripts/dialog4ports.sh - copied unchanged from r329934, head/Tools/scripts/dialog4ports.sh Deleted: head/Tools/scripts/dialog4ports.sh Modified: head/Mk/bsd.port.mk Copied: head/Mk/Scripts/dialog4ports.sh (from r329934, head/Tools/scripts/dialog4ports.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/Mk/Scripts/dialog4ports.sh Wed Oct 9 23:01:54 2013 (r329935, copy of r329934, head/Tools/scripts/dialog4ports.sh) @@ -0,0 +1,48 @@ +#! /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 + # Also do this if PREFIX!=LOCALBASE to avoid missing file or double + # installs + if [ -n "${INSTALL_AS_USER}" -o "${PREFIX}" != "${LOCALBASE}" ]; 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 + +# Backwards compat with older version which used stdout [<= 0.1.1] (or stderr [0.1.2]). +# Clear environment of PKGNAME or the dialog will show on older versions +# that do not understand -v. +if ! env -u PKGNAME ${DIALOG4PORTS} -v > /dev/null 2>&1; then + exec $DIALOG4PORTS > $OPTIONSFILE 2>&1 +fi + +# Newer versions use stderr to work around a jail issue +# http://lists.freebsd.org/pipermail/freebsd-ports/2013-March/082383.html +exec $DIALOG4PORTS 2> $OPTIONSFILE Modified: head/Mk/bsd.port.mk ============================================================================== --- head/Mk/bsd.port.mk Wed Oct 9 22:35:53 2013 (r329934) +++ head/Mk/bsd.port.mk Wed Oct 9 23:01:54 2013 (r329935) @@ -6273,7 +6273,7 @@ do-config: .endif @TMPOPTIONSFILE=$$(mktemp -t portoptions); \ trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \ - ${SETENV} ${D4P_ENV} ${SH} ${PORTSDIR}/Tools/scripts/dialog4ports.sh $${TMPOPTIONSFILE} || { \ + ${SETENV} ${D4P_ENV} ${SH} ${SCRIPTSDIR}/dialog4ports.sh $${TMPOPTIONSFILE} || { \ ${RM} -f $${TMPOPTIONSFILE}; \ ${ECHO_MSG} "===> Options unchanged"; \ exit 0; \