Gentoo Archives: gentoo-dev

From: Jaco Kroon <jaco@××××××.za>
To: gentoo-dev@l.g.o, "Michał Górny" <mgorny@g.o>
Subject: Re: [gentoo-dev] [PATCH v4 12/19] user.eclass: Support getting & setting comment field
Date: Wed, 12 Jun 2019 07:08:18
Message-Id: 32aecad6-5408-e99b-a7ef-e2e63a5fccc5@uls.co.za
In Reply to: [gentoo-dev] [PATCH v4 12/19] user.eclass: Support getting & setting comment field by "Michał Górny"
Hi,


> + # update the comment > + case ${CHOST} in > + *-freebsd*|*-dragonfly*) > + pw usermod "${euser}" -c "${ecomment}" && return 0 > + [[ $? == 8 ]] && eerror "${euser} is in use, cannot update comment" > + eerror "There was an error when attempting to update the comment for ${euser}" > + eerror "Please update it manually on your system:" > + eerror "\t pw usermod \"${euser}\" -c \"${ecomment}\"" > + ;; > + > + *) > + usermod -c "${ecomment}" "${euser}" && return 0 > + [[ $? == 8 ]] && eerror "${euser} is in use, cannot update comment" > + eerror "There was an error when attempting to update the comment for ${euser}" > + eerror "Please update it manually on your system (as root):" > + eerror "\t usermod -c \"${ecomment}\" \"${euser}\"" > + ;; > + esac > +} > + > fi
Those error messages are duplicate and can move to after the case. You should probably also explicitly return with an error if the case drops through. Kind Regards, Jaco