From f9870ec0b466d9aa461eeadf9e0a2e214ffe47e7 Mon Sep 17 00:00:00 2001
From: Pietro Incardona <i-bird@private-incardon-3.mpi-cbg.de>
Date: Thu, 19 May 2016 11:47:42 +0200
Subject: [PATCH] Latest modules

---
 script/discover_package_manager | 2 --
 script/pre_req                  | 4 ----
 script/show_solutions           | 4 ++++
 script/solve_autoconf           | 4 ----
 script/solve_automake           | 4 ----
 script/solve_brew               | 2 --
 script/solve_cmake              | 4 ----
 script/solve_gfortran           | 4 ----
 script/solve_git                | 4 ----
 script/solve_gpp                | 4 ----
 script/solve_libtool            | 4 ----
 script/solve_wget               | 4 ----
 12 files changed, 4 insertions(+), 40 deletions(-)

diff --git a/script/discover_package_manager b/script/discover_package_manager
index 8ea9d7279..0341883ce 100755
--- a/script/discover_package_manager
+++ b/script/discover_package_manager
@@ -16,8 +16,6 @@ function discover_package_manager() {
           echo -e "\033[43;30;1;5mWARNING: \033[0m $brew_idir is not writtable, brew require that $brew_idir is writtable and $brew_idir/bin is in your PATH, otherwise it will be not possible to install with brew"
           commands[0]="sudo chown -R $USER $brew_idir && chmod -R u+w $brew_idir"
           possible_solutions "${commands[@]}"
-          echo "Executing: ${command[$possible_solutions_ret]}"
-          eval ${commands[$possible_solutions_ret]}
         fi
       fi
       if [ ! -w  ]; then
diff --git a/script/pre_req b/script/pre_req
index 56419fca3..dbb483d2d 100755
--- a/script/pre_req
+++ b/script/pre_req
@@ -47,8 +47,6 @@ if [ x"$platform" = x"linux" -a x"$pcman" = x"sudo apt-get"  ]; then
     echo "OpenFPM require additional packages in order to install correctly"
     commands[0]="$pcman install libbz2-dev python-dev libxml2-dev libxslt-dev"
     possible_solutions "${commands[@]}"
-    echo "Executing: ${command[$possible_solutions_ret]}"
-    eval ${commands[$possible_solutions_ret]}
   fi
 fi
 
@@ -67,8 +65,6 @@ if [ x"$platform" = x"linux" -a x"$pcman" = x"yum"  ]; then
     commands[0]="su -c \"$pcman install bzip2-devel python-devel libxml2-devel libxslt-devel\""
     commands[1]="sudo $pcman install bzip2-devel python-devel libxml2-devel libxslt-devel"
     possible_solutions "${commands[@]}"
-    echo "Executing: ${command[$possible_solutions_ret]}"
-    eval ${commands[$possible_solutions_ret]}
   fi
 fi
 
diff --git a/script/show_solutions b/script/show_solutions
index 110a65450..bb1af0875 100755
--- a/script/show_solutions
+++ b/script/show_solutions
@@ -15,5 +15,9 @@ function possible_solutions {
   exit 1
  fi
  possible_solutions_ret=`expr $choose - 1`
+   if [ $sq -eq 0 ]; then
+   echo "Executing: ${command[$possible_solutions_ret]}"
+   eval ${commands[$possible_solutions_ret]}
+ fi
 }
 
diff --git a/script/solve_autoconf b/script/solve_autoconf
index cb1f7cd50..f03dadad7 100755
--- a/script/solve_autoconf
+++ b/script/solve_autoconf
@@ -13,14 +13,10 @@ fi
 if [ x"$1" = x"osx" ]; then
         commands[0]="$pcman install autoconf"
         possible_solutions "${commands[@]}"
-        echo "Executing: ${command[$possible_solutions_ret]}"
-        eval ${commands[$possible_solutions_ret]}
 elif [ x"$1" = x"linux"  ]; then
         commands[0]="su -c \"$pcman install autoconf\""
         commands[1]="sudo $pcman install autoconf"
         possible_solutions "${commands[@]}"
-        echo "Executing: ${command[$possible_solutions_ret]}"
-        eval ${commands[$possible_solutions_ret]}
 fi
 }
 
diff --git a/script/solve_automake b/script/solve_automake
index 3f72585f9..d67b84310 100755
--- a/script/solve_automake
+++ b/script/solve_automake
@@ -13,14 +13,10 @@ fi
 if [ x"$1" = x"osx" ]; then
         commands[0]="$pcman install automake"
         possible_solutions "${commands[@]}"
-        echo "Executing: ${command[$possible_solutions_ret]}"
-        eval ${commands[$possible_solutions_ret]}
 elif [ x"$1" = x"linux"  ]; then
         commands[0]="su -c \"$pcman install automake\""
         commands[1]="sudo $pcman install automake"
         possible_solutions "${commands[@]}"
-        echo "Executing: ${command[$possible_solutions_ret]}"
-        eval ${commands[$possible_solutions_ret]}
 fi
 }
 
diff --git a/script/solve_brew b/script/solve_brew
index bbc74a59d..f532baf85 100755
--- a/script/solve_brew
+++ b/script/solve_brew
@@ -6,8 +6,6 @@ source script/show_solutions
 if [ x"$1" = x"osx" ]; then
         commands[0]="ruby -e \"\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\""
         possible_solutions "${commands[@]}"
-        echo "Executing: ${command[$possible_solutions_ret]}"
-        eval ${commands[$possible_solutions_ret]}
 fi
 }
 
diff --git a/script/solve_cmake b/script/solve_cmake
index 2cb41a077..ffa472c9c 100755
--- a/script/solve_cmake
+++ b/script/solve_cmake
@@ -14,14 +14,10 @@ fi
 if [ x"$1" = x"osx" ]; then 
         commands[0]="$pcman install cmake"
         possible_solutions "${commands[@]}"
-        echo "Executing: ${command[$possible_solutions_ret]}"
-        eval ${commands[$possible_solutions_ret]}
 elif [ x"$1" = x"linux"  ]; then
         commands[0]="su -c \"$pcman install cmake\""
         commands[1]="sudo $pcman install cmake"
         possible_solutions "${commands[@]}"
-        echo "Executing: ${command[$possible_solutions_ret]}"
-        eval ${commands[$possible_solutions_ret]}
 fi 
 }
 
diff --git a/script/solve_gfortran b/script/solve_gfortran
index af6d465c4..4314a7e60 100755
--- a/script/solve_gfortran
+++ b/script/solve_gfortran
@@ -13,14 +13,10 @@ fi
 if [ x"$1" = x"osx" ]; then 
         commands[0]="$pcman install gcc"
         possible_solutions "${commands[@]}"
-        echo "Executing: ${command[$possible_solutions_ret]}"
-        eval ${commands[$possible_solutions_ret]}
 elif [ x"$1" = x"linux"  ]; then
         commands[0]="su -c \"$pcman install gfortran\""
         commands[1]="sudo $pcman install gfortran"
         possible_solutions "${commands[@]}"
-        echo "Executing: ${command[$possible_solutions_ret]}"
-        eval ${commands[$possible_solutions_ret]}
 fi 
 }
 
diff --git a/script/solve_git b/script/solve_git
index cdb015761..aa8031014 100755
--- a/script/solve_git
+++ b/script/solve_git
@@ -12,13 +12,9 @@ fi
 
 if [ x"$1" = x"osx" ]; then
         commands[0]="$pcman install git"
-        possible_solutions "${commands[@]}"
-	eval ${command[possible_solutions_ret]}
 elif [ x"$1" = x"linux"  ]; then
         commands[0]="su -c \"$pcman install git\""
         commands[1]="sudo $pcman install git"
-        possible_solutions "${commands[@]}"
-	eval ${commands[$possible_solutions_ret]}
 fi
 }
 
diff --git a/script/solve_gpp b/script/solve_gpp
index f94d74dde..bfebc468f 100755
--- a/script/solve_gpp
+++ b/script/solve_gpp
@@ -14,8 +14,6 @@ if [ x"$1" = x"osx" ]; then
         commands[0]="$pcman install gcc49"
         commands[1]="echo \"Continue without installing\""
         possible_solutions "${commands[@]}"
-        echo "Executing: ${command[$possible_solutions_ret]}"
-        eval ${commands[$possible_solutions_ret]}
         compiler_opt=" CXX=g++-4.9 CC=gcc-4.9  "
         compiler_gcc="gcc-4.9"
         compiler_gpp="g++-4.9"
@@ -23,8 +21,6 @@ elif [ x"$1" = x"linux"  ]; then
         commands[0]="su -c \"$pcman install gcc-c++\""
         commands[1]="sudo $pcman install gcc-c++"
         possible_solutions "${commands[@]}"
-        echo "Executing: ${command[$possible_solutions_ret]}"
-        eval ${commands[$possible_solutions_ret]}
         compiler_gcc="gcc"
         compiler_gpp="g++"
 fi
diff --git a/script/solve_libtool b/script/solve_libtool
index 131d22b2d..ae13efd4b 100755
--- a/script/solve_libtool
+++ b/script/solve_libtool
@@ -15,14 +15,10 @@ fi
 if [ x"$1" = x"osx" ]; then
         commands[0]="$pcman install libtool"
         possible_solutions "${commands[@]}"
-        echo "Executing: ${command[$possible_solutions_ret]}"
-        eval ${commands[$possible_solutions_ret]}
 elif [ x"$1" = x"linux"  ]; then
         commands[0]="su -c \"$pcman install libtool\""
         commands[1]="sudo $pcman install libtool"
         possible_solutions "${commands[@]}"
-        echo "Executing: ${command[$possible_solutions_ret]}"
-        eval ${commands[$possible_solutions_ret]}
 fi
 }
 
diff --git a/script/solve_wget b/script/solve_wget
index e6de78aa5..12ed48143 100755
--- a/script/solve_wget
+++ b/script/solve_wget
@@ -13,14 +13,10 @@ fi
 if [ x"$1" = x"osx" ]; then
         commands[0]="$pcman install wget"
         possible_solutions "${commands[@]}"
-        echo "Executing: ${command[$possible_solutions_ret]}"
-        eval ${commands[$possible_solutions_ret]}
 elif [ x"$1" = x"linux"  ]; then
         commands[0]="su -c \"$pcman install wget\""
         commands[1]="sudo $pcman install wget"
         possible_solutions "${commands[@]}"
-        echo "Executing: ${command[$possible_solutions_ret]}"
-        eval ${commands[$possible_solutions_ret]}
 fi
 }
 
-- 
GitLab