| 3 |
# Script to automate backporting r-base for CRAN |
# Script to automate backporting r-base for CRAN |
| 4 |
|
|
| 5 |
# Author: Johannes Ranke <jranke@uni-bremen.de> |
# Author: Johannes Ranke <jranke@uni-bremen.de> |
| 6 |
|
|
| 7 |
# Developed in parallel with Vincent Goulet <vincent.goulet@act.ulaval.ca> |
# Developed in parallel with Vincent Goulet <vincent.goulet@act.ulaval.ca> |
| 8 |
|
# On Debian I used to run this script as root. On Ubuntu I now run it with |
| 9 |
|
# sudo -E sh backport_r-base.sh |
| 10 |
|
|
| 11 |
# Preconditions: - shell variables DIST and ARCH |
# Preconditions: - shell variables DIST and ARCH |
| 12 |
# - sid sources in /etc/apt/sources/list |
# - sid sources in /etc/apt/sources/list |
| 13 |
|
# - cdbs installed (and maybe more) |
| 14 |
|
|
| 15 |
export DEBEMAIL="jranke@uni-bremen.de" |
export DEBEMAIL="jranke@uni-bremen.de" |
| 16 |
export DEBFULLNAME="Johannes Ranke" |
export DEBFULLNAME="Johannes Ranke" |
| 39 |
oldversion=`dpkg-parsechangelog | grep ^Version | cut -f2 -d " "` |
oldversion=`dpkg-parsechangelog | grep ^Version | cut -f2 -d " "` |
| 40 |
cranversion=$oldversion"~"$DIST"cran.0" |
cranversion=$oldversion"~"$DIST"cran.0" |
| 41 |
|
|
| 42 |
|
echo Old version is $oldversion |
| 43 |
|
echo CRAN version is $cranversion |
| 44 |
|
|
| 45 |
# Add new version to changelog |
# Add new version to changelog |
| 46 |
dch -v "${cranversion}" --force-distribution -D $DIST-cran -b "Backport from Debian unstable to Debian $DIST" |
dch -v "${cranversion}" --force-distribution -D $DIST-cran -b "Backport from Debian unstable to Debian $DIST" |
| 47 |
|
|
| 48 |
# Reverts for lenny and etch: |
# Reverts for lenny and etch: |
| 49 |
|
|
| 50 |
# 1. R 2.9.2 wants debhelper >= 7.2.3, which is not in lenny nor etch |
# 1. Starting with Debian packages for R 2.9.2 there is a build dependency |
| 51 |
# This also means we have to reinclude debian/r-doc-{info,html}.{postinst,prerm}, |
# on debhelper >= 7.2.3, which is not in lenny nor etch This also means we |
| 52 |
# thanks Dirk for pointing this out. |
# have to reinclude debian/r-doc-{info,html}.{postinst,prerm}, thanks Dirk |
| 53 |
|
# for pointing this out. |
| 54 |
|
|
| 55 |
sed -i '/^Build-Depends/s/debhelper (>= 7.2.3)/debhelper/' debian/control |
sed -i '/^Build-Depends/s/debhelper (>= 7.2.3)/debhelper/' debian/control |
| 56 |
dch -a "debian/control: revert Build-Depends: to 'debhelper' since $DIST has a version < 7.2.3" |
dch -a "debian/control: revert Build-Depends: to 'debhelper' since $DIST has a version < 7.2.3" |
| 58 |
dch -a "debian/rules: revert dh_prep calls to dh_clean calls since the latter is not present in this release's version of 'debhelper'" |
dch -a "debian/rules: revert dh_prep calls to dh_clean calls since the latter is not present in this release's version of 'debhelper'" |
| 59 |
cp ../r-doc-scripts/r-doc-{info,html}.{postinst,prerm} debian |
cp ../r-doc-scripts/r-doc-{info,html}.{postinst,prerm} debian |
| 60 |
|
|
| 61 |
|
# 2. Starting with Debian packages for R 2.9.2-2 there is an install |
| 62 |
|
# dependency on 'dpkg (>= 1.15.4) | install-info'. Neither package is in |
| 63 |
|
# Debian releases etch nor lenny. This also requires to reinclude |
| 64 |
|
# debian/r-doc-{info,html}.{postinst,prerm}, just like for the fix above. |
| 65 |
|
|
| 66 |
|
sed -i '/^Depends/s/dpkg (>= 1.15.4) | install-info/dpkg | install-info/' debian/control |
| 67 |
|
dch -a "debian/control: revert Depends: to 'dpkg | install-info' for r-doc-info since ${DISTRIB_DESCRIPTION} has a version of dpkg < 1.15.4 and no separate package install-info" |
| 68 |
|
|
| 69 |
# Reverts for etch only: |
# Reverts for etch only: |
| 70 |
if [ $DIST = "etch" ] |
if [ $DIST = "etch" ] |
| 71 |
then |
then |
| 135 |
fi |
fi |
| 136 |
|
|
| 137 |
pbuilder update |
pbuilder update |
| 138 |
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 |
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 /var/cache/pbuilder/$DIST-$ARCH/aptcache --buildplace /var/cache/pbuilder/$DIST-$ARCH/build |
| 139 |
if [ $? -ne 0 ]; then |
if [ $? -ne 0 ]; then |
| 140 |
exit |
exit |
| 141 |
fi |
fi |