Subject: Re: pkgsrc.txt and sudo
To: Alan Barrett <apb@cequrux.com>
From: Aleksey Cheusov <cheusov@tut.by>
List: netbsd-docs
Date: 04/29/2007 01:11:14
> On Sat, 28 Apr 2007, Aleksey Cheusov wrote:
>> .if exists(${LOCALBASE}/bin/sudo)
>> SU_CMD= ${LOCALBASE}/bin/sudo /bin/sh -c
>> .endif
>>
>> First, this .if doesn't work.
> What do you mean by "doesn't work"?
0 xxkb> grep -C1 SU_CMD /etc/mk.conf
.if exists(${LOCALBASE}/bin/sudo)
SU_CMD= ${LOCALBASE}/bin/sudo /bin/sh -c
.endif
0 xxkb> make show-var VARNAME=SU_CMD
/usr/bin/su - root -c
0 xxkb> sudo jmacs /etc/mk.conf # remove .if here
0 xxkb> grep -C1 SU_CMD /etc/mk.conf
#.if exists(${LOCALBASE}/bin/sudo)
SU_CMD= ${LOCALBASE}/bin/sudo /bin/sh -c
#.endif
0 xxkb> make show-var VARNAME=SU_CMD
/usr/pkg/bin/sudo /bin/sh -c
0 xxkb>
>> 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.
Even if .if closure works, it doesn't help much
if I use pkg_chk for building LOTS OF packages
using unpriviledged mode for building and sudo for installing/packaging.
The built will be stopped with unnecessary prompt.
P.S.
The same cyclic dependency appears with 'wget' for used for fetching
distfiles also mentioned in pkgsrc.txt.
--
Best regards, Aleksey Cheusov.