From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 1D9C3138335 for ; Thu, 20 Jun 2019 08:17:19 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BEC9AE0A8A; Thu, 20 Jun 2019 08:17:17 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A506CE0A8A for ; Thu, 20 Jun 2019 08:17:17 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C6A8D346560 for ; Thu, 20 Jun 2019 08:17:16 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5BA65628 for ; Thu, 20 Jun 2019 08:17:13 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1561018606.e66f2b799392ce068eb907786228e6cddfe52f26.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/user.eclass X-VCS-Directories: eclass/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: e66f2b799392ce068eb907786228e6cddfe52f26 X-VCS-Branch: master Date: Thu, 20 Jun 2019 08:17:13 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: f16c3a55-dffa-4881-89fa-6e0a0c6a6737 X-Archives-Hash: 1f2a70d1beac94ef9c7c81f29addeef6 commit: e66f2b799392ce068eb907786228e6cddfe52f26 Author: Michał Górny gentoo org> AuthorDate: Thu Jun 6 15:09:23 2019 +0000 Commit: Michał Górny gentoo org> CommitDate: Thu Jun 20 08:16:46 2019 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e66f2b79 user.eclass: Introduce eget{user,group}name Signed-off-by: Michał Górny gentoo.org> eclass/user.eclass | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/eclass/user.eclass b/eclass/user.eclass index 3bd381b0c08..7592ee3bba2 100644 --- a/eclass/user.eclass +++ b/eclass/user.eclass @@ -351,6 +351,26 @@ enewgroup() { esac } +# @FUNCTION: egetusername +# @USAGE: +# @DESCRIPTION: +# Gets the username for given UID. +egetusername() { + [[ $# -eq 1 ]] || die "usage: egetusername " + + id -u -n "$1" +} + +# @FUNCTION: egetgroupname +# @USAGE: +# @DESCRIPTION: +# Gets the group name for given GID. +egetgroupname() { + [[ $# -eq 1 ]] || die "usage: egetgroupname " + + id -g -n "$1" +} + # @FUNCTION: egethome # @USAGE: # @DESCRIPTION: