Commit 90c06b48 authored by TomKellyGenetics's avatar TomKellyGenetics
Browse files

configure make remove

parent b4fecd23
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ if [[ -w ${INSTALLDIR} ]]
    #echo "${INSTALLDIR} added to PATH"
    for SHELL_RC in `ls ~/.*rc`
        do
        echo "export PATH=:${INSTALLDIR}:\$PATH" >> $SHELL_RC
        echo "export PATH=${INSTALLDIR}:\$PATH" >> $SHELL_RC
        echo "universc-${version} added to PATH automatically in new ${SHELL} shell session"
    done
    echo "run the following to add it to your shell of choice"
+32 −37
Original line number Diff line number Diff line
@@ -62,52 +62,47 @@ if [[ $prefix == $(pwd) ]] || [[ $prefix == "." ]] || [ $prefix == "../"* ]] ||
   echo "Current directory not removed"
else
    echo "Removing install in $prefix"
    echo "rm -rf $prefix"
fi

exit 0

# add manual directory to PATH if not already found
## check config for Linux
if [[ -f /etc/manpath.config ]]
    then CONFIG="/etc/manpath.config"
    MANDIR=`grep "^MANDATORY_MANPATH" /etc/manpath.config | tail -n 1 | cut -f4`
fi
## check config for Mac
if [[ -f /etc/manpaths ]]
    then CONFIG="/etc/manpaths"
    MANDIR=`tail -n 1 ${CONFIG}`
fi
if [[ -z $CONFIG ]]
    then
    if [[ ! -z $MANPATH ]]
        then
        SHELL_RC=`echo ~/.${0}rc`
        echo "export MANPATH=/usr/local/man" >> $SHELL_RC
        MANDIR=`echo ${MANPATH} | cut -d: -f1`
    fi
fi
if [[ -f  man/launch_universc.sh.1 ]]
    #requires root priviledges for some installations
    if [[ -w ${prefix} ]]
        then
    rm man/launch_universc.sh.1
        echo "rm -rf $prefix"
    fi
#requires root priviledges
if [[ -w ${MANDIR} ]]
    then
    if [[ -f ${MANDIR}/man1/launch_universc.sh.1 ]]
    then
        rm ${MANDIR}/man1/launch_universc.sh.1
fi
    if [[ -f ${MANDIR}/man1/launch_universc.sh.1.gz ]] 

#requires root priviledges if not installed in home directory
if [[ ! -d ${prefix} ]]
    then
        rm ${MANDIR}/man1/launch_universc.sh.1.gz
    fi
    #note does not apply to parent process (only within script for testing version call)
    export PATH=$(echo $PATH | sed -e 's;$INSTALLDIR:;;g')
    #echo "${INSTALLDIR} removed from PATH"
    for SHELL_RC in `ls ~/.*rc`
        do
        sed "/^export PATH=:${INSTALLDIR}:\$PATH$" $SHELL_RC
        echo "universc-${version} will not added to PATH automatically in new ${SHELL} shell session"
    done
    echo "remove the following from ${Home}/.${SHELL}rc to remove it to your shell of choice"
    echo "    export PATH=${INSTALLDIR}:\$PATH >> ~/.\${SHELL}rc"
    echo "To remove convert from your current shell sesssion by running the following:"
    echo " "
    echo "    PATH=\$(echo \$PATH | sed -e 's/;$INSTALLDIR:;;g')"
    echo " "
    echo "convert has been remove from to the $SHELL configuration and will not be automatically loaded"
    echo "run the following to load a fresh environment"
    echo " "
    echo "    source $HOME/.${SHELL}rc"
    echo " "
else
    echo "Directory ${MANDIR} not writeable"
    echo "Directory ${INSTALLDIR} not writeable"
    echo "Warning: installing manual requires root priviledges"
    echo "  Try running of the following:"
    echo "      sudo bash $( cd -P "$( dirname ${BASH_SOURCE[0]})" >/dev/null 2>&1 && pwd )/REMOVE"
    echo "      sudo make remove"
fi

echo "UNINSTALL COMPLETE"
#Note this does not affect the variables in a parent process (interactive shell)
#This must be run there (by the user)
echo source ~/.${SHELL}rc

#remove install file
rm inst/.installed