X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=trunk%2Fexec%2Fupdate;h=d02ece214fc19e4f568797a159d1cb24748e9f9a;hb=b8576b1378774c688daec181fbbb5f89778b9b22;hp=982fa6c055457b6e3ce309b1abbfac66de28d260;hpb=9639f4fea2c490ae3cc188370c050a7ad76c1e77;p=cran2deb.git diff --git a/trunk/exec/update b/trunk/exec/update index 982fa6c..d02ece2 100755 --- a/trunk/exec/update +++ b/trunk/exec/update @@ -1,4 +1,4 @@ -#!/usr/bin/rc +#!/bin/bash ## DOC: cran2deb update ## DOC: update the cran2deb cache and database @@ -6,34 +6,40 @@ ## DOC: force a full update of the cran2deb cache and database ## DOC: +set -e + umask 002 root=$1 -if ([ -z "$root" ]) { +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 +sys=$(cran2deb which_system) +mkdir -p /var/cache/cran2deb/results/$sys #update_period=10800 update_period=108 -if (~ $1 full || ![ -e /var/cache/cran2deb/cache.rda ] ) { - delta=`{awk 'END{print '^$update_period^'+1}'