Re: [gentoo-dev] [PATCH] fcaps.eclass: Group name portability

2014-04-15 Thread Cyprien Nicolas
Il y a 5 heures et 36 minutes, Naohiro Aota écrivit :
 Diego Elio Pettenò flamee...@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)

user.eclass provides egetent

  egetent group 0

should give you the same output as $ getent group 0 | cut -d: -f1

-- 
Cyprien Nicolas (Fulax)
Gentoo Lisp project contrib



Re: [gentoo-dev] [PATCH] fcaps.eclass: Group name portability

2014-04-15 Thread Alexander Tsoy
В Tue, 15 Apr 2014 11:11:53 +0900
Naohiro Aota na...@gentoo.org пишет:

 Diego Elio Pettenò flamee...@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.

-- 
Alexander Tsoy



Re: [gentoo-dev] [PATCH] fcaps.eclass: Group name portability

2014-04-15 Thread Alexander Tsoy
В Tue, 15 Apr 2014 12:06:44 +0400
Alexander Tsoy alexan...@tsoy.me пишет:

 В Tue, 15 Apr 2014 11:11:53 +0900
 Naohiro Aota na...@gentoo.org пишет:
 
  Diego Elio Pettenò flamee...@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



Re: [gentoo-dev] [PATCH] fcaps.eclass: Group name portability

2014-04-14 Thread Naohiro Aota
hasufell hasuf...@gentoo.org writes:

 na...@gentoo.org:
 fcaps.eclass is using group name 'root' which is not available on BSD
 system. Instead you can use 0, or $(id -g -n 0) if you'd prefer group
 name
 
 Index: fcaps.eclass
 ===
 RCS file: /var/cvsroot/gentoo-x86/eclass/fcaps.eclass,v
 retrieving revision 1.8
 diff -u -r1.8 fcaps.eclass
 --- fcaps.eclass 27 Jun 2013 01:18:57 -  1.8
 +++ fcaps.eclass 13 Apr 2014 00:16:44 -
 @@ -80,7 +80,7 @@
  
  # Process the user options first.
  local owner='root'
 -local group='root'
 +local group=$(id -g -n 0)
  local mode='4711'
  local caps_mode='711'
  
 

 # id -g -n 0
 id: 0: no such user

Strange. Is this busybox id? /usr/bin/id from both sys-apps/coreutils (Linux)
and sys-freebsd/freebsd-ubin (FreeBSD) just worked fine for me.



pgpyXH3LhItMt.pgp
Description: PGP signature


Re: [gentoo-dev] [PATCH] fcaps.eclass: Group name portability

2014-04-14 Thread Naohiro Aota
Diego Elio Pettenò flamee...@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)


pgpbPfsUeoSka.pgp
Description: PGP signature


Re: [gentoo-dev] [PATCH] fcaps.eclass: Group name portability

2014-04-13 Thread Diego Elio Pettenò
I'm pretty sure we have an eclass function to get the name of the 0 group.
On 12 Apr 2014 17:41, hasufell hasuf...@gentoo.org wrote:

 na...@gentoo.org:
  fcaps.eclass is using group name 'root' which is not available on BSD
  system. Instead you can use 0, or $(id -g -n 0) if you'd prefer group
  name
 
  Index: fcaps.eclass
  ===
  RCS file: /var/cvsroot/gentoo-x86/eclass/fcaps.eclass,v
  retrieving revision 1.8
  diff -u -r1.8 fcaps.eclass
  --- fcaps.eclass  27 Jun 2013 01:18:57 -  1.8
  +++ fcaps.eclass  13 Apr 2014 00:16:44 -
  @@ -80,7 +80,7 @@
 
# Process the user options first.
local owner='root'
  - local group='root'
  + local group=$(id -g -n 0)
local mode='4711'
local caps_mode='711'
 
 

 # id -g -n 0
 id: 0: no such user




Re: [gentoo-dev] [PATCH] fcaps.eclass: Group name portability

2014-04-12 Thread hasufell
na...@gentoo.org:
 fcaps.eclass is using group name 'root' which is not available on BSD
 system. Instead you can use 0, or $(id -g -n 0) if you'd prefer group
 name
 
 Index: fcaps.eclass
 ===
 RCS file: /var/cvsroot/gentoo-x86/eclass/fcaps.eclass,v
 retrieving revision 1.8
 diff -u -r1.8 fcaps.eclass
 --- fcaps.eclass  27 Jun 2013 01:18:57 -  1.8
 +++ fcaps.eclass  13 Apr 2014 00:16:44 -
 @@ -80,7 +80,7 @@
  
   # Process the user options first.
   local owner='root'
 - local group='root'
 + local group=$(id -g -n 0)
   local mode='4711'
   local caps_mode='711'
  
 

# id -g -n 0
id: 0: no such user