summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorranke <ranke@f247ebf9-aa24-0410-a698-f940e971ad2b>2015-12-14 12:57:12 +0000
committerranke <ranke@f247ebf9-aa24-0410-a698-f940e971ad2b>2015-12-14 12:57:12 +0000
commitf82c9449951c75bd5d9f7083c8683ddd15121738 (patch)
treeba88f6c289d0bcf56c1676983a13809cf00fe1ca
parentd7b5493f488e7c7f696bc6815fea06a9f7a6695f (diff)
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
-rw-r--r--backport_others2
-rwxr-xr-xbuild68
-rw-r--r--build_others (renamed from build_others.sh)47
-rw-r--r--build_r-base.sh15
-rwxr-xr-xclean22
-rw-r--r--clean.sh8
-rwxr-xr-xmove_debs18
-rw-r--r--move_jessie64.sh5
-rw-r--r--move_squeeze64.sh5
-rw-r--r--move_wheezy64.sh5
10 files changed, 146 insertions, 49 deletions
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.sh b/build_others
index 0ce6f5c..8f69203 100644
--- a/build_others.sh
+++ b/build_others
@@ -1,7 +1,39 @@
+#!/bin/bash
+
# Author: Johannes Ranke <jranke@uni-bremen.de>
-apt-get update
-apt-get upgrade
+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
@@ -10,12 +42,7 @@ apt-get upgrade
#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 ..
+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_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 <jranke@uni-bremen.de>
+
+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 <jranke@uni-bremen.de>
-
-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

Contact - Imprint