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
9 if [ -r /etc/cran2deb/config ]; then
10 . /etc/cran2deb/config;
12 if [ -r ~/.cran2deb/config ]; then
13 CRAN2DEB_CONFDIR=~/.cran2deb
16 export CRAN2DEB_CACHE CRAN2DEB_CONFDIR CRAN2DEB_BUILD
19 if [ "x" = "x$cmd" ]; then
23 if [ ! -x "$root/exec/$cmd" ]; then
24 echo unknown command $cmd
30 # there's no reason not to run cran2deb as a local user
32 # if [ "$(id -un)" != c2d ]; then
33 # precmd="sudo -u c2d -E"
36 if [ "web" = "$cmd" ]; then
37 # web uses getopt and would be irritated by the "$root" argument
38 $precmd "$root/exec/$cmd" $*
40 $precmd "$root/exec/$cmd" "$root" $*