From: Michał Górny Date: Fri, 31 Jan 2020 14:56:48 +0000 (+0100) Subject: user.eclass: enewgroup, allow -1 as gid X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9370ca73534408e928474c4a808eb04051e435d3;p=gentoo.git user.eclass: enewgroup, allow -1 as gid Allow using '-1' to specify 'next free GID' for enewgroup. While technically this can already be specified by omitting gid, allowing -1 improves consistency with enewuser. Closes: https://bugs.gentoo.org/707508 Signed-off-by: Michał Górny --- diff --git a/eclass/user.eclass b/eclass/user.eclass index a33915e21192..b70698356a3a 100644 --- a/eclass/user.eclass +++ b/eclass/user.eclass @@ -252,7 +252,7 @@ enewgroup() { # handle gid local egid=$1; shift - if [[ ! -z ${egid} ]] ; then + if [[ -n ${egid} && ${egid} != -1 ]] ; then if [[ ${egid} -gt 0 ]] ; then if [[ -n $(egetent group ${egid}) ]] ; then [[ -n ${force_gid} ]] && die "${FUNCNAME}: GID ${egid} already taken"