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 ] || [ ! -e /var/cache/cran2deb/cache.rda ]; then
25 delta=$(($update_period+1))
26 echo Forcing cache update
28 seconds_time=$(date +%s)
29 seconds_file=$(stat -c '%Y' /var/cache/cran2deb/cache.rda)
30 delta=$(($seconds_time-$seconds_file))
31 echo Cache is $delta seconds out of date, auto-update after $update_period seconds.
34 if [ ! -e /var/cache/cran2deb/cache.rda ] || [ $delta -gt $update_period ]; then
36 if [ -e /var/cache/pbuilder/base-cran2deb-$sys.tgz ]; then
39 echo C: sudo pbuilder $mode --override-config --configfile /etc/cran2deb/sys/$sys/pbuilderrc
40 echo "Executing sudo pbuilder $mode --override-config --configfile /etc/cran2deb/sys/$sys/pbuilderrc"
41 sudo pbuilder $mode --override-config --configfile /etc/cran2deb/sys/$sys/pbuilderrc
42 echo "Executing $root/exec/update_cache $root"
43 $root/exec/update_cache $root