Index: /issm/trunk-jpl/jenkins/jenkins.sh
===================================================================
--- /issm/trunk-jpl/jenkins/jenkins.sh	(revision 20386)
+++ /issm/trunk-jpl/jenkins/jenkins.sh	(revision 20387)
@@ -45,9 +45,57 @@
 #}}}
 
-#testing
+#testing {{{
+echo "======================================================";
+echo "             Determining Installation type            "
+echo "======================================================";
 ISSM_EXTERNALPACKAGES="none"
+ISSM_RECONFIGURE="no"
 ISSM_COMPILATION="no"
-echo "Current svn version is $SVN_REVISION_1"
+if [ -a $ISSM_DIR/svn_revision_old ]
+then
+	SVN_PREVIOUS=$(cat $ISSM_DIR/svn_revision_old)
+	SVN_CURRENT=`$SVNVERSION`
+	echo "Previous revision number: $SVN_PREVIOUS"
+	echo "Current  revision number: $SVN_CURRENT"
+
+	svn diff -r $SVN_PREVIOUS:$SVN_CURRENT --summarize $ISSM_DIR > $ISSM_DIR/TEMP
+	echo "List of changed files"
+	cat $ISSM_DIR/TEMP
+
+	#Do we need to reinstall externalpackages?
+	if [ ! -z "$(cat $ISSM_DIR/TEMP | grep externalpackages)" ] ; then
+		echo "  -- checking for changed externalpackages... yes";
+		ISSM_EXTERNALPACKAGES="install"
+	else
+		echo "  -- checking for changed externalpackages... no";
+		ISSM_EXTERNALPACKAGES="none"
+	fi
+
+	#Do we need to reconfigure
+	if [ ! -z "$(cat $ISSM_DIR/TEMP | grep -e "Makefile.am" -e "m4" )" ] ; then
+		echo "  -- checking for reconfiguration... yes";
+		ISSM_RECONFIGURE="yes"
+	else
+		echo "  -- checking for reconfiguration... no";
+		ISSM_RECONFIGURE="no"
+	fi
+
+	#Do we need to recompile
+	if [ ! -z "$(cat $ISSM_DIR/TEMP | grep -e "\.cpp" -e "\.h" )" ] ; then
+		echo "  -- checking for recompilation... yes";
+		ISSM_COMPILATION="yes"
+	else
+		echo "  -- checking for recompilation... no";
+		ISSM_COMPILATION="no"
+	fi
+
+else
+	ISSM_EXTERNALPACKAGES="install"
+	ISSM_RECONFIGURE="yes"
+	ISSM_COMPILATION="yes"
+fi
+echo "Recording current svn version: $SVN_REVISION_1"
 echo $SVN_REVISION_1 > $ISSM_DIR/svn_revision_old
+#}}}
 
 #install/copy/none external packages    (ISSM_EXTERNALPACKAGES){{{
@@ -163,10 +211,19 @@
 then
 	cd $ISSM_DIR
-	make uninstall
-	make distclean
-	./scripts/automakererun.sh
-   eval "./configure $ISSM_CONFIG"
+	if [ "$ISSM_RECONFIGURE" == "yes" ]
+	then
+		echo "======================================================";
+		echo "             Cleaning up and reconfiguring            "
+		echo "======================================================";
+		make uninstall
+		make distclean
+		./scripts/automakererun.sh
+		eval "./configure $ISSM_CONFIG"
+	fi
 
 	#4: compile and install ISSM
+	echo "======================================================";
+	echo "                    Compiling ISSM                    "
+	echo "======================================================";
 	if [ $NUMCPUS_INSTALL -gt 1 ]; then
 		echo "Making with " $NUMCPUS_INSTALL " cpus"
