summaryrefslogtreecommitdiff
path: root/backport_r-base.sh
blob: 7c93f4c1bf863928ba34164391e00725cee15471 (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
51
52
53
#!/bin/bash

# Script to automate backporting r-base for CRAN

# Author: Johannes Ranke <jranke@uni-bremen.de>
# Developed in parallel with Vincent Goulet <vincent.goulet@act.ulaval.ca>

# Preconditions: - shell variables DIST and ARCH
#                - sid sources in /etc/apt/sources/list

export DEBEMAIL="jranke@uni-bremen.de"
export DEBFULLNAME="Johannes Ranke"
echo Distribution is $DIST
echo Architecture is $ARCH

if [ -d r-base-* ]
then
    rm -rf `ls -d r-base-*`
fi

apt-get update
apt-get source -t unstable r-base

# Change any ~ in the name of the build directory for a - to avoid a
# bug in texi2dvi. Thanks Vincent
if [ -d r-base-*~* ]
then
    dir=`ls -d r-base-*~*`
    mv $dir `echo $dir | sed y/~/-/`
fi

cd r-base-*

# Old version
oldversion=`dpkg-parsechangelog | grep ^Version | cut -f2 -d " "`
cranversion=$oldversion"~"$DIST"cran.0"

# Add new version to changelog
dch -v "${cranversion}" -D $DIST-cran -b "Backport from Debian unstable to Debian $DIST"

# Reverts for lenny:
# None at this time

pbuilder update
pdebuild --debbuildopts '-sa' --buildresult /home/ranke/svn/website/www/ranke/r-cran/$DIST-cran/ -- --distribution $DIST --basetgz /var/cache/pbuilder/$DIST-$ARCH-base.tgz --aptcache /exthd/pbuilder/$DIST-$ARCH/aptcache --buildplace /exthd/pbuilder/$DIST-$ARCH/build
if [ $? -ne 0 ]; then
    exit 
fi

cd ..

# Create diff to Debian unstable
interdiff -z r-base_*.diff.gz /home/ranke/svn/website/www/ranke/r-cran/$DIST-cran/r-base_*cran*.diff.gz > /home/ranke/svn/website/www/ranke/r-cran/$DIST-cran/interdiff_to_debian_sid

Contact - Imprint