3 ## DOC: cran2deb update
4 ## DOC: update the cran2deb cache and database
5 ## DOC: cran2deb update full
6 ## DOC: force a full update of the cran2deb cache and database
13 if [ -z "$root" ]; then
14 echo "You need to specify the root of your installation, i.e. the folder in which to find the exec subdirectory."
19 sys=$(cran2deb which_system)
20 mkdir -p /var/cache/cran2deb/results/$sys
24 if [ ! $1 = full -o !-e /var/cache/cran2deb/cache.rda ]; then
25 delta=$(($update_period+1))
26 echo Forcing cache update
28 delta=$(awk 'END{print '^`{date +%s}^-^`{stat -c '%Y' /var/cache/cran2deb/cache.rda}^'}' < /dev/null)
29 echo Cache is $delta seconds out of date, auto-update after $update_period seconds.
32 if [ ! -e /var/cache/cran2deb/cache.rda ] || [ $delta -gt $update_period ]; then
34 if [ -e /var/cache/pbuilder/base-cran2deb-$sys.tgz ]; then
37 echo C: sudo pbuilder $mode --override-config --configfile /etc/cran2deb/sys/$sys/pbuilderrc
38 echo "Executing sudo pbuilder $mode --override-config --configfile /etc/cran2deb/sys/$sys/pbuilderrc"
39 sudo pbuilder $mode --override-config --configfile /etc/cran2deb/sys/$sys/pbuilderrc
40 echo "Executing $root/exec/update_cache $root"
41 $root/exec/update_cache $root