X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=trunk%2Fexec%2Fupdate;h=ee1bd7bc8e3745d52b2e104b29639f1e2a79544e;hb=HEAD;hp=7d466b91fd49290b05f40d29ca296b447ae1186b;hpb=cba40064eef115e4aec5b1d089963d402a6b0965;p=cran2deb.git diff --git a/trunk/exec/update b/trunk/exec/update index 7d466b9..ee1bd7b 100755 --- a/trunk/exec/update +++ b/trunk/exec/update @@ -1,30 +1,54 @@ -#!/usr/bin/rc +#!/bin/bash + ## DOC: cran2deb update ## DOC: update the cran2deb cache and database ## DOC: cran2deb update full ## DOC: force a full update of the cran2deb cache and database ## DOC: +set -e +cachedir="/var/cache/cran2deb/results/" +pbuildercache="/var/cache/pbuilder/" + +if [ -e /etc/cran2deb/config ]; then + . /etc/cran2deb/config; +elif [ -r ~/.cran2deb_config ]; then + . ~/.cran2deb_config; +fi; + umask 002 root=$1 +if [ -z "$root" ]; then + echo "You need to specify the root of your installation, i.e. the folder in which to find the exec subdirectory." + exit 1 +fi + shift -sys=`{cran2deb which_system} -mkdir -p /var/cache/cran2deb/results/$sys || exit 1 -mini-dinstall --batch -c /etc/cran2deb/sys/$sys/mini-dinstall.conf || exit 1 -update_period=10800 -if (~ $1 full || ![ -e /var/cache/cran2deb/cache.rda ] ) { - delta=`{awk 'END{print '^$update_period^'+1}'