Index: sm/trunk-jpl/externalpackages/shell2junit/README
===================================================================
--- /issm/trunk-jpl/externalpackages/shell2junit/README	(revision 25978)
+++ 	(revision )
@@ -1,9 +1,0 @@
-http://code.google.com/p/shell2junit/
-
-Shell2junit
-
-Shell2junit is a simple utility which facilitates to generate junit reports for batch processes executed in shell scripts. 
-
-The reports can be easily parsed in Hudson and other CI software in order to monitor and generate trends and alerts. 
-
-This page teaches how to do it in Hudson. 
Index: /issm/trunk-jpl/externalpackages/shell2junit/install.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/shell2junit/install.sh	(revision 25978)
+++ /issm/trunk-jpl/externalpackages/shell2junit/install.sh	(revision 25979)
@@ -3,7 +3,23 @@
 
 
-#Some cleanup
-rm -rf install 
-mkdir install 
+## Constants
+#
+VER="1.0.0"
 
-cp patch/sh2ju.sh install/
+PREFIX="${ISSM_EXT_DIR}/shell2junit/install" # Set to location where external package should be installed
+
+# Cleanup
+rm -rf ${PREFIX}
+mkdir -p ${PREFIX}/bin
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/shell2junit-${VER}.zip" "shell2junit-${VER}.zip"
+
+# Unpack source
+unzip -q shell2junit-${VER}.zip
+
+# Install
+mv shell2junit-${VER}/sh2ju.sh ${PREFIX}/bin
+
+# Cleanup
+rm -rf shell2junit-${VER}
Index: sm/trunk-jpl/externalpackages/shell2junit/install.sh.old
===================================================================
--- /issm/trunk-jpl/externalpackages/shell2junit/install.sh.old	(revision 25978)
+++ 	(revision )
@@ -1,20 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf install src
-rm -rf shell2junit
-mkdir install src
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/shell2junit-1.0.0.zip' 'shell2junit-1.0.0.zip'
-
-#Untar 
-unzip shell2junit-1.0.0.zip
-
-#Move shell2junit into install directory
-mv shell2junit/* src
-rm -rf shell2junit
-
-#Copy executable: 
-cp src/sh2ju.sh install
Index: /issm/trunk-jpl/jenkins/jenkins.sh
===================================================================
--- /issm/trunk-jpl/jenkins/jenkins.sh	(revision 25978)
+++ /issm/trunk-jpl/jenkins/jenkins.sh	(revision 25979)
@@ -431,6 +431,6 @@
 #process logs to be junit compatible
 #{{{
-cd $ISSM_DIR/nightlylog/
-source $ISSM_DIR/externalpackages/shell2junit/install/bin/sh2ju.sh
+cd $ISSM_DIR/nightlylog
+source $ISSM_EXT_DIR/shell2junit/install/bin/sh2ju.sh
 juLogClean
 
@@ -440,8 +440,8 @@
 	testlist=`cat matlab_log.log | grep "\-\-\-\-\-\-\-\-starting" | sed 's/----------------starting://g' | sed 's/-//g'`
 
-	#look through numtests:
+	# NOTE: Matching pattern is "----------------starting:<TEST_NUM>-". Note trailing hyphen, which guards against greedy matching of, for example, "2010" when searching for "201".
 	for i in `echo $testlist`; do
-		juLog -test=MATLAB-$i -name=Error -error=ERROR awk "/^starting:${i}$/{flag=1;next}/^finished:${i}$/{flag=0} flag{print}" matlab_log.log
-		juLog -test=MATLAB-$i -name=Failure -error=FAILURE awk "/^starting:${i}$/{flag=1;next}/^finished:${i}$/{flag=0} flag{print}" matlab_log.log
+		juLog -test=MATLAB-$i -name=Error -error=ERROR awk "/starting:${i}-/{flag=1;next}/finished:${i}-/{flag=0} flag{print}" matlab_log.log
+		juLog -test=MATLAB-$i -name=Failure -error=FAILURE awk "/starting:${i}-/{flag=1;next}/finished:${i}-/{flag=0} flag{print}" matlab_log.log
 	done
 
@@ -466,8 +466,8 @@
 	testlist=`cat python_log.log | grep "\-\-\-\-\-\-\-\-starting" | sed 's/----------------starting://g' | sed 's/-//g'`
 
-	#look through numtests:
+	# NOTE: Matching pattern is "----------------starting:<TEST_NUM>-". Note trailing hyphen, which guards against greedy matching of, for example, "2010" when searching for "201".
 	for i in `echo $testlist`; do
-		juLog -test=PYTHON-$i -name=Error -error=ERROR awk "/^starting:${i}$/{flag=1;next}/^finished:${i}$/{flag=0} flag{print}" python_log.log
-		juLog -test=PYTHON-$i -name=Failure -error=FAILURE awk "/^starting:${i}$/{flag=1;next}/^finished:${i}$/{flag=0} flag{print}" python_log.log
+		juLog -test=PYTHON-$i -name=Error -error=ERROR awk "/starting:${i}-/{flag=1;next}/finished:${i}-/{flag=0} flag{print}" python_log.log
+		juLog -test=PYTHON-$i -name=Failure -error=FAILURE awk "/starting:${i}-/{flag=1;next}/finished:${i}-/{flag=0} flag{print}" python_log.log
 	done
 
