Subject: pkg/36371: SU_CMD, sudo and cyclic dependancy
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <cheusov@tut.by>
List: pkgsrc-bugs
Date: 05/21/2007 21:25:00
>Number:         36371
>Category:       pkg
>Synopsis:       SU_CMD, sudo and cyclic dependancy
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 21 21:25:00 +0000 2007
>Originator:     cheusov@tut.by
>Release:        NetBSD 4.0_BETA2
>Organization:
Best regards, Aleksey Cheusov.
>Environment:
System: NetBSD chen.chizhovka.net 4.0_BETA2 NetBSD 4.0_BETA2 (GENERIC) #16: Mon May 21 00:01:33 EEST 2007 cheusov@chen.chizhovka.net:/srv/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
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.
IMHO it's better to change this example to this

    SUDO=/static/path/to/sudo
    .if exists(${SUDO})
    SU_CMD=        ${SUDO} /bin/sh -c
    .endif

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.

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. 

>Fix:

Unknown