summaryrefslogtreecommitdiff
path: root/backport_others
blob: 5e5ab1c638b75966ec2cd27bae89a7f4f56d03ba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash

# Author: Johannes Ranke <jranke@uni-bremen.de>

# Script to automate backporting for CRAN
# Make sure the R version in ./backport is correctly set and the pbuilder chroot is updated

usage()
{
echo "Usage: ./backport_others [options] squeeze|wheezy|jessie"
echo "Options:"
echo " -s     Skip apt-get update/upgrade and pbuilder update"
}

skip=false
while getopts ":s" flag; do
  case $flag in
    s)
      skip=true
      ;;
    \?)
      echo "Invalid option: -$OPTARG" >&2
      ;;
  esac
  shift $((OPTIND-1))
done

# Check for number of arguments
if [ $# -lt 1 ]; then usage; exit 1; fi
DIST=$1

# Update pbuilder chroot
if [ "$skip" = true ]
then
  sudo -E pbuilder update
fi

# Validate distribution argument
if [ $DIST != "squeeze" ] && [ $DIST != "wheezy" ] && [ $DIST != "jessie" ]; then usage; exit 1; fi
export DIST

# When doing a new repository, lattice, r-cran-mass and survival have to be
# built first, then nlme and rmatrix, then the rest

# Packages to backport to squeeze/wheezy/jessie (without rpy2):
for i in lattice nlme rmatrix mgcv boot cluster codetools foreign kernsmooth r-cran-class r-cran-coda r-cran-spatial r-cran-nnet r-cran-mass rodbc rpart survival r-cran-littler rpy rkward r-cran-rjags; do
  
  ./backport -s $i $DIST

done

Contact - Imprint