On Sat, 28 Apr 2007, Aleksey Cheusov wrote:
> .if exists($/bin/sudo)
> SU_CMD= $/bin/sudo /bin/sh -c
> .endif
>
> First, this .if doesn't work.
What do you mean by "doesn't work"? I have used
something similar for a
long time, and it works for me. However, sudo doesn't work
well when
$ or $ don't exist, so I also test for them.
Here's
the relavent part of my mk.conf file:
.if exists($) && exists($)
. for _sudo_cmd in $/bin/sudo /usr/pkg/bin/sudo
/usr/local/bin/sudo
. if exists($)
SU_CMD?=$ /bin/sh -c # requires
security/sudo package
. endif
. endfor
SU_CMD?=/usr/bin/su -m root -c # "su -m" does not
clobber environment
.endif
> Second, IMHO it is better to NOT use pkgsrc version of
sudo
> for building pkgsrc packages just because A wants B and
B wants A...
There's no cyclic dependency. Because if the ".if
exists" test, sudo
won't be used if it's not already installed.
--apb (Alan Barrett)
|