Subject: pkg/36371: SU_CMD, sudo and cyclic dependancy
To: None <,,>
From: None <>
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
>Release:        NetBSD 4.0_BETA2
Best regards, Aleksey Cheusov.
System: NetBSD 4.0_BETA2 NetBSD 4.0_BETA2 (GENERIC) #16: Mon May 21 00:01:33 EEST 2007 i386
Architecture: i386
Machine: i386
First, an example in section 8.13

    .if exists(${LOCALBASE}/bin/sudo)
    SU_CMD=        ${LOCALBASE}/bin/sudo /bin/sh -c

doesn't work because because ${LOCALBASE} is expanded to an empty string.
IMHO it's better to change this example to this

    .if exists(${SUDO})
    SU_CMD=        ${SUDO} /bin/sh -c

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
    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.