public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Alexander Tsoy <alexander@tsoy.me>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [PATCH] fcaps.eclass: Group name portability
Date: Tue, 15 Apr 2014 12:13:07 +0400	[thread overview]
Message-ID: <20140415121307.4a478171@home.puleglot> (raw)
In-Reply-To: <20140415120644.4c204446@home.puleglot>

В Tue, 15 Apr 2014 12:06:44 +0400
Alexander Tsoy <alexander@tsoy.me> пишет:

> В Tue, 15 Apr 2014 11:11:53 +0900
> Naohiro Aota <naota@gentoo.org> пишет:
> 
> > Diego Elio Pettenò <flameeyes@flameeyes.eu> writes:
> > 
> > > I'm pretty sure we have an eclass function to get the name of the
> > > 0 group. 
> > 
> > I can't find one... but found qmail.eclass is using exactly same
> > method.
> > 
> > >       export GROUP_ROOT="$(id -gn root)"
> 
> "id -gn root" prints initial group name of the user root. This is
> exactly what you want in fcaps.eclass. In linux "id" accepts only
> username as argument, it doesn't support uid.
> 

But if you really want to convert gid=0 to groupname, then use egetent()
as also noted by Cyprien:

inherit user
...
local group=$(egetent group 0)
group=${group%%:*}

-- 
Alexander Tsoy


  reply	other threads:[~2014-04-15  8:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-13  0:18 [gentoo-dev] [PATCH] fcaps.eclass: Group name portability naota
2014-04-13  0:40 ` hasufell
2014-04-13  6:29   ` Diego Elio Pettenò
2014-04-15  2:11     ` Naohiro Aota
2014-04-15  7:48       ` Cyprien Nicolas
2014-04-15  8:06       ` Alexander Tsoy
2014-04-15  8:13         ` Alexander Tsoy [this message]
2014-04-15  2:10   ` Naohiro Aota
2014-07-31 10:21 ` [gentoo-dev] " Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140415121307.4a478171@home.puleglot \
    --to=alexander@tsoy.me \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox