diff options
-rwxr-xr-x | backport | 1 | ||||
-rw-r--r-- | backport_others | 27 |
2 files changed, 19 insertions, 9 deletions
@@ -44,6 +44,7 @@ while test -n "${1}"; do ;; -*) echo "Error: Unknown option: $1" >&2 + usage exit 1 ;; *) # No more options diff --git a/backport_others b/backport_others index 5e5ab1c..6e92116 100644 --- a/backport_others +++ b/backport_others @@ -12,26 +12,34 @@ echo "Options:" echo " -s Skip apt-get update/upgrade and pbuilder update" } +# Loop over options skip=false -while getopts ":s" flag; do - case $flag in - s) +while test -n "${1}"; do + case "$1" in + -s | --skip) skip=true + shift ;; - \?) - echo "Invalid option: -$OPTARG" >&2 + -*) + echo "Error: Unknown option: $1" >&2 + usage + exit 1 + ;; + *) # No more options + break ;; esac - shift $((OPTIND-1)) done -# Check for number of arguments +# Positional arguments if [ $# -lt 1 ]; then usage; exit 1; fi DIST=$1 # Update pbuilder chroot -if [ "$skip" = true ] +if [ "$skip" = false ] then + sudo apt-get update + sudo apt-get upgrade sudo -E pbuilder update fi @@ -43,7 +51,8 @@ export DIST # 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 +for i in lattice nlme r-cran-coda littler; do +#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 |