summaryrefslogtreecommitdiff
path: root/kernlab.sh
diff options
context:
space:
mode:
authorAndreas Maunz <andreas@maunz.de>2011-03-29 12:57:21 +0200
committerAndreas Maunz <andreas@maunz.de>2011-03-29 12:57:21 +0200
commit0c926b09753901c446d9b5d82b8c3e9307fda887 (patch)
tree143c4174100f3d965365173b63f766a313d0ef28 /kernlab.sh
parentbf309f52283db539ca1f8d9c004cad7eb88b2de4 (diff)
nginx install
Diffstat (limited to 'kernlab.sh')
-rwxr-xr-xkernlab.sh40
1 files changed, 19 insertions, 21 deletions
diff --git a/kernlab.sh b/kernlab.sh
index 0c7d7e8..8da3ec6 100755
--- a/kernlab.sh
+++ b/kernlab.sh
@@ -23,13 +23,9 @@ if [ ! -e "$R" ]; then
fi
# Pkg
-VER="0.9-11"
-
-# Dest
-R_CONF="$HOME/.bash_R_ot"
-DEST="$HOME/r-packages"
+source ./config.sh
if [ -n "$1" ]; then
- DEST="$1"
+ KL_DEST="$1"
fi
@@ -40,38 +36,40 @@ read
DIR="`pwd`"
R_DONE=false
-mkdir "$DEST" >/dev/null 2>&1
-if [ ! -d "$DEST" ]; then
- echo "Install directory '$DEST' is not available! Aborting..."
+mkdir "$KL_DEST" >/dev/null 2>&1
+if [ ! -d "$KL_DEST" ]; then
+ echo "Install directory '$KL_DEST' is not available! Aborting..."
exit 1
else
- if ! rmdir "$DEST" >/dev/null 2>&1; then # if not empty this will fail
- echo "Install directory '$DEST' is not empty. Skipping kernlab installation..."
+ if ! rmdir "$KL_DEST" >/dev/null 2>&1; then # if not empty this will fail
+ echo "Install directory '$KL_DEST' is not empty. Skipping kernlab installation..."
R_DONE=true
+ else
+ mkdir "$KL_DEST" >/dev/null 2>&1
fi
fi
if ! $R_DONE; then
cd /tmp
- if ! $WGET -O - "http://cran.r-project.org/src/contrib/Archive/kernlab/kernlab_$VER.tar.gz">/dev/null 2>&1; then
+ if ! $WGET -O - "http://cran.r-project.org/src/contrib/Archive/kernlab/kernlab_$KL_VER.tar.gz">/dev/null 2>&1; then
echo "Download failed! Aborting..."
exit 1
fi
- export R_LIBS="$DEST"
- $R CMD INSTALL "kernlab_$VER.tar.gz"
+ export R_LIBS="$KL_DEST"
+ $R CMD INSTALL "kernlab_$KL_VER.tar.gz"
fi
echo
echo "Preparing R..."
-if [ ! -f $R_CONF ]; then
- echo "export R_LIBS=\"$DEST\"" >> "$R_CONF"
- echo "R package destination has been stored in '$R_CONF'."
+if [ ! -f $KL_CONF ]; then
+ echo "export R_LIBS=\"$KL_DEST\"" >> "$KL_CONF"
+ echo "R package destination has been stored in '$KL_CONF'."
echo -n "Decide if R configuration should be linked to your .bashrc ('y/n'): "
- read ANSWER_R_CONF
- if [ $ANSWER_R_CONF = "y" ]; then
- echo "source \"$R_CONF\"" >> $HOME/.bashrc
+ read ANSWER_KL_CONF
+ if [ $ANSWER_KL_CONF = "y" ]; then
+ echo "source \"$KL_CONF\"" >> $HOME/.bashrc
fi
else
- echo "It seems R is already configured ('$R_CONF' exists)."
+ echo "It seems R is already configured ('$KL_CONF' exists)."
fi
cd "$DIR"