Subject: Re: Installing packages as non root broken?
To: None <tech-pkg@NetBSD.org>
From: Roland Illig <rillig@NetBSD.org>
List: tech-pkg
Date: 11/20/2005 01:09:17
This is a multi-part message in MIME format.
--------------050807060504090409020908
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Bernd Ernesti wrote:
> On Tue, Nov 15, 2005 at 04:29:10PM +0000, Roland Illig wrote:
> 
>>Module Name:	pkgsrc
>>Committed By:	rillig
>>Date:		Tue Nov 15 16:29:10 UTC 2005
>>
>>Modified Files:
>>	pkgsrc/mk: bsd.pkg.mk
>>
>>Log Message:
>>Allow white-space in the PATH environment variable. Fixes PR 32079. The
>>shell quoting still isn't completely correct for some other variables.
>>This needs to be fixed, too.
>>
>>
>>To generate a diff of this commit:
>>cvs rdiff -r1.1748 -r1.1749 pkgsrc/mk/bsd.pkg.mk
> 
> 
> Hi,
> 
> I have the feeling that this commit (and maybe 1.1751 too) broke the
> installation as a non root user.
> 
> ===> Installing for fribidi-0.10.4nb1
> ===> Becoming root@parresum.lan.rfc1918.veego.de to install fribidi.
> /usr/bin/su Password:
> path=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin:/usr/pkg/bin:/usr/pkg/sbin:/sbin:/usr/sbin: Command not found.
> tr: not found

This looks strongly related to the changes I made. :(

Can you please try the appended patch to see if it goes away with it? 
For me, both variants work, so I don't know why it fails for you.

Roland

--------------050807060504090409020908
Content-Type: text/plain;
 name="bsd.pkg.mk.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="bsd.pkg.mk.patch"

--- bsd.pkg.mk	Sun Nov 20 01:04:10 2005
+++ bsd.pkg.mk.new	Sun Nov 20 00:57:42 2005
@@ -2783,7 +2783,7 @@ _SU_TARGET=								\
 		fi;                                             	\
 		${ECHO_MSG} "${_PKGSRC_IN}> Becoming ${ROOT_USER}@`${HOSTNAME_CMD}` to $$action ${PKGBASE}."; \
 		${ECHO_N} "`${ECHO} ${SU_CMD} | ${AWK} '{ print $$1 }'` ";\
-		${SU_CMD} 'cd ${.CURDIR}; path=$${PATH}:${SU_CMD_PATH_APPEND:Q}; ${SETENV} PATH="$${path}" ${MAKE} '"$$args"' ${MAKEFLAGS} '"$$realtarget"' '"$$realflags"''; \
+		${SU_CMD} "cd ${.CURDIR}; ${SETENV} \"PATH=\$${PATH}:\""${SU_CMD_PATH_APPEND:Q:Q}" ${MAKE} $$args ${MAKEFLAGS} $$realtarget $$realflags"; \
 	fi
 
 .PHONY: do-su-install

--------------050807060504090409020908--