]> Creatis software - creaToolsTools.git/commitdiff
This one should solve the troubles with Ubuntu
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Mon, 14 Feb 2011 17:41:27 +0000 (17:41 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Mon, 14 Feb 2011 17:41:27 +0000 (17:41 +0000)
(/etc/bashrc vs /etc/bash.bashrc)

Linux/README.txt
Linux/menu.sh
Linux/scripts/CreaTools-install.sh
Linux/scripts/CreaTools-uninstall.sh
Linux/scripts/ThirdParty-install.sh

index 8abf0bdf875e343bed44b435f9e206b1649e0789..f19da6562e026b425ead67eee354315caeab69ac 100644 (file)
@@ -1,14 +1,12 @@
 
-A) switch as root
-
-B) sh menu.sh
+A) bash menu.sh
 
 You will be prompted to say what you want to do :
 
  Configure :........................0 
  Install Third Party Libraries :....1 (as root)
- Get the 'CreaTools' source files :.2 (CVS : as user!)
- Compile   the CreaTools :..........3 
+ Get the 'CreaTools' source files :.2 (if CVS : as user!)
+ Compile   the CreaTools :..........3 (as you like [root/user])
  Install   the CreaTools :..........4 (as root)
  Uninstall the CreaTools :..........5 (as root)
  
@@ -17,7 +15,7 @@ You will be prompted to say what you want to do :
  Exit :.............................9
 
 
-C) Choose 'Configure' (0)
+B) Choose 'Configure' (0)
 
 You will be prompted to give your preferences :
 
@@ -32,18 +30,19 @@ You will be prompted to give your preferences :
 "Build type : Release/Debug (default is Release)"
 "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
 
-D) If 'Third Party Libraries' are not yet installed,
-choose 'Install Third Party Libraries' (1)
+C) If 'Third Party Libraries' are not yet installed,
+    - switch as root (if not already done)
+    - choose 'Install Third Party Libraries' (1)
 
-E) Close the window and open a new one.
+D) Close the window and open a new one.
    switch as root again
    bash menu.sh
    
-F) Choose Get the CreaTools source files ' (2)
+E) Choose 'Get the CreaTools source files' (2)
    
-G) Choose 'Compile the CreaTools' (3)
+F) Choose 'Compile the CreaTools' (3)
 
-H) Choose 'Install the CreaTools' (4)
+G) Choose 'Install the CreaTools' (4)
 
-I) Close the window and open a new one.
+H) Close the window and open a new one.
    You can work, now.
index 9bb34880444f2458c34da72a93e76e5b48191675..a965358a6cd4af655677bb7b6cd653db7b8548f0 100644 (file)
@@ -43,7 +43,7 @@ do
      while [[ "$suitable" != "YES" && \
               "$suitable" != "yes" && \
               "$suitable" != "Y"   && \
-              "$suitable" != "y"   && \                    
+              "$suitable" != "y"   && \
               "$suitable" != "NO"  && \
               "$suitable" != "no"  ]]
      do          
@@ -66,18 +66,21 @@ do
              then
                 echo
                 echo "You are probabely running under UBUNTU OS  ?"
-                echo "Troubles expected!"
+                echo "Troubles expected! (Hope NO!)"
                 echo   
                 echo "Hit any key to continue"
                  read a
-              else 
-                 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
-                 grep "installPrefixThird=" /etc/bashrc 
-                 echo "VTK_DIR :...." $VTK_DIR
-                 echo "ITK_DIR :...." $ITK_DIR
-                 echo "GDCM_DIR :..." $GDCM_DIR
-                echo "(Have a look at /etc/bashrc, edit it or run again Install Third Party Libraries if you disagree)"
-              fi
+                echo export ETC_BASHRC="/etc/bash.bashrc"
+              else
+                 echo export ETC_BASHRC="/etc/bashrc"
+              fi             
+              echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
+                
+              grep "installPrefixThird=" $ETC_BASHRC 
+              echo "VTK_DIR :...." $VTK_DIR
+              echo "ITK_DIR :...." $ITK_DIR
+              echo "GDCM_DIR :..." $GDCM_DIR
+             echo "(Have a look at $ETC_BASHRC=, edit it or run again Install Third Party Libraries if you disagree)"
         fi
        echo    
         echo "Are these values suitable for you : YES/NO? (default is YES)"
@@ -108,7 +111,6 @@ do
         OperatingSystem="XXX"
         while [[ "$OperatingSystem" != "Fedora" && \
                  "$OperatingSystem" != "Ubuntu" && \
-
                 "$OperatingSystem" != "MacOS" ]]
         do
            echo "Operating System : Fedora/Ubuntu/MacOS (default : Fedora)"
@@ -370,10 +372,10 @@ do
 #      done
 #      echo "you said [" $latexCompilerVariable "]"     
 
