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

configure passing directory from upgrade to remove

parent 98b1f399
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -141,6 +141,10 @@ make install prefix=$HOME/local
zsh inst/INSTALL --prefix $HOME/local
```

```
bash inst/UPGRADE --prefix "/home/tom/local"
```

### System Requirements

...Unix systems with cellranger installed.
+6 −5
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ else
fi
if [[ $(which launch_universc.sh) != *"not found" ]]
    then
    SHELL='' 
    SHELL=$SHELL
    invocation=$0
else
    if [[ -z $ZSH_VERSION ]]
@@ -29,9 +29,6 @@ else
    invocation=$(echo $(basename $0))
fi

#default install location (root)
if [[ -z $prefix ]]; then prefix="/usr/local/share"; fi

if [[ $1 == "--prefix" ]]
     then
     prefix=$2
@@ -45,7 +42,11 @@ if [[ $1 == "--prefix" ]]
    fi
fi

if [[ $prefix=="." ]]
#default install location (root)
if [[ -z $prefix ]]; then prefix="/usr/local/share"; fi


if [[ $prefix=="\." ]]
    then
    prefix=`pwd`
fi
+19 −3
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ else
fi
if [[ $(which launch_universc.sh) != *"not found" ]]
    then
    SHELL='' 
    SHELL=$SHELL
    invocation=$0
else
    if [[ -z $ZSH_VERSION ]]
@@ -29,6 +29,19 @@ else
    invocation=$(echo $(basename $0))
fi

if [[ $1 == "--prefix" ]]
     then
     prefix=$2
     if [[ ! -d $prefix ]]
        then
        echo "--prefix $prefix must be a directory"
    fi
    if [[ ! -w $prefix ]]
        then
        echo "--prefix $prefix must be a writeable"
    fi
fi

if [[ -z $prefix ]]
    then
    #check for existing install
@@ -85,7 +98,7 @@ if [[ ! -w $prefix ]]
fi


if [[ $prefix == $(pwd) ]] || [[ $prefix == "." ]] || [ $prefix == "../"* ]] || [[ $prefix == "./"* ]]
if [[ $prefix == $(pwd) ]] || [[ $prefix == "\." ]] || [[ $prefix == "\.\.\/"* ]] || [[ $prefix == "\.\/"* ]]
   then
   echo "Current directory not removed"
else
@@ -133,4 +146,7 @@ echo "UNINSTALL COMPLETE"
echo source ~/.${SHELL}rc

#remove install file
if [[ -f inst/.installed ]]
    then
    rm inst/.installed
fi
+16 −10
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ else
fi
if [[ $(which launch_universc.sh) != *"not found" ]]
    then
    SHELL='' 
    SHELL=$SHELL
    invocation=$0
else
    if [[ -z $ZSH_VERSION ]]
@@ -29,9 +29,6 @@ else
    invocation=$(echo $(basename $0))
fi

#default install location (root)
if [[ -z $prefix ]]; then prefix="/usr/local/share"; fi

if [[ $1 == "--prefix" ]]
     then
     prefix=$2
@@ -44,9 +41,13 @@ if [[ $1 == "--prefix" ]]
        echo "--prefix $prefix must be a writeable"
    fi
fi

if [[ $prefix=="." ]]
echo $prefix
#default install location (root)
if [[ -z $prefix ]]; then default="true"; prefix="/usr/local/share"; fi
echo $prefix
if [[ $prefix=="\." ]]
    then
    echo "$prefix"
    prefix=`pwd`
fi

@@ -56,13 +57,13 @@ if [[ "universc" == $(echo $prefix | rev | cut -d'/' -f1 | rev) ]]
    prefix=$(echo $prefix | cut -d'/' -f1-$(($( echo $prefix | grep -o "/" | wc -l))))
    INSTALLDIR=${prefix}/universc
fi

echo $prefix
if [[ ! -w $prefix ]]
    then
    echo "$prefix must be a writeable directory"
    echo "try running:"
    echo "    sudo bash $( cd -P "$( dirname ${BASH_SOURCE[0]})" >/dev/null 2>&1 && pwd )/INSTALL"
    echo "    sudo make install"
    echo "    sudo bash $( cd -P "$( dirname ${BASH_SOURCE[0]})" >/dev/null 2>&1 && pwd )/UPGRADE"
    echo "    sudo make upgrade"
    exit 1
fi

@@ -95,7 +96,12 @@ if [[ -f inst/.installed ]] || [[ $(which launch_universc.sh) != *"not found" ]
    fi
fi

echo $SHELL inst/REMOVE
if [[ -w $prefix ]]
    then
    $(eval echo $SHELL inst/REMOVE --prefix $prefix)
else
    $(eval echo $SHELL inst/REMOVE)
fi

exit 0
echo $prefix > inst/.installed