From 14c95abdf07611b6b9403529dd499bca1ad1a91c Mon Sep 17 00:00:00 2001
From: Pietro Incardona <i-bird@localhost.localdomain>
Date: Tue, 15 Mar 2016 23:40:39 +0100
Subject: [PATCH] Fixing installation

---
 script/remove_old | 31 +++++++++++++++++++++++--------
 1 file changed, 23 insertions(+), 8 deletions(-)

diff --git a/script/remove_old b/script/remove_old
index 56d1b51c..28bc6340 100755
--- a/script/remove_old
+++ b/script/remove_old
@@ -74,16 +74,31 @@ function remove_old()
     fi
     
     ## Check the installed version of the dependencies
-    
-    is_update=$(cat $1/BOOST/include/boost/version.hpp | grep "#define BOOST_VERSION 106000")
-    if [ x"$is_update" == x"" ]; then
-    	echo "New boost version, removing the old one"
-        rm -rf $1/BOOST/include
-        rm -rf $1/BOOST/lib
-	rm -rf $1/BOOST
+   
+    cat $1/BOOST/include/boost/version.hpp > /dev/null
+    if [ $? -eq 0 ]; then
+    	is_update=$(cat $1/BOOST/include/boost/version.hpp | grep "#define BOOST_VERSION 106000")
+    	if [ x"$is_update" == x"" ]; then
+    		echo "\033[1;34;5m New boost version, removing the old one \033[0m"
+		sleep 3
+        	rm -rf $1/BOOST/include
+        	rm -rf $1/BOOST/lib
+		rm -rf $1/BOOST
+    	fi
     fi
 
-    
+    ##
+    cat $1/METIS/version
+    if [ $? -eq 0 ]; then
+    	version=$(cat $1/METIS/version)
+    	if [ x"$version" != x"1"  ]; then
+		echo -e "\033[1;34;5m  New METIS version, removing the old one \033[0m"
+		sleep 3
+		rm -rf $1/METIS/include
+        	rm -rf $1/METIS/lib
+        	rm -rf $1/METIS
+	fi
+    fi
 }
 
 
-- 
GitLab