aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2013-03-21 02:55:32 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2013-03-21 02:55:32 +0000
commitbecd92b496a2a5715b0c74fb400a1ca25c408d53 (patch)
treea9f176fe24fbf68f2ecbca944e214a0620d8275e /Tools
parentb58b585ea9f67140560bf1369e7669643536895b (diff)
downloadports-becd92b496a2a5715b0c74fb400a1ca25c408d53.tar.gz
ports-becd92b496a2a5715b0c74fb400a1ca25c408d53.zip
Notes
Diffstat (limited to 'Tools')
-rw-r--r--Tools/scripts/dialog4ports.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/Tools/scripts/dialog4ports.sh b/Tools/scripts/dialog4ports.sh
new file mode 100644
index 000000000000..b3303efb972a
--- /dev/null
+++ b/Tools/scripts/dialog4ports.sh
@@ -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