From a1f7a1b08f2ea8b04e620bcff42e9a2b81ee0814 Mon Sep 17 00:00:00 2001 From: blundellc Date: Sat, 13 Sep 2008 13:18:56 +0000 Subject: [PATCH] build: check if packages exist already in Debian. uses Dirk's trick of forking apt-cache rdepend r-base-core git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@63 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- pkg/trunk/exec/build | 5 +++++ pkg/trunk/exec/update | 1 + pkg/trunk/exec/update_cache | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/trunk/exec/build b/pkg/trunk/exec/build index f58246e..28db24d 100755 --- a/pkg/trunk/exec/build +++ b/pkg/trunk/exec/build @@ -5,6 +5,11 @@ go <- function(name,extra_deps) { dir <- setup() pkg <- try((function() { pkg <- prepare.new.debian(prepare.pkg(dir,name),extra_deps) + # XXX: what about building newer versions? + if (pkg$debname %in% debian_pkgs) { + message(paste('N:',pkg$srcname,' exists in Debian (perhaps a different version)')) + return(pkg) + } if (file.exists(changesfile(pkg$srcname,pkg$debversion))) { message(paste('N: already built',pkg$srcname,'version',pkg$debversion)) return(pkg) diff --git a/pkg/trunk/exec/update b/pkg/trunk/exec/update index 59fa41a..e816a20 100755 --- a/pkg/trunk/exec/update +++ b/pkg/trunk/exec/update @@ -19,3 +19,4 @@ if ([ -e /var/cache/pbuilder/base-cran2deb.tgz ]) { sudo pbuilder $mode --override-config --configfile $root/etc/pbuilderrc $root/exec/update_cache $root $root/exec/license <$root/data/populate_licenses +$root/exec/sysreq <$root/data/populate_sysreq diff --git a/pkg/trunk/exec/update_cache b/pkg/trunk/exec/update_cache index 627e570..659b503 100755 --- a/pkg/trunk/exec/update_cache +++ b/pkg/trunk/exec/update_cache @@ -10,11 +10,14 @@ available <- rbind(available,available.packages(contrib.url('http://www.biocondu message('updating list of available R task views...') ctv.available <- available.views(repo=mirror) + message('updating list of base R packages...') base_pkgs <- readLines(pipe(paste('sudo pbuilder --execute --override-config --configfile' ,shQuote(pbuilder_config),'-- /usr/bin/R --vanilla 2>&1 >/dev/null <' ,shQuote(file.path(root,'exec/get_base_pkgs')) ,'| grep -v ^W:'))) +message('updating list of existing Debian packages...') +debian_pkgs <- readLines(pipe('apt-cache rdepends r-base-core | sed -e "/^ r-cran/{s/^[[:space:]]*r/r/;p}" -e d | sort -u')) -save(base_pkgs, available, ctv.available, file=file.path(argv[1],'data/cache.rda'),eval.promises=T) +save(debian_pkgs, base_pkgs, available, ctv.available, file=file.path(argv[1],'data/cache.rda'),eval.promises=T) -- 2.39.5