On Thu, Jan 29, 2004 at 02:01:07PM -0500, Chris Gianelloni wrote:
> ...or you could simply replace the default eid.passwd file with one in
> your /etc/portage directory to reflect your company's "proper" UID/GID
> usage.

No, that's not the same thing.  I would have to pre-create all the
accounts in eid.passwd in the global database, otherwise enew{user,group}
would just add them to the local passwd and group files as before.  I don't
really want to pollute my database with many account entries I will never
use.

> It makes much more sense to have portage conform to your system
> in this way than to take the time/energy to create yet another almost
> unused feature.

Surely I'm not the only one in the world sharing account info among
different Unixes?  Sure, I wish my predecessors had left more room at
the beginning of the uid space for system accounts, but back in the day,
they didn't need that many system accounts and uid space was tight
(remember signed 16-bit uids?)

If Gentoo has any designs on the enterprise space, I think such a feature
would be well-received.

> I don't mean to say this to insult at all.

No insult taken; we're just discussing.  Calling me an XP user would be
an insult.

> I just
> think the better method for anything of this type is to have a default
> that portage uses, which works for the masses,

I'm not suggesting turning my requested feature on by default.

> but can be overridden by
> files in /etc/portage (such as package.mask, package.unmask).  It makes
> for a cleaner approach IMHO.

I'm not sure have having a feature in FEATURE is less "clean" than having
it in /etc/portage.  We could turn each FEATURE keyword into a file in, say,
PORTDIR/feature (ala /etc/config under IRIX) and allow people to override
them with yet more files in /etc/portage, but I don't see how that would be
more clean.

As for time/energy, I've spent more time typing these emails that it took
to patch eutils.eclass.  (Granted, I'm much faster at writing shell scripts
than prose.)  I haven't tested this yet, but it shows the general idea.

diff -u eutils.eclass /tmp/eutils.eclass
--- eutils.eclass       2004-01-13 01:44:07.000000000 -0500
+++ /tmp/eutils.eclass  2004-01-29 15:00:16.000000000 -0500
@@ -583,14 +583,18 @@
        export SANDBOX_ON="0"
        if [ -z "${eextra}" ]
        then
-               useradd ${opts} ${euser} \
-                       -c "added by portage for ${PN}" \
-                       || die "enewuser failed"
+               eextra="-c 'added by portage for ${PN}'"
        else
                einfo " - Extra: ${eextra}"
-               useradd ${opts} ${euser} ${eextra} \
-                       || die "enewuser failed"
        fi
+       if use nonewusers $FEATURES; then
+               eerror "Run the following command:"
+               eerror "        useradd ${opts} ${euser} ${eextra}"
+               eerror "then rerun emerge"
+               die "enewuser failed: user ${euser} does not exist"
+       fi
+       useradd ${opts} ${euser} ${eextra} || die "enewuser failed"
+
        export SANDBOX_ON="${oldsandbox}"
 
        if [ ! -e "${ehome}" ] && [ ! -e "${D}/${ehome}" ]
@@ -658,6 +662,12 @@
        # add the group
        local oldsandbox="${SANDBOX_ON}"
        export SANDBOX_ON="0"
+       if use nonewusers $FEATURES; then
+               eerror "Run the following command:"
+               eerror "        groupadd ${opts} ${egroup}"
+               eerror "then rerun emerge"
+               die "enewgroup failed: group ${egroup} does not exist"
+       fi
        groupadd ${opts} ${egroup} || die "enewgroup failed"
        export SANDBOX_ON="${oldsandbox}"
 }

--
[EMAIL PROTECTED] mailing list

Reply via email to