[Genabel-commits] r1753 - pkg/GenABEL-general/distrib_scripts
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Jun 20 14:51:42 CEST 2014
Author: lckarssen
Date: 2014-06-20 14:51:42 +0200 (Fri, 20 Jun 2014)
New Revision: 1753
Modified:
pkg/GenABEL-general/distrib_scripts/makedistrib_VariABEL.sh
Log:
Updated the VariABEL distrib script to make it more similar to the MetABEL distrib script:
- Added the --nocheckout and --nocrancheck options
- Introduced the $RCMD variable
Modified: pkg/GenABEL-general/distrib_scripts/makedistrib_VariABEL.sh
===================================================================
--- pkg/GenABEL-general/distrib_scripts/makedistrib_VariABEL.sh 2014-06-20 12:47:19 UTC (rev 1752)
+++ pkg/GenABEL-general/distrib_scripts/makedistrib_VariABEL.sh 2014-06-20 12:51:42 UTC (rev 1753)
@@ -3,9 +3,17 @@
# 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.
+#
+# Command line options:
+# -n|--nocheckout: if the first command line option is keepold 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.
+# -c|--nocrancheck: don't run R CMD check --as-cran (can save some
+# time if you're expecting trouble)
PKG=VariABEL
CRAN_repo='"http://cran-mirror.cs.uu.nl"'
+RCMD="R --vanilla CMD"
# Exit on errors
set -e
@@ -14,43 +22,68 @@
# located
scriptdir=$(dirname $0)
+# Parse command line options
+NOCHECKOUT=false
+CRANCHECK=true
+while [ $# -gt 0 ]; do
+ case $1 in
+ -n | --nocheckout )
+ NOCHECKOUT=true
+ ;;
+ -c | --nocrancheck )
+ CRANCHECK=false
+ ;;
+ -* )
+ echo "$0: invalid option $1" >&2
+ exit 1
+ ;;
+ *)
+ break
+ ;;
+ esac
+ shift
+done
+
echo "--------------------------------------------------"
echo "Removing old files and directories (if present)"
echo "--------------------------------------------------"
-rm -rf $PKG
+if [ $NOCHECKOUT == false ]; then
+ rm -rf $PKG
+fi
rm -rf $PKG.Rcheck
rm -rf $PKG_*.tar.gz
rm -rf DatABEL DatABEL.*
rm -rf filevector*
+if [ $NOCHECKOUT == false ]; then
+ echo
+ echo "--------------------------------------------------"
+ echo "Checking out source code from SVN..."
+ echo "--------------------------------------------------"
+ svn export svn://svn.r-forge.r-project.org/svnroot/genabel/pkg/filevector
+ 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/$PKG
+ cd $PKG
+ rm -f cleanup* configure* *.R
+ cd src
+ cp DAlib/*.c* .
+ cp DAlib/*.h* .
+ cp ITERlib/*.c* .
+ cp ITERlib/*.h* .
+ cp fvlib/*.c* .
+ cp fvlib/*.h* .
+ cp VARlib/*.c* .
+ cp VARlib/*.h* .
+ cp VARlib/*.f* .
+ rm DAlib
+ rm fvlib
+ rm -rf ITERlib
+ rm -rf VARlib
+ rm -rf ../prepare_4_CRAN_submission.sh
+ mv Makevars_distrib Makevars
+ cd ../..
+fi
-echo
-echo "--------------------------------------------------"
-echo "Checking out source code from SVN..."
-echo "--------------------------------------------------"
-svn export svn://svn.r-forge.r-project.org/svnroot/genabel/pkg/filevector
-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/$PKG
-cd $PKG
-rm -f cleanup* configure* *.R
-cd src
-cp DAlib/*.c* .
-cp DAlib/*.h* .
-cp ITERlib/*.c* .
-cp ITERlib/*.h* .
-cp fvlib/*.c* .
-cp fvlib/*.h* .
-cp VARlib/*.c* .
-cp VARlib/*.h* .
-cp VARlib/*.f* .
-rm DAlib
-rm fvlib
-rm -rf ITERlib
-rm -rf VARlib
-rm -rf ../prepare_4_CRAN_submission.sh
-mv Makevars_distrib Makevars
-cd ../..
-
# 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.
@@ -79,32 +112,32 @@
errwarn=0
echo
echo "--------------------------------------------------"
-echo "Building the package..."
+echo "Running normal R checks..."
echo "--------------------------------------------------"
-R --vanilla CMD build $PKG
-PKGFILE=${PKG}_${DESCVERSION}.tar.gz
-
-echo
-echo "--------------------------------------------------"
-echo "Running normal R check on $PKGFILEs..."
-echo "--------------------------------------------------"
-R --vanilla CMD check $PKGFILE
+$RCMD check $PKG
if grep -qE "NOTE|WARNING|ERROR" $PKG.Rcheck/00check.log; then
errwarn=1
fi
+if [ $CRANCHECK == true ]; then
+ echo
+ echo "--------------------------------------------------"
+ echo "Check with --as-cran..."
+ echo "--------------------------------------------------"
+ $RCMD check --as-cran $PKG
+ if sed -e 's/feasibility ... WARNING/feasibility ... WRNNG/' \
+ -e 's/^WARNING/WRNNG/' $PKG.Rcheck/00check.log | \
+ grep -qE "NOTE|WARNING|ERROR"; then
+ errwarn=1
+ fi
+fi
+
echo
echo "--------------------------------------------------"
-echo "Check $PKGFILE with --as-cran..."
+echo "Building the package for distribution..."
echo "--------------------------------------------------"
-R --vanilla CMD check --as-cran $PKGFILE
-if sed -e 's/feasibility ... WARNING/feasibility ... WRNNG/' \
- -e 's/^WARNING/WRNNG/' $PKG.Rcheck/00check.log | \
- grep -qE "NOTE|WARNING|ERROR"; then
- errwarn=1
-fi
+$RCMD build $PKG
-## Report whether warnings, errors, notes where found
if [ $errwarn -eq 1 ]; then
echo
echo "NOTEs, WARNINGs or ERRORs found!" 1>&2
More information about the Genabel-commits
mailing list