From: moeller Date: Tue, 8 Feb 2011 14:24:19 +0000 (+0000) Subject: Transformed Plan 9 shell script into BASH, X-Git-Url: https://git.donarmstrong.com/?p=cran2deb.git;a=commitdiff_plain;h=515315e9f4cad5288911eae0a7a574d091aab698 Transformed Plan 9 shell script into BASH, preparing to also transform it into an R script. git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@336 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- diff --git a/trunk/exec/update b/trunk/exec/update index 982fa6c..b162cc8 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,30 +6,34 @@ ## 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}'