THRIFT-392. hs: Make test scripts easier to use



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757620 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/hs/runserver.sh b/test/hs/runserver.sh
index c090155..8a953bb 100644
--- a/test/hs/runserver.sh
+++ b/test/hs/runserver.sh
@@ -1,2 +1,12 @@
-#!/bin/bash
-ghci -fglasgow-exts -i/home/iproctor/code/projects/thrift/trunk/lib/hs/src -igen-hs Server.hs
+#!/bin/sh
+
+if [ -z $BASE_PKG ]; then
+    BASE_PKG=`ghc-pkg --simple-output list base-3* | sed -e "s/.*\(base-3\(.[0-9]\){3}\).*/\1/"`
+fi
+
+if [ -z $BASE ]; then
+    BASE=../..
+fi
+
+printf "Starting server... "
+ghc -fglasgow-exts -package $BASE_PKG -hide-package syb -i$BASE/lib/hs/src -i$BASE/test/hs/gen-hs Server.hs -e "putStrLn \"ready.\" >> Server.main"