Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Wed, 26 Feb 2020 10:28:44
Message-Id: 1582712907.9370ca73534408e928474c4a808eb04051e435d3.mgorny@gentoo
1 commit: 9370ca73534408e928474c4a808eb04051e435d3
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 31 14:56:48 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 26 10:28:27 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9370ca73
7
8 user.eclass: enewgroup, allow -1 as gid
9
10 Allow using '-1' to specify 'next free GID' for enewgroup. While
11 technically this can already be specified by omitting gid, allowing -1
12 improves consistency with enewuser.
13
14 Closes: https://bugs.gentoo.org/707508
15 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
16
17 eclass/user.eclass | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20 diff --git a/eclass/user.eclass b/eclass/user.eclass
21 index a33915e2119..b70698356a3 100644
22 --- a/eclass/user.eclass
23 +++ b/eclass/user.eclass
24 @@ -252,7 +252,7 @@ enewgroup() {
25
26 # handle gid
27 local egid=$1; shift
28 - if [[ ! -z ${egid} ]] ; then
29 + if [[ -n ${egid} && ${egid} != -1 ]] ; then
30 if [[ ${egid} -gt 0 ]] ; then
31 if [[ -n $(egetent group ${egid}) ]] ; then
32 [[ -n ${force_gid} ]] && die "${FUNCNAME}: GID ${egid} already taken"