Gentoo Archives: gentoo-dev

From: Michael Orlitzky <mjo@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH v4 08/19] user.eclass: Factor out finding nologin into separate function
Date: Thu, 13 Jun 2019 01:12:03
Message-Id: 312d136a-3f25-013a-0c2e-93a5aa0f659e@gentoo.org
In Reply to: [gentoo-dev] [PATCH v4 08/19] user.eclass: Factor out finding nologin into separate function by "Michał Górny"
1 On 6/11/19 12:23 PM, Michał Górny wrote:
2 >
3 > +# @FUNCTION: user_get_nologin
4 > +# @INTERNAL
5 > +# @DESCRIPTION:
6 > +# Find an appropriate 'nologin' shell for the platform, and output
7 > +# its path.
8 > +user_get_nologin() {
9
10 This isn't a great name for this function, because it doesn't have
11 anything to do with the user being added. How about
12 userland_get_nologin? Then it could take the userland as an argument...
13
14
15 > + case ${USERLAND} in
16 > + GNU) eshell="/bin/false" ;;
17
18 to eliminate that dependency on the global variable. In other words, the
19 above could become "case $1..." to make the function self-contained.
20
21
22
23 > + eshell=$(user_get_nologin)
24
25 Then this would have to become
26
27 eshell=$(userland_get_nologin "${USERLAND}")

Replies