[Genabel-commits] r2041 - pkg/GenABEL-general/distrib_scripts

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jan 18 16:33:45 CET 2016


Author: lckarssen
Date: 2016-01-18 16:33:44 +0100 (Mon, 18 Jan 2016)
New Revision: 2041

Added:
   pkg/GenABEL-general/distrib_scripts/makedistrib_GenABEL-tutorial.sh
Modified:
   pkg/GenABEL-general/distrib_scripts/makedistrib_GenABEL.sh
Log:
Add makedistrib script for the GenABEL tutorial

This version is still a bit elementary. It assumes all dependencies have been installed and doesn't try to install them for you.


Added: pkg/GenABEL-general/distrib_scripts/makedistrib_GenABEL-tutorial.sh
===================================================================
--- pkg/GenABEL-general/distrib_scripts/makedistrib_GenABEL-tutorial.sh	                        (rev 0)
+++ pkg/GenABEL-general/distrib_scripts/makedistrib_GenABEL-tutorial.sh	2016-01-18 15:33:44 UTC (rev 2041)
@@ -0,0 +1,97 @@
+#!/bin/bash
+#
+# This script tries to package an R package by downloading it from the
+# SVN server. It includes the required R CMD checks before building
+# the package.
+#
+# Run this script in a separate directory. For final submission, run
+# do a clean run, without any options.
+#
+# Command line options:
+# -n|--nocheckout: the previously checked out source code will not be
+#   deleted and no SVN checkout will be done. This is handy when trying
+#   out some of your local changes.
+# -u|--user <username>: Use <username> when checking out from SVN.
+
+PKG=GenABEL_general
+TUT_DEPS_SVN="GenABEL GenABEL.data DatABEL MetABEL MixABEL"
+TUT_DEPS_GIT="filevector ProbABEL"
+
+# Exit on errors and when encountering uninitialised variables
+set -e
+set -u
+
+# Find the directory where this script (and others it depends on) are
+# located
+scriptdir=$(dirname $0)
+
+source ${scriptdir}/distrib_support_functions.sh
+init_buildenv
+
+# Parse command line options
+NOCHECKOUT=false
+CRANCHECK=true
+SVNUSER=""
+while [ $# -gt 0 ]; do
+    case $1 in
+        -n | --nocheckout )
+            NOCHECKOUT=true
+            ;;
+        -u | --user )
+            shift
+            SVNUSER=${1:?Error: please specify SVN user name after the -u option}
+            echo "Using SVN user name $SVNUSER"
+            ;;
+        -* )
+            echo "$0: invalid option $1" >&2
+            exit 1
+            ;;
+        *)
+            break
+            ;;
+    esac
+    shift
+done
+
+echo "--------------------------------------------------"
+echo "Removing old files and directories (if present)"
+echo "--------------------------------------------------"
+if [ ${NOCHECKOUT} == false ]; then
+    rm -rf ${PKG}
+    for DEP in ${TUT_DEPS_SVN} ${TUT_DEPS_GIT}; do
+        rm -rf ${DEP}
+    done
+fi
+
+if [ ${NOCHECKOUT} == false ]; then
+    echo
+    echo "--------------------------------------------------"
+    echo "Checking out source code from SVN..."
+    echo "--------------------------------------------------"
+    if [ -z ${SVNUSER} ]; then
+        SVNCMD="svn export"
+        SVNBASE=svn://svn.r-forge.r-project.org/svnroot/genabel/
+    else
+        SVNCMD="svn checkout"
+        SVNBASE=svn+ssh://${SVNUSER}@svn.r-forge.r-project.org/svnroot/genabel/
+    fi
+
+    # GITBASE=https://github.com/GenABEL-Project
+    # for DEP in ${TUT_DEPS_GIT}; do
+    #     git clone ${GITBASE}/${DEP}.git
+    # done
+    # for DEP in ${TUT_DEPS_SVN}; do
+    #     ${SVNCMD} ${SVNBASE}/pkg/${DEP}
+    # done
+    ${SVNCMD} ${SVNBASE}/tutorials/${PKG}
+
+fi
+
+cd ${PKG}
+make
+cd ..
+
+echo
+echo
+echo "--------------------------------------------------"
+echo "Tutorial built. Please check the file ${PKG}/GenABEL_tutorial.pdf"


Property changes on: pkg/GenABEL-general/distrib_scripts/makedistrib_GenABEL-tutorial.sh
___________________________________________________________________
Added: svn:executable
   + *

Modified: pkg/GenABEL-general/distrib_scripts/makedistrib_GenABEL.sh
===================================================================
--- pkg/GenABEL-general/distrib_scripts/makedistrib_GenABEL.sh	2016-01-11 22:18:20 UTC (rev 2040)
+++ pkg/GenABEL-general/distrib_scripts/makedistrib_GenABEL.sh	2016-01-18 15:33:44 UTC (rev 2041)
@@ -1,7 +1,8 @@
 #!/bin/bash
 
-# Exit this script on error
+# Exit this script on errors and undefined variables
 set -e
+set -u
 
 installation_dir="GenABEL_version_for_submission"
 
@@ -15,17 +16,20 @@
 cd $installation_dir
 
 echo
-echo Extract packages from r-forge...
-svn export svn://svn.r-forge.r-project.org/svnroot/genabel/pkg/filevector
+echo "Extract packages from r-forge..."
 svn export svn://svn.r-forge.r-project.org/svnroot/genabel/pkg/DatABEL
 svn export svn://svn.r-forge.r-project.org/svnroot/genabel/pkg/MetABEL
-svn export svn://svn.r-forge.r-project.org/svnroot/genabel/pkg/ProbABEL
 svn export svn://svn.r-forge.r-project.org/svnroot/genabel/pkg/MixABEL
 svn export svn://svn.r-forge.r-project.org/svnroot/genabel/pkg/GenABEL.data
 svn export svn://svn.r-forge.r-project.org/svnroot/genabel/pkg/GenABEL
 svn export svn://svn.r-forge.r-project.org/svnroot/genabel/tutorials/GenABEL_general
 
+echo "Downloading packages from Github..."
+GITBASE=https://github.com/GenABEL-Project
+git clone $GITBASE/filevector.git
+git clone $GITBASE/ProbABEL.git
 
+
 echo
 echo Install the freshest R packages from CRAN and Bioconductor repositories...
 
@@ -34,7 +38,8 @@
 # In order not to mess with the current user's R library directory we
 # set one in /tmp. Most Linux distributions will remove the
 # directories in /tmp on reboot or after several days.
-export R_LIBS=/tmp/Rlibs-GenABEL-build
+export R_LIBS_USER=/tmp/Rlibs-GenABEL-build
+mkdir -p ${R_LIBS_USER}
 
 R --vanilla --no-save <<EOF
 install.packages("roxygen2", repos=$CRAN_repo)



More information about the Genabel-commits mailing list