#!/bin/bash -x # This script is run daily from cron in the prerelease period # It is assumed that version numbers etc. are already set up LOCALDIR=$HOME PUBDIR=$HOME/R-pre CRANDIR=cran.r-project.org:/srv/ftp/pub/R/src/base-prerelease exec > $PUBDIR/build-prerelease.log 2>&1 # ---------- no changes should be necessary below this line cd $LOCALDIR/r-release-branch umask 022 cd R svn up --accept theirs-full || exit 1 #export CRAN_RSYNC='cran.at.r-project.org::CRAN' tools/rsync-recommended curl -f http://journal.r-project.org/archive/RJournal.bib > ttt && mv ttt share/texmf/bibtex/bib/RJournal.bib cd .. rm -rf BUILD-dist mkdir BUILD-dist cd R aclocal -I m4 autoconf cd ../BUILD-dist # Local config. Required for tcltk cp ../config.site . ../R/configure --enable-maintainer-mode || exit 1 # Nov. 21, 2013, bison < 2.5 is flaky so ensure that we build gram.c here rm ../R/src/main/gram.c # Mar. 25, 2015, similarly for gramRd.c and gramLatex.c rm ../R/src/library/tools/src/gram{Rd,Latex}.c make -j4 || exit 1 (cd ../R ; svn commit -m 'maintainer-mode changes') make dist || exit 1 RNOW=`echo R*.tar.gz` cp $RNOW $PUBDIR # XZ compressed version RNOWBASE=`basename -s .gz $RNOW` RNOWXZ=$RNOWBASE.xz gunzip -c $RNOW | xz -9e > $RNOWXZ cp $RNOWXZ $PUBDIR # Make relative link (CRAN gets confused otherwise) ln -sf $RNOW $PUBDIR/R-patched.tar.gz ln -sf $RNOWXZ $PUBDIR/R-patched.tar.xz # restrict to R-patched/alpha/beta/rc --- R-devel handled by its own script # note: find command wildcards do not include {foo,bar,baz} syntax find $PUBDIR -name R-patched_\*.gz -mmin +10000 -exec rm {} \; find $PUBDIR -name R-alpha_\*.gz -mmin +10000 -exec rm {} \; find $PUBDIR -name R-beta_\*.gz -mmin +10000 -exec rm {} \; find $PUBDIR -name R-rc_\*.gz -mmin +10000 -exec rm {} \; find $PUBDIR -name R-patched_\*.xz -mmin +10000 -exec rm {} \; find $PUBDIR -name R-alpha_\*.xz -mmin +10000 -exec rm {} \; find $PUBDIR -name R-beta_\*.xz -mmin +10000 -exec rm {} \; find $PUBDIR -name R-rc_\*.xz -mmin +10000 -exec rm {} \; rsync -aOvuz --no-p --delete $PUBDIR/ $CRANDIR