Package: r-base-dev
Version: 3.0.0-2
Severity: wishlist
Tags: patch

Hi Dirk,

in light with the recent discussion and suggestions about the rare API
breakages with R, I would like to propose the following:

 - R provides a virtual package, for instance, 'r-api-3'.  This name is
   modified (for instance to 'r-api-4', 'r-api-3b', etc.) when
   backward-incompatible changes are introduced.

 - R library packages depend on that virtual package through the already
   implemented R:Depends system, replacing the current convention of
   depending on any version equal or superior to one of the r-base package
   used at build time.

This can be done with the attached patch, that I tested locally.

Have a nice week-end,

-- 
Charles
>From 26e7e69d93adf5ff89d6c6bb3979267eb6adcb91 Mon Sep 17 00:00:00 2001
From: Charles Plessy <char...@plessy.org>
Date: Sat, 6 Apr 2013 12:08:37 +0900
Subject: [PATCH] Depend precisely on a versionned R API.

---
 debian/control   | 2 +-
 debian/r-cran.mk | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/debian/control b/debian/control
index bc211ab..108ed65 100644
--- a/debian/control
+++ b/debian/control
@@ -47,7 +47,7 @@ Package: r-base-core
 Architecture: any
 Depends: ${misc:Depends}, ${perl:Depends}, zip, unzip, libpaper-utils, xdg-utils, ${shlibs:Depends}, ucf (>= 3.0)
 Replaces: r-base (<= 1.4.1-1), r-recommended (<< 1.9.0), r-gnome (<= 2.3.1), r-cran-rcompgen (<= 0.1-17-1), r-base-latex (<= 2.9.2-4)
-Provides:  r-gnome, r-cran-rcompgen, r-base-latex
+Provides:  r-gnome, r-cran-rcompgen, r-base-latex, r-api-3
 Conflicts:  r-gnome, r-cran-rcompgen, r-base-latex
 Recommends: r-recommended, r-base-dev, r-doc-html
 Suggests: ess, r-doc-info | r-doc-pdf, r-mathlib, r-base-html
diff --git a/debian/r-cran.mk b/debian/r-cran.mk
index c21f1ee..2f9e69a 100644
--- a/debian/r-cran.mk
+++ b/debian/r-cran.mk
@@ -60,7 +60,7 @@ endif
 #rversion	:= $(shell zcat /usr/share/doc/r-base-dev/changelog.Debian.gz | \
 #			dpkg-parsechangelog -l- --count 1  | \
 #			awk '/^Version/ {print $$2}')
-rversion	:= $(shell dpkg-query -W -f='$${Version}' r-base-dev)
+rAPIversion	:= $(shell dpkg-query -W -f='$${Provides}' r-base-core | grep -o 'r-api.[^,]')
 
 ## we use these results for the to-be-installed-in directory
 debRlib		:= $(CURDIR)/debian/$(package)/$(debRdir)
@@ -76,7 +76,7 @@ R_any_arch:
 		dh_installdirs		$(debRdir)
                 ##
                 ## support ${R:Depends} via debian/${package}.substvars
-		echo "R:Depends=r-base-core (>= ${rversion})" >> debian/$(package).substvars
+		echo "R:Depends=${rAPIversion}" >> debian/$(package).substvars
                 ##
                 ## call R to install the sources we're looking at
                 ## use this inside xvfb-run if this wrapper is installed
-- 
1.8.2.rc0

Reply via email to