3 root=$(r -e 'suppressMessages(library(cran2deb));cat(system.file(package="cran2deb"),file=stdout())')
6 CRAN2DEB_CACHE=/var/cache/cran2deb
7 CRAN2DEB_CONFDIR=/etc/cran2deb
8 if [ -r /etc/cran2deb/config ]; then
9 . /etc/cran2deb/config;
11 if [ -r ~/.cran2deb/config ]; then
12 CRAN2DEB_CONFDIR=~/.cran2deb
15 export CRAN2DEB_CACHE CRAN2DEB_CONFDIR
18 if [ "x" = "x$cmd" ]; then
22 if [ ! -x "$root/exec/$cmd" ]; then
23 echo unknown command $cmd
29 # there's no reason not to run cran2deb as a local user
31 # if [ "$(id -un)" != c2d ]; then
32 # precmd="sudo -u c2d -E"
35 if [ "web" = "$cmd" ]; then
36 # web uses getopt and would be irritated by the "$root" argument
37 $precmd "$root/exec/$cmd" $*
39 $precmd "$root/exec/$cmd" "$root" $*