Date: Tue, 26 Jun 2012 13:24:52 -0700 From: "Simon J. Gerraty" <sjg@juniper.net> To: Eric van Gyzen <eric@vangyzen.net> Cc: =?ISO-8859-1?Q?rgrav?= <des@des.no>, =?ISO-8859-1?Q?Dag-Erling_Sm=F8?=, Warner Losh <wlosh@bsdimp.com>, freebsd-arch@freebsd.org Subject: Re: Allow user install Message-ID: <20120626202452.3028158081@chaos.jnpr.net> In-Reply-To: <4FEA10BD.2080504@vangyzen.net> References: <20120626063017.D05DA58081@chaos.jnpr.net> <86wr2uwdgf.fsf@ds4.des.no> <CAGE5yCobmB6PyCzqSxVgbBomuE7AHWmUd5e4pEqHNeFvxpZCAQ@mail.gmail.com> <CAGE5yCqy5bRoNNDc_4hK9wtvVxEzoQrjNvGyLOvJy2VZAF=tZw@mail.gmail.com> <20120626190349.98D5B58081@chaos.jnpr.net> <97FE8A0B-1836-4C60-9086-9C30A1123CE9@bsdimp.com> <4FEA10BD.2080504@vangyzen.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 26 Jun 2012 14:42:53 -0500, Eric van Gyzen writes:
>>>
>>> +_uid!= id -u
>>> +.if ${MK_INSTALL_AS_USER} != "no"&&  ${_uid} != 0
>>> +_gid!= id -g
>>> +.for x in BIN CONF DOC INFO KMOD LIB MAN NLS SHARE
>>> +$xOWN = ${_uid}
>>> +$xGRP = ${_gid}
>> I like this a lot more.
>
>Me too.  We're doing almost exactly that, directly in make.conf.  Yours 
>is cleaner, of course.
A final? tweak, I've moved the _uid!= id -u inside the first .if and
added another to avoid id -u if MK_INSTALL_AS_USER==no, the extra .if is
much cheaper than running 'id'.
+.if ${MK_INSTALL_AS_USER} != "no"
+_uid!= id -u
+.if ${_uid} != 0
+_gid!= id -g
+.for x in BIN CONF DOC INFO KMOD LIB MAN NLS SHARE
+$xOWN= ${_uid}
+$xGRP= ${_gid}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120626202452.3028158081>
