Subject: Re: pkg/36371: SU_CMD, sudo and cyclic dependancy
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: Joerg Sonnenberger <joerg@britannica.bec.de>
List: pkgsrc-bugs
Date: 05/22/2007 12:30:04
The following reply was made to PR pkg/36371; it has been noted by GNATS.

From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/36371: SU_CMD, sudo and cyclic dependancy
Date: Tue, 22 May 2007 14:27:41 +0200

 On Mon, May 21, 2007 at 09:25:00PM +0000, cheusov@tut.by wrote:
 > First, an example in section 8.13
 > 
 >     .if exists(${LOCALBASE}/bin/sudo)
 >     SU_CMD=        ${LOCALBASE}/bin/sudo /bin/sh -c
 >     .endif
 > 
 > doesn't work because because ${LOCALBASE} is expanded to an empty string.
 
 It is assumed in general that you have defined it already. As the
 LOCALBASE is a local setting, the guide can not hard-code values.
 /static/path/to/sudo is even more confusing IMO.
 
 > Second, I see here a cyclic dependancy. Building pkgsrc requires
 > sudo but sudo is installed from pkgsrc. Falling to su
 > is also bad (in case .exist return false) because it doesn't allow
 > (or make it a bit problematic) to build everything automatically
 > without manually inputting password for su.
 
 There is no cyclic dependency. If sudo exists, it is used, otherwise
 not. As sudo is not changed very often, the issue is IMO not much
 relevant.
 
 > So, I personally think that plain
 >     SU_CMD=/usr/bin/sudo /bin/sh -c
 >   or
 >     SU_CMD=/usr/local/bin/sudo /bin/sh -c
 > is much better than the current variant.
 > 
 > At least it makes sense to mention about "cyclic dependancy" in this section
 > of documentation
 > or even better to recomend users to use external version of sudo, at least
 > for those who uses not NetBSD and DragonFlyBSD. 
 
 Neither NetBSD nor DragonFly have a sudo by default. Pointing to an
 external version is therefore not really helping.
 
 Joerg