From 9639f4fea2c490ae3cc188370c050a7ad76c1e77 Mon Sep 17 00:00:00 2001 From: moeller Date: Tue, 8 Feb 2011 11:30:04 +0000 Subject: [PATCH] Series of improved error messages or debug statements, added by Tony or myself while learning about the interpretation of various errors. git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@324 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- trunk/exec/build | 3 +++ trunk/exec/build_some | 10 +++++++--- trunk/exec/repopulate | 12 ++++++++++++ trunk/exec/update | 13 +++++++++++-- 4 files changed, 33 insertions(+), 5 deletions(-) diff --git a/trunk/exec/build b/trunk/exec/build index 6feaf5d..63eff3b 100755 --- a/trunk/exec/build +++ b/trunk/exec/build @@ -43,6 +43,9 @@ if (exists('argv')) { # check for littler build_order <- r_dependency_closure(c(extra_deps$r,argv)) notice('build order',paste(build_order,collapse=', ')) for (pkg in build_order) { + #cat("Invoking build of '",pkg,"'\n",sep="") build(pkg,extra_deps,force=pkg %in% argv, do_cleanup) } +} else { + cat("exec/build: argv not existing.\n") } diff --git a/trunk/exec/build_some b/trunk/exec/build_some index da105fd..7b9e96f 100755 --- a/trunk/exec/build_some +++ b/trunk/exec/build_some @@ -24,14 +24,18 @@ for (pkg in `{cat all_pkgs}) { fail=0 cran2deb build $pkg >fail/$pkg >[2=1] || fail=1 if (~ $fail 0) { - echo success grep '^[WE]:' fail/$pkg >warn/$pkg # if (~ `{stat -c '%s' warn/$pkg} 0) { # rm -f warn/$pkg # } - rm -f fail/$pkg + if ( grep -q '^E:' warn/$pkg) { + echo ' failure' + } else { + echo ' success' + rm -f fail/$pkg + } } else { - echo FAILED + echo " FAILED" } } } diff --git a/trunk/exec/repopulate b/trunk/exec/repopulate index ab3ea60..08862db 100755 --- a/trunk/exec/repopulate +++ b/trunk/exec/repopulate @@ -1,17 +1,29 @@ #!/bin/sh + ## DOC: cran2deb repopulate ## DOC: repopulate the cran2deb database and configurations from a new cran2deb release ## DOC: +set -e + +dir=/etc/cran2deb +if [ ! -d "$dir" ]; then + echo "Dir $dir not existing." + exit -1 +fi + umask 002 +echo "Setting 'root' var to '$1'." root=$1 shift for x in $(find /etc/cran2deb/ -type f -name '*.in'); do + #echo "x=$x" y=$(echo $x | sed -e 's,.in$,,') sed -e "s:@ROOT@:$root:g" <"$x" >"$y" done # now do an update to reflect any config changes +echo "Starting '$root/exec/update" "$root/exec/update" "$root" (for fn in populate_licenses quit; do diff --git a/trunk/exec/update b/trunk/exec/update index b457c91..982fa6c 100755 --- a/trunk/exec/update +++ b/trunk/exec/update @@ -1,4 +1,5 @@ #!/usr/bin/rc + ## DOC: cran2deb update ## DOC: update the cran2deb cache and database ## DOC: cran2deb update full @@ -7,16 +8,22 @@ umask 002 root=$1 +if ([ -z "$root" ]) { + echo "You need to specify the root of your installation, i.e. the folder in which to find the exec subdirectory." + exit 1 +} + shift sys=`{cran2deb which_system} mkdir -p /var/cache/cran2deb/results/$sys || exit 1 -update_period=10800 +#update_period=10800 +update_period=108 if (~ $1 full || ![ -e /var/cache/cran2deb/cache.rda ] ) { delta=`{awk 'END{print '^$update_period^'+1}'