From e49f38a7929dd87c7c7d829b8e008bc1a26e9363 Mon Sep 17 00:00:00 2001 From: jean-pierre roux Date: Wed, 2 Mar 2011 15:10:43 +0000 Subject: [PATCH] Don't install creaTools as root! --- Linux/menu.sh | 21 ++++++++----- Linux/scripts/CreaTools-install.sh | 14 +++++---- Linux/scripts/CreaTools-uninstall.sh | 45 +++++++++++++++------------- Linux/scripts/ThirdParty-install.sh | 16 ++++++---- 4 files changed, 55 insertions(+), 41 deletions(-) diff --git a/Linux/menu.sh b/Linux/menu.sh index 11727ca..fa20def 100644 --- a/Linux/menu.sh +++ b/Linux/menu.sh @@ -20,8 +20,11 @@ do echo " Install Third Party Libraries :....1 (as root)" echo " Get the 'CreaTools' source files :.2 (CVS : as user!)" echo " Compile the CreaTools :..........3 " - echo " Install the CreaTools :..........4 (as root)" - echo " Uninstall the CreaTools :..........5 (as root)" +# Install creatools as user (no longer as root) // JPR 2/5/2011 +# echo " Install the CreaTools :..........4 (as root)" +# echo " Uninstall the CreaTools :..........5 (as root)" + echo " Install the CreaTools :..........4 " + echo " Uninstall the CreaTools :..........5 " echo echo " Help ..............................7 Help about this menu" echo " Show some Environment Variables ...8" @@ -61,12 +64,14 @@ do then echo WARNING echo - if [ ! -f /etc/bashrc ] - then - export ETC_BASHRC="/etc/bash.bashrc" - else - export ETC_BASHRC="/etc/bashrc" - fi +# Install creatools as user (no longer as root) // JPR 2/5/2011 + #if [ ! -f /etc/bashrc ] + #then + # export ETC_BASHRC="/etc/bash.bashrc" + #else + # export ETC_BASHRC="/etc/bashrc" + #fi + export ETC_BASHRC=$HOME/.bashrc echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :" grep "installPrefixThird=" $ETC_BASHRC diff --git a/Linux/scripts/CreaTools-install.sh b/Linux/scripts/CreaTools-install.sh index d158172..60156ab 100644 --- a/Linux/scripts/CreaTools-install.sh +++ b/Linux/scripts/CreaTools-install.sh @@ -29,12 +29,14 @@ 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 - export ETC_BASHRC="/etc/bash.bashrc" - else - export ETC_BASHRC="/etc/bashrc" - fi +# Install creatools as user (no longer as root) // JPR 2/5/2011 +# if [ ! -f /etc/bashrc ] +# then +# export ETC_BASHRC="/etc/bash.bashrc" +# else +# export ETC_BASHRC="/etc/bashrc" +# fi +export ETC_BASHRC=$HOME/.bashrc # - remove line 'bash $installPrefix/creatools_install/share/creatools_base_librariy_config.sh' if any sed -i -e '/.*creatools_base_library_config.*/ d' $ETC_BASHRC diff --git a/Linux/scripts/CreaTools-uninstall.sh b/Linux/scripts/CreaTools-uninstall.sh index 52a313e..82b2acf 100644 --- a/Linux/scripts/CreaTools-uninstall.sh +++ b/Linux/scripts/CreaTools-uninstall.sh @@ -1,8 +1,8 @@ #!/bin/bash echo "in uninstall" - if [ $UID = 0 ] - then +# if [ $UID = 0 ] +# then # Set all local variables source $PWD/scripts/CreaTools-configure.sh @@ -78,26 +78,29 @@ echo "rm lib's" rm -f creatools_base_library_config.sh -if [ ! -f /etc/bashrc ] -then - export ETC_BASHRC="/etc/bash.bashrc" -else - export ETC_BASHRC="/etc/bashrc" -fi - echo "revert $ETC_BASHRC to previous value" + #if [ ! -f /etc/bashrc ] + #then + # export ETC_BASHRC="/etc/bash.bashrc" + #else + # export ETC_BASHRC="/etc/bashrc" + #fi + # echo "revert $ETC_BASHRC to previous value" # revert /etc/bashrc to previous value # - remove line 'bash $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 + +echo "revert $HOME/.bashrc to previous value" +sed -i -e '/.*creatools_base_library_config.*/ d' $HOME/.bashrc -else - echo - echo "..ERROR.." - echo "===================================================" - echo "REMEMBER !" - echo "" - echo "YOU NEED TO RUN THIS ONE AS root" - echo "===================================================" - echo - echo -fi +#else +# echo +# echo "..ERROR.." +# echo "===================================================" +# echo "REMEMBER !" +# echo "" +# echo "YOU NEED TO RUN THIS ONE AS root" +# echo "===================================================" +# echo +# echo +#fi diff --git a/Linux/scripts/ThirdParty-install.sh b/Linux/scripts/ThirdParty-install.sh index 1a06a94..1b89387 100644 --- a/Linux/scripts/ThirdParty-install.sh +++ b/Linux/scripts/ThirdParty-install.sh @@ -249,12 +249,16 @@ echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$VTK_DIR >> $installPrefixThir # modify .bashrc # - remove line 'bash $installPrefixThird/share/creatools_third_party_library_config.sh' if any (with accurate value for ???) -if [ ! -f /etc/bashrc ] -then - export ETC_BASHRC="/etc/bash.bashrc" -else - export ETC_BASHRC="/etc/bashrc" -fi +# Install creatools as user (no longer as root) // JPR 2/5/2011 +#if [ ! -f /etc/bashrc ] +#then +# export ETC_BASHRC="/etc/bash.bashrc" +#else +# export ETC_BASHRC="/etc/bashrc" +#fi + +export ETC_BASHRC=$HOME/.bashrc + sed -i -e '/.*installPrefixThird*/ d' $ETC_BASHRC sed -i -e '/.*creatools_third_party_library_config.*/ d' $ETC_BASHRC -- 2.45.1