From f82c9449951c75bd5d9f7083c8683ddd15121738 Mon Sep 17 00:00:00 2001 From: ranke Date: Mon, 14 Dec 2015 12:57:12 +0000 Subject: Various improvements - Don't remove r-base-*.deb files when cleaning sources - Use ./build [options] sourcepackage instead of build*.sh - Use ./build_others [options] instead of build_others.sh - Use ./clean [squeeze|wheezy|jessie] instead of clean.sh - Improve comment in backport_others script - Use ./move_debs instead of move_*.sh git-svn-id: svn+ssh://stiller/home/schatz/reps/r-backports@117 f247ebf9-aa24-0410-a698-f940e971ad2b --- backport_others | 2 +- build | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ build_others | 48 +++++++++++++++++++++++++++++++++++++++ build_others.sh | 21 ----------------- build_r-base.sh | 15 ------------ clean | 22 ++++++++++++++++++ clean.sh | 8 ------- move_debs | 18 +++++++++++++++ move_jessie64.sh | 5 ---- move_squeeze64.sh | 5 ---- move_wheezy64.sh | 5 ---- 11 files changed, 157 insertions(+), 60 deletions(-) create mode 100755 build create mode 100644 build_others delete mode 100644 build_others.sh delete mode 100644 build_r-base.sh create mode 100755 clean delete mode 100644 clean.sh create mode 100755 move_debs delete mode 100644 move_jessie64.sh delete mode 100644 move_squeeze64.sh delete mode 100644 move_wheezy64.sh diff --git a/backport_others b/backport_others index 5b2b631..a923587 100644 --- a/backport_others +++ b/backport_others @@ -35,7 +35,7 @@ done if [ $# -lt 1 ]; then usage; exit 1; fi DIST=$1 -# Update pbuilder chroot +# Update apt and pbuild chroot if [ "$skip" = false ] then sudo apt-get update diff --git a/build b/build new file mode 100755 index 0000000..053a167 --- /dev/null +++ b/build @@ -0,0 +1,68 @@ +#!/bin/bash + +# Script to facilitate building r-base binaries for CRAN in a chroot +# Matching CRAN sources must be in /etc/apt/sources.list of the chroot + +usage() +{ +echo "Usage: ./build [options] sourcepackage" +echo "Options:" +echo " -s, --skip Skip apt-get update/upgrade and pbuilder update" +} + +DIST=`lsb_release -cs` + +skip=false +while test -n "${1}"; do + case "$1" in + -s | --skip) + skip=true + shift + ;; + -*) + echo "Error: Unknown option: $1" >&2 + usage + exit 1 + ;; + *) # No more options + break + ;; + esac +done + +# Positional argument +if [ $# -lt 1 ]; then usage; exit 1; fi +pkg=$1 + +if ls $pkg-* 1> /dev/null 2>&1 +then + echo "Please check if sources from previous backport or build need to be cleaned up" + exit 1 +fi + +if [ "$skip" = false ] +then + apt-get update + apt-get upgrade +fi +apt-get build-dep $pkg +apt-get source $pkg + +# Move sources to $DIST directory to enable parallel builds +mkdir -p $DIST +mv $pkg\_* $DIST +mv $pkg-* $DIST + +cd $DIST/$pkg-* + +dpkg-buildpackage -B + +cd ../.. + +keep=false # We do not want to keep local sources for binary builds +# Clean sources from $DIST directory +if [ "$keep" = false ] +then + rm -f $DIST/$pkg\_*.{dsc,changes,diff.gz,tgz,tar.gz,tar.xz} + #rm -rf $DIST/$pkg-* # This removes e.g. r-base-core* debs which is not intended +fi diff --git a/build_others b/build_others new file mode 100644 index 0000000..8f69203 --- /dev/null +++ b/build_others @@ -0,0 +1,48 @@ +#!/bin/bash + +# Author: Johannes Ranke + +usage() +{ +echo "Usage: ./build_others [options]" +echo "Options:" +echo " -s Skip apt-get update/upgrade" +} + +# Loop over options +skip=false +while test -n "${1}"; do + case "$1" in + -s | --skip) + skip=true + shift + ;; + -*) + echo "Error: Unknown option: $1" >&2 + usage + exit 1 + ;; + *) # No more options + break + ;; + esac +done + +# Update apt +if [ "$skip" = false ] +then + apt-get update + apt-get upgrade +fi + +# When doing a new repository, lattice, r-cran-mass and survival have to be +# built first, then nlme and rmatrix, then the rest + +# squeeze/wheezy/jessie +#for i in lattice r-cran-mass survival; do +#for i in nlme rmatrix; do +#for i in cluster foreign r-cran-class r-cran-spatial r-cran-nnet kernsmooth mgcv rodbc rpart littler rpy rpy2 rkward r-cran-rjags; do +for i in lattice rmatrix nlme cluster foreign r-cran-class r-cran-spatial r-cran-nnet r-cran-mass kernsmooth mgcv rodbc rpart survival littler rpy rkward r-cran-rjags +do + ./build -s $i +done diff --git a/build_others.sh b/build_others.sh deleted file mode 100644 index 0ce6f5c..0000000 --- a/build_others.sh +++ /dev/null @@ -1,21 +0,0 @@ -# Author: Johannes Ranke - -apt-get update -apt-get upgrade - -# When doing a new repository, lattice, r-cran-mass and survival have to be -# built first, then nlme and rmatrix, then the rest - -# squeeze/wheezy/jessie -#for i in lattice r-cran-mass survival; do -#for i in nlme rmatrix; do -#for i in cluster foreign r-cran-class r-cran-spatial r-cran-nnet kernsmooth mgcv rodbc rpart littler rpy rpy2 rkward r-cran-rjags; do -for i in lattice rmatrix nlme cluster foreign r-cran-class r-cran-spatial r-cran-nnet r-cran-mass kernsmooth mgcv rodbc rpart survival littler rpy rkward r-cran-rjags; do - apt-get --no-install-recommends build-dep $i - apt-get source $i - cd $i-* - - dpkg-buildpackage -B - - cd .. -done diff --git a/build_r-base.sh b/build_r-base.sh deleted file mode 100644 index 3d26cca..0000000 --- a/build_r-base.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# Script to facilitate building r-base binaries for CRAN in a chroot -# Matching CRAN sources must be in /etc/apt/sources.list of the chroot - -apt-get update -apt-get upgrade -apt-get build-dep r-base -apt-get source r-base - -cd r-base-* - -dpkg-buildpackage -B - -cd .. diff --git a/clean b/clean new file mode 100755 index 0000000..d88d8d2 --- /dev/null +++ b/clean @@ -0,0 +1,22 @@ +#!/bin/sh + +# Author: Johannes Ranke + +usage() +{ +echo "Usage: ./clean [squeeze|wheezy|jessie]" +} + +if [ $# -gt 1 ]; then usage; exit 1; fi +if [ $# -eq 1 ] +then + DIST=$1 + if [ $DIST != "squeeze" ] && [ $DIST != "wheezy" ] && [ $DIST != "jessie" ]; then usage; exit 1; fi + cd $DIST +fi + +for i in r-base tcl tk boot cluster codetools foreign kernsmooth lattice mgcv nlme r-cran-class r-cran-coda r-cran-mass r-cran-nnet r-cran-spatial rmatrix rodbc rpart survival littler rpy rpy2 rkward jags r-cran-rjags texinfo +do + if ls $i*.deb 1> /dev/null 2>&1; then "Please take care of .deb files hanging around"; exit 1; fi + rm -rf $i* +done diff --git a/clean.sh b/clean.sh deleted file mode 100644 index 4a3099d..0000000 --- a/clean.sh +++ /dev/null @@ -1,8 +0,0 @@ -# Author: Johannes Ranke - -for i in boot cluster codetools foreign kernsmooth lattice mgcv nlme r-cran-class r-cran-coda r-cran-mass r-cran-nnet r-cran-spatial rmatrix rodbc rpart survival littler rpy rpy2 rkward jags r-cran-rjags texinfo; do - rm -rf $i* -done -rm -rf r-base* -rm -rf tcl* -rm -rf tk* diff --git a/move_debs b/move_debs new file mode 100755 index 0000000..7f1919f --- /dev/null +++ b/move_debs @@ -0,0 +1,18 @@ +#!/bin/bash + +# Move binary packages built in a chroot to the local repository + +# Positional argument +if [ $# -lt 1 ]; then usage; exit 1; fi +DIST=$1 + +usage() +{ +echo "Usage: ./move_debs squeeze|wheezy|jessie" +} + +# Validate distribution argument +if [ $DIST != "squeeze" ] && [ $DIST != "wheezy" ] && [ $DIST != "jessie" ]; then usage; exit 1; fi + +chown jranke $DIST/*${DIST}cran*_amd64.deb +mv $DIST/*${DIST}cran*_amd64.deb /home/jranke/svn/website/www/ranke/r-cran/$DIST-cran3 diff --git a/move_jessie64.sh b/move_jessie64.sh deleted file mode 100644 index 89c026b..0000000 --- a/move_jessie64.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -# Move binary packages built in a chroot to the local repository - -mv *jessiecran*_amd64.deb ~/svn/website/www/ranke/r-cran/jessie-cran3 diff --git a/move_squeeze64.sh b/move_squeeze64.sh deleted file mode 100644 index 33220ed..0000000 --- a/move_squeeze64.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -# Move binary packages built in a chroot to the local repository - -mv *squeezecran*_amd64.deb /home/ranke/svn/website/www/ranke/r-cran/squeeze-cran3 diff --git a/move_wheezy64.sh b/move_wheezy64.sh deleted file mode 100644 index 5792272..0000000 --- a/move_wheezy64.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -# Move binary packages built in a chroot to the local repository - -mv *wheezycran*_amd64.deb ~/svn/website/www/ranke/r-cran/wheezy-cran3 -- cgit v1.2.1