From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 16 13:37:42 2021 Received: (at 45836) by debbugs.gnu.org; 16 Jan 2021 18:37:42 +0000 Received: from localhost ([127.0.0.1]:44051 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0qSE-0002bL-Hk for submit@debbugs.gnu.org; Sat, 16 Jan 2021 13:37:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0qSD-0002b8-1i for 45836@debbugs.gnu.org; Sat, 16 Jan 2021 13:37:41 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57190) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0qS5-0007I9-OI; Sat, 16 Jan 2021 13:37:33 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36452 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l0qS5-00013G-BP; Sat, 16 Jan 2021 13:37:33 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Leo Prikler Subject: Re: [PATCH] services: Let cups-service-type reuse base lp group. References: <20210114130610.31936-1-leo.prikler@student.tugraz.at> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 27 =?utf-8?Q?Niv=C3=B4se?= an 229 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sat, 16 Jan 2021 19:37:27 +0100 In-Reply-To: <20210114130610.31936-1-leo.prikler@student.tugraz.at> (Leo Prikler's message of "Thu, 14 Jan 2021 14:06:11 +0100") Message-ID: <875z3wzq1k.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 45836 Cc: 45836@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Leo Prikler skribis: > * gnu/services/cups.scm (%cups-accounts): Try to use the lp group defined= in > %base-groups. > * gnu/system/shadow.scm (account-activation): Delete duplicate (eq?) users > and groups before transforming them to specs and asserting, that names are > unique. [...] > (define %cups-accounts > - (list (user-group (name "lp") (system? #t)) > + (list (or > + ;; The "lp" group should already exist; try to reuse it. > + (find (lambda (group) > + (and (user-group? group) > + (string=3D? (user-group-name group) "lp"))) > + %base-groups) > + (user-group (name "lp") (system? #t))) > (user-group (name "lpadmin") (system? #t)) > (user-account > (name "lp") This bit LGTM, and I think it can be committed in a commit of its own. > diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm > index 0538fb1a24..7c57222716 100644 > --- a/gnu/system/shadow.scm > +++ b/gnu/system/shadow.scm > @@ -321,13 +321,13 @@ of user '~a' is undeclared") > objects. Raise an error if a user account refers to a unde= fined > group." > (define accounts > - (filter user-account? accounts+groups)) > + (delete-duplicates (filter user-account? accounts+groups) eq?)) >=20=20 > (define user-specs > (map user-account->gexp accounts)) >=20=20 > (define groups > - (filter user-group? accounts+groups)) > + (delete-duplicates (filter user-group? accounts+groups) eq?)) Why use =E2=80=98eq?=E2=80=99? I=E2=80=99d use =E2=80=98equal?=E2=80=99, b= ut note that records cannot necessarily be compared with =E2=80=98equal?=E2=80=99 because of the= thunked =E2=80=98home-directory=E2=80=99 field (=E2=80=98equal?=E2=80=99 is meaning= less for procedures). Thanks, Ludo=E2=80=99.