Author: jm
Date: 2011-06-15 13:17:59 -0700 (Wed, 15 Jun 2011)
New Revision: 25765

Modified:
   csplugins/trunk/toronto/jm/repacker/repack.sh
Log:
Fixed repack.sh so it can handle absolute paths


Modified: csplugins/trunk/toronto/jm/repacker/repack.sh
===================================================================
--- csplugins/trunk/toronto/jm/repacker/repack.sh       2011-06-15 20:10:19 UTC 
(rev 25764)
+++ csplugins/trunk/toronto/jm/repacker/repack.sh       2011-06-15 20:17:59 UTC 
(rev 25765)
@@ -1,26 +1,39 @@
 #!/bin/bash
 
+function abspath {
+    python -c 'import os, sys; print os.path.realpath(sys.argv[1])' "$1"
+}
+
 BUNDLE_NAME=$1
 shift
 
-rm -rf temp-all temp-natives temp-jar bundles
-mkdir -p temp-all
-mkdir -p temp-natives
-mkdir -p temp-jar
-mkdir -p bundles
+SCRIPT_DIR=$(abspath .)
+JAR_DIR=$(abspath temp-jar)
+NATIVES_DIR=$(abspath temp-natives)
+STAGING_DIR=$(abspath temp-staging)
+BUNDLES_DIR=$(abspath bundles)
 
-pushd temp-all
+rm -rf "${JAR_DIR}" "${NATIVES_DIR}" "${STAGING_DIR}"
+mkdir -p "${JAR_DIR}"
+mkdir -p "${NATIVES_DIR}"
+mkdir -p "${STAGING_DIR}"
+mkdir -p "${BUNDLES_DIR}"
+
 for JAR in "$@"
 do
-    unzip -o "../${JAR}"
-    python ../extract_natives.py ${JAR} ../temp-natives
+    JAR=$(abspath "$JAR")
+    pushd "${STAGING_DIR}"
+    unzip -o "${JAR}"
+    python "${SCRIPT_DIR}/extract_natives.py" "${JAR}" "${NATIVES_DIR}"
+    popd
 done
 
-jar cvf ../temp-jar/${BUNDLE_NAME}.jar *
+pushd "${STAGING_DIR}"
+jar cvf "${JAR_DIR}/${BUNDLE_NAME}.jar" *
 popd
 
-pushd temp-natives
-jar cvf ../temp-jar/${BUNDLE_NAME}-natives.jar *
+pushd "${NATIVES_DIR}"
+jar cvf "${JAR_DIR}/${BUNDLE_NAME}-natives.jar" *
 popd
 
-./wrap.sh temp-jar/*.jar
\ No newline at end of file
+"${SCRIPT_DIR}/wrap.sh" "${JAR_DIR}"/*.jar
\ No newline at end of file

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to