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 C89A4138334 for ; Thu, 13 Jun 2019 05:34:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7EBEFE08F3; Thu, 13 Jun 2019 05:34:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 2D216E08EF for ; Thu, 13 Jun 2019 05:34:02 +0000 (UTC) Received: from pomiot (d202-252.icpnet.pl [109.173.202.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 12E0C345FCA; Thu, 13 Jun 2019 05:33:58 +0000 (UTC) Message-ID: Subject: Re: [gentoo-dev] [PATCH v4 08/19] user.eclass: Factor out finding nologin into separate function From: =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Date: Thu, 13 Jun 2019 07:33:54 +0200 In-Reply-To: <312d136a-3f25-013a-0c2e-93a5aa0f659e@gentoo.org> References: <20190611162347.2989-1-mgorny@gentoo.org> <20190611162347.2989-9-mgorny@gentoo.org> <312d136a-3f25-013a-0c2e-93a5aa0f659e@gentoo.org> Organization: Gentoo Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-aGnKj97efLqN7ZFohnIu" User-Agent: Evolution 3.30.5 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 X-Archives-Salt: 1019d5e4-d161-4ac0-bfcb-d3eabda1bd4a X-Archives-Hash: 1b79494489a73694bd3af1436fd7fb43 --=-aGnKj97efLqN7ZFohnIu Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2019-06-12 at 21:11 -0400, Michael Orlitzky wrote: > On 6/11/19 12:23 PM, Micha=C5=82 G=C3=B3rny wrote: > > =20 > > +# @FUNCTION: user_get_nologin > > +# @INTERNAL > > +# @DESCRIPTION: > > +# Find an appropriate 'nologin' shell for the platform, and output > > +# its path. > > +user_get_nologin() { >=20 > This isn't a great name for this function, because it doesn't have > anything to do with the user being added. How about > userland_get_nologin? Then it could take the userland as an argument... user_ is eclass name prefix. >=20 >=20 > > + case ${USERLAND} in > > + GNU) eshell=3D"/bin/false" ;; >=20 > to eliminate that dependency on the global variable. In other words, the > above could become "case $1..." to make the function self-contained. >=20 >=20 >=20 > > + eshell=3D$(user_get_nologin) >=20 > Then this would have to become >=20 > eshell=3D$(userland_get_nologin "${USERLAND}") Do you have any real use for that? --=20 Best regards, Micha=C5=82 G=C3=B3rny --=-aGnKj97efLqN7ZFohnIu Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQGTBAABCgB9FiEEx2qEUJQJjSjMiybFY5ra4jKeJA4FAl0B4EJfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEM3 NkE4NDUwOTQwOThEMjhDQzhCMjZDNTYzOUFEQUUyMzI5RTI0MEUACgkQY5ra4jKe JA6qewgAzogKNCv935V3y83gUJij1oR8hLVVQ26NxmfREWajaO0eXdzROU+73Wwd 0r7O0z873NQtlPEirK6vCSaflI3Gz2RpkMUlpXkN4iXqWVAP2zNYIKFZc7E8T6Nr SHSdBB24d27mc6+K7OM7H50UXULsys6eprGRCn9zD0BqzOgTg3S5UXnE0hE/H7P4 qtRQ1fPTUjrM/uFYELyW2HLXZn2CWRUHnnlDBvXa3GOyNdpvoVnexZ93BbwiPaWx wZ6o7K7r5sullCGSEMPxWJaNSMqSK0hadWhUqxqgnbJF29A64IUvKcf5D/rOho/J xauD21g4Gezm7cZxuQcyx34mpM4TJg== =3htU -----END PGP SIGNATURE----- --=-aGnKj97efLqN7ZFohnIu--