[72005] trunk/dports/games/PlasmaClient

ryandesign at macports.org ryandesign at macports.org
Wed Sep 29 17:51:38 PDT 2010


Revision: 72005
          http://trac.macports.org/changeset/72005
Author:   ryandesign at macports.org
Date:     2010-09-29 17:51:36 -0700 (Wed, 29 Sep 2010)
Log Message:
-----------
PlasmaClient: update to 244, remove notes, add username/password interface in wrapper script

Modified Paths:
--------------
    trunk/dports/games/PlasmaClient/Portfile
    trunk/dports/games/PlasmaClient/files/PlasmaClient.in

Modified: trunk/dports/games/PlasmaClient/Portfile
===================================================================
--- trunk/dports/games/PlasmaClient/Portfile	2010-09-29 22:49:19 UTC (rev 72004)
+++ trunk/dports/games/PlasmaClient/Portfile	2010-09-30 00:51:36 UTC (rev 72005)
@@ -5,7 +5,7 @@
 PortGroup                   cmake 1.0
 
 name                        PlasmaClient
-version                     0.0-239
+version                     0.0-244
 categories                  games
 platforms                   darwin
 maintainers                 ryandesign
@@ -22,7 +22,7 @@
 
 fetch.type                  hg
 hg.url                      http://uru.zrax.net/hg/plasmaclient
-hg.tag                      3f95126dda88
+hg.tag                      7db98e0ff970
 
 # Decompress these into MO:ULa data dir
 #http://stashbox.org/919902/python.zip
@@ -77,15 +77,6 @@
     xinstall -d -m 777 ${destroot}${prefix}/var/log/${name}
 }
 
-notes "
-To run PlasmaClient, write your Myst Online: URU Live again username and password into the preferences plist like this:
-
-    defaults write org.macports.PlasmaClient username YOURUSERNAME
-    defaults write org.macports.PlasmaClient password YOURPASSWORD
-
-(replacing YOURUSERNAME with your username and YOURPASSWORD with your password). Then open PlasmaClient in ${applications_dir}.
-"
-
 platform darwin powerpc {
     notes-append "\n\n${name} probably does not work at all on PowerPC Macs at this time; try an Intel Mac."
 }

Modified: trunk/dports/games/PlasmaClient/files/PlasmaClient.in
===================================================================
--- trunk/dports/games/PlasmaClient/files/PlasmaClient.in	2010-09-29 22:49:19 UTC (rev 72004)
+++ trunk/dports/games/PlasmaClient/files/PlasmaClient.in	2010-09-30 00:51:36 UTC (rev 72005)
@@ -1,34 +1,57 @@
 #!/bin/sh
 # $Id$
 
-usage() {
-    osascript \
-        -e 'tell app "Finder"' \
-        -e 'activate' \
-        -e 'display dialog (do shell script "@PREFIX@/bin/port -q notes PlasmaClient") buttons "OK" default button 1 with title "PlasmaClient" with icon note' \
-        -e 'end'
-    exit 1
-}
+if [ -z "$PREFIX" ]; then
+    PREFIX="@PREFIX@"
+fi
 
-PLIST=org.macports.PlasmaClient
+LOGDIR="${PREFIX}/var/log/PlasmaClient"
+LOGFILE="PlasmaClient.$(date '+%s').log"
+LOGLINK="PlasmaClient.log"
+PLIST="org.macports.PlasmaClient"
 
 USERNAME="$(defaults read $PLIST username)"
 PASSWORD="$(defaults read $PLIST password)"
+LASTLOGINFAILED=0
+if [ -r "${LOGDIR}/${LOGLINK}" ]; then
+    if [ -n "$(grep '^Login failed:' ${LOGDIR}/${LOGLINK})" ]; then
+        LASTLOGINFAILED=1
+    fi
+fi
 
-if [ -z "$USERNAME" -o -z "$PASSWORD" ]; then
-    usage
+
+if [ -z "${USERNAME}" -o -z "${PASSWORD}" -o ${LASTLOGINFAILED} -eq 1 ]; then
+    USERNAME="$(osascript \
+        -e 'tell app "Finder"' \
+        -e 'activate' \
+        -e "display dialog \"PlasmaClient needs to know your Myst Online: URU Live again account name (email address). (If you enter this incorrectly, PlasmaClient will hang during startup.)\" default answer \"${USERNAME}\" buttons {\"Cancel\", \"OK\"} default button \"OK\" with title \"PlasmaClient\" with icon note" \
+        -e 'return text returned of the result' \
+        -e 'end')" || exit
+    if [ -z "${USERNAME}" ]; then
+        exit
+    fi
+    
+    PASSWORD="$(osascript \
+        -e 'tell app "Finder"' \
+        -e 'activate' \
+        -e "display dialog \"PlasmaClient needs to know your Myst Online: URU Live again password. (If you enter this incorrectly, PlasmaClient will hang during startup.)\" default answer \"${PASSWORD}\" with hidden answer buttons {\"Cancel\", \"OK\"} default button \"OK\" with title \"PlasmaClient\" with icon note" \
+        -e 'return text returned of the result' \
+        -e 'end')" || exit
+    if [ -z "${PASSWORD}" ]; then
+        exit
+    fi
+    
+    defaults write $PLIST username "$USERNAME"
+    defaults write $PLIST password "$PASSWORD"
 fi
 
-LOGDIR="@PREFIX@/var/log/PlasmaClient"
 KEEPLOGS=10
 cd "${LOGDIR}"
 ls PlasmaClient.*.log 2>/dev/null | sort -n -r | sed "1,$((${KEEPLOGS} - 1))d" | xargs rm -f
 
-LOGFILE="PlasmaClient.$(date '+%s').log"
-LOGLINK="PlasmaClient.log"
 rm -f "${LOGDIR}/${LOGLINK}"
 ln -s "${LOGFILE}" "${LOGDIR}/${LOGLINK}"
 echo "Logging to ${LOGDIR}/${LOGFILE}"
 
-cd "@PREFIX@/share/mystonline/data"
-"@PREFIX@/bin/PlasmaClient" "${USERNAME}" "${PASSWORD}" > "${LOGDIR}/${LOGFILE}" 2>&1
+cd "${PREFIX}/share/mystonline/data" || exit 1
+"${PREFIX}/bin/PlasmaClient" "${USERNAME}" "${PASSWORD}" > "${LOGDIR}/${LOGFILE}" 2>&1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100929/05f77566/attachment-0001.html>


More information about the macports-changes mailing list