-#     sed -i -e '/.*VTK_DIR*/ d'        /etc/bashrc
-#     sed -i -e '/.*LATEX_COMPILER*/ d' /etc/bashrc 
-#     echo "export VTK_DIR=$vtkdirVariable" >> /etc/bashrc
-#     echo "export LATEX_COMPILER=$latexCompilerVariable" >> /etc/bashrc
+#     sed -i -e '/.*VTK_DIR*/ d'        $ETC_BASHRC
+#     sed -i -e '/.*LATEX_COMPILER*/ d' $ETC_BASHRC 
+#     echo "export VTK_DIR=$vtkdirVariable" >> $ETC_BASHRC
+#     echo "export LATEX_COMPILER=$latexCompilerVariable" >> $ETC_BASHRC
 
      if [ "$sourcesFrom" = "CVS" ]
      then
index 76cb71f0aef3eebe3a8d61da8a2f510d51bcead8..9dd0fc48efbc5bcaf62a03a33228866a0fc63af7 100644 (file)
@@ -28,12 +28,24 @@ then
   echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib/creatools   >> $installPrefix/share/creatools_base_library_config.sh
   echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib64/creatools >> $installPrefix/share/creatools_base_library_config.sh
   
-
+             if [ ! -f /etc/bashrc ]
+             then
+                echo
+                echo "You are probabely running under UBUNTU OS  ?"
+                echo "Troubles expected! (Hope NO!)"
+                echo   
+                echo "Hit any key to continue"
+                 read a
+                echo export ETC_BASHRC="/etc/bash.bashrc"
+              else
+                 echo export ETC_BASHRC="/etc/bashrc"
+              fi
+             
   # - remove line 'sh $installPrefix/creatools_install/share/creatools_base_libraries_config.sh' if any
-  sed -i -e '/.*creatools_base_library_config.*/ d' /etc/bashrc
-  #  modify /etc/bashrc (we cannot modify .bashrc, since we witched as root)  
+  sed -i -e '/.*creatools_base_library_config.*/ d' $ETC_BASHRC
+  #  modify /etc/bashrc (we cannot modify .bashrc, since we switched as root)  
   # - add line 'sh $installPrefix/creatools_install/share/creatools_base_libraries_config.sh'
-  echo source $installPrefix/share/creatools_base_library_config.sh >> /etc/bashrc
+  echo source $installPrefix/share/creatools_base_library_config.sh >> $ETC_BASHRC
 else
   echo
   echo "..ERROR.."
index b58c94e0b2a5d4d68d95e78d2a86bec8c9351240..d1f4b114f2d3f993d20a23d46c94678042fc5f37 100644 (file)
@@ -75,9 +75,23 @@ rm -rf creaMaracasVisu
   rm -rf bbtk creaImageIO creaNewProject creaContours creaMaracasVisu  
   rm -f creatools_base_library_config.sh
 
+
+if [ ! -f /etc/bashrc ]
+then
+    echo
+    echo "You are probabely running under UBUNTU OS  ?"
+    echo "Troubles expected!"
+    echo
+    echo "Hit any key to continue"scripts/CreaTools-uninstall.sh
+    read a
+    echo export ETC_BASHRC="/etc/bash.bashrc"
+else
+    echo export ETC_BASHRC="/etc/bashrc"
+fi
+
   # revert /etc/bashrc to previous value  
   # - remove line 'sh $installPrefix/creatools_install/share/creatools_base_party_libraries_config.sh'
-  sed -i -e '/.*creatools_base_library_config.*/ d' /etc/bashrc 
+  sed -i -e '/.*creatools_base_library_config.*/ d' $ETC_BASHRC 
 
 else
   echo
index 369e5c83f9f95f2a8acd9a520679108e8c462994..11d5ca0a943d3bbf5ceb198ac1b4eaae51060338 100644 (file)
@@ -245,20 +245,23 @@ echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$VTK_DIR           >> $installPrefixThir
 
 if [ ! -f /etc/bashrc ]
 then
-   echo
-   echo "You are probabely running under UBUNTU OS  ?"
-   echo "Troubles expected!"
-   echo
-   echo "Hit any key to continue"
-   read a
+    echo
+    echo "You are probabely running under UBUNTU OS  ?"
+    echo "Troubles expected!"
+    echo
+    echo "Hit any key to continue"scripts/CreaTools-uninstall.sh
+    read a
+    echo export ETC_BASHRC="/etc/bash.bashrc"
 else
-   sed -i -e '/.*installPrefixThird*/ d' /etc/bashrc
-   sed -i -e '/.*creatools_third_party_library_config.*/ d' /etc/bashrc
+    echo export ETC_BASHRC="/etc/bashrc"
 fi
+   sed -i -e '/.*installPrefixThird*/ d' $ETC_BASHRC
+   sed -i -e '/.*creatools_third_party_library_config.*/ d' $ETC_BASHRC
+
 
 # - add line 'sh $installPrefixThird/share/creatools_third_party_library_config.sh' (with accurate value for ???)
-echo installPrefixThird=$installPrefixThird >> /etc/bashrc
-echo '[ -f "$installPrefixThird/share/creatools_third_party_library_config.sh" ] &&  source $installPrefixThird/share/creatools_third_party_library_config.sh' >> /etc/bashrc 
+echo installPrefixThird=$installPrefixThird >> $ETC_BASHRC
+echo '[ -f "$installPrefixThird/share/creatools_third_party_library_config.sh" ] &&  source $installPrefixThird/share/creatools_third_party_library_config.sh' >> $ETC_BASHRC