Revision
140573
Author
ryandesign@macports.org
Date
2015-09-23 12:02:30 -0700 (Wed, 23 Sep 2015)

Log Message

waitport: make compatible with MacPorts 2.3+

Modified Paths

Diff

Modified: users/ryandesign/scripts/waitport (140572 => 140573)


--- users/ryandesign/scripts/waitport	2015-09-23 18:57:51 UTC (rev 140572)
+++ users/ryandesign/scripts/waitport	2015-09-23 19:02:30 UTC (rev 140573)
@@ -2,13 +2,14 @@
 
 # Waits for MacPorts to finish what it's doing, then exits.
 
-PORT="$(which port 2>&1)"
+PORT_TCLSH="$(which port-tclsh 2>&1)"
+PORT_TCLSH="$(readlink "$PORT_TCLSH" || echo "$PORT_TCLSH")"
 
-if [ ! -x "$PORT" ]; then
-    echo "port command not found" 1>&2
+if [ ! -x "$PORT_TCLSH" ]; then
+    echo "port-tclsh command not found" 1>&2
     exit 1
 fi
 
-while [ -n "$(ps aww | grep "/usr/bin/tclsh $PORT" | grep -v grep)" ]; do
+while [ -n "$(ps aww | grep "$PORT_TCLSH" | grep -v grep)" ]; do
     sleep 1
 done