X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=tags%2Fgsoc_final%2Fexec%2Fupdate;fp=tags%2Fgsoc_final%2Fexec%2Fupdate;h=a2cdf0160d791e4de0cdef38bef2f1d3b9e4acfb;hb=5101cce1568b46d042316f32c8216e956f76ff65;hp=0000000000000000000000000000000000000000;hpb=1d3c6e2092b87a8e640704ce3ceec4e8ece3859e;p=cran2deb.git diff --git a/tags/gsoc_final/exec/update b/tags/gsoc_final/exec/update new file mode 100755 index 0000000..a2cdf01 --- /dev/null +++ b/tags/gsoc_final/exec/update @@ -0,0 +1,41 @@ +#!/usr/bin/rc +## 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: + +umask 022 +root=$1 +shift +for (x in `{find $root/etc -type f -name '*.in'}) { + y=`{echo $x | sed -e 's,.in$,,'} + sed -e 's:@ROOT@:'^$root^':g' <$x >$y +} +mkdir -p /var/cache/cran2deb/results || exit 1 +if ([ ! -e $root/var/archive ]) { + # I symbolically link this into /var/www/ + mkdir $root/var/archive || exit 1 +} +mini-dinstall --batch -c $root/etc/mini-dinstall.conf || exit 1 +update_period=10800 +if (~ $1 full || ![ -e /var/cache/cran2deb/cache.rda ] ) { + delta=`{awk 'END{print '^$update_period^'+1}'