From 76c9402fb836d00b8a1251e91c3d132ef44ed6d3 Mon Sep 17 00:00:00 2001 From: blundellc Date: Sat, 13 Sep 2008 13:23:06 +0000 Subject: [PATCH] exec: drop bioc, more verbose version mismatch error, switch hoc to awk (more portable) some packages are in bioc and cran (e.g., graph). this confused cran2deb as One True Package is expected. to solve this, we could filter for common tables and take the highest version number. but who's to say these aren't actually distinct packages? so for now, assume all cran dependencies are satisfiable in cran (they aren't). git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@96 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- pkg/trunk/R/debianpkg.R | 2 ++ pkg/trunk/exec/update | 10 ++++++---- pkg/trunk/exec/update_cache | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pkg/trunk/R/debianpkg.R b/pkg/trunk/R/debianpkg.R index 171aa4d..956e187 100644 --- a/pkg/trunk/R/debianpkg.R +++ b/pkg/trunk/R/debianpkg.R @@ -57,6 +57,8 @@ prepare_new_debian <- function(pkg,extra_deps) { if (pkg$version != available[pkg$name,'Version']) { # should never happen since available is the basis upon which the # package is retrieved. + error('available version:',available[pkg$name,'Version']) + error('package version:',pkg$version) fail('inconsistency between R package version and cached R version') } pkg$debversion = new_build_version(pkg$name) diff --git a/pkg/trunk/exec/update b/pkg/trunk/exec/update index d454837..fb4c01f 100755 --- a/pkg/trunk/exec/update +++ b/pkg/trunk/exec/update @@ -12,11 +12,13 @@ if ([ ! -e $root/var/archive ]) { mkdir $root/var/archive || exit 1 } mini-dinstall --batch -c $root/etc/mini-dinstall.conf || exit 1 -delta=`{hoc -e `{date +%s}^-^`{stat -c '%Y' /var/cache/cran2deb/cache.rda}} update_period=10800 -echo Cache is $delta seconds out of date. -if (~ $1 full) { - delta=`{hoc -e $update_period^'+1'} +if (~ $1 full || ![ -e /var/cache/cran2deb/cache.rda ] ) { + delta=`{awk 'END{print '^$update_period^'+1}'