From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 28 13:36:08 2021 Received: (at 50873) by debbugs.gnu.org; 28 Sep 2021 17:36:08 +0000 Received: from localhost ([127.0.0.1]:46931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVH1T-0001DZ-P7 for submit@debbugs.gnu.org; Tue, 28 Sep 2021 13:36:07 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:33286 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVH1S-0001Cj-8g for 50873@debbugs.gnu.org; Tue, 28 Sep 2021 13:36:06 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1632850560; bh=noR8bcNYCpsS7urz40MGuCN1Dw4WfxLNXQpd0Scl5Zg=; h=From:To:Subject:In-Reply-To:References:Date; b=r+Fy5q/jJHbJ5HLE0TS/Tna/RGOYHxzwTInNtYs7eCdsCdflZnlfXq6NofAAmmflQ f7dTV1E2liwYIXWypkoEcDFUA5NTEpfPq5P8bHjKjEoqea1j6rEelOd9kPzuumota1 HTa7jRF0lbPwtmmz9WKLK/vCjlfKOcykR0SauiYY= To: 50873@debbugs.gnu.org Subject: [PATCH 4/5] guix home: import: Delete duplicate modules when importing. In-Reply-To: References: X-Debbugs-Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , Andrew Tropin Message-Id: <7063704a274d99c8ea0bdc437a05b74e9fd78a49.1632849969.git.public@yoctocell.xyz> Date: Tue, 28 Sep 2021 19:36:00 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 2.9 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Two different services might require the same module(s), so delete duplicates when generating the ‘use-modules’ form. * import.scm (manifest->code): Delete duplicate modules. --- guix/scripts/home/import.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 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: 1.9 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Two different services might require the same module(s), so delete duplicates when generating the ‘use-modules’ form. * import.scm (manifest->code): Delete duplicate modules. --- guix/scripts/home/import.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps Two different services might require the same module(s), so delete duplicat= es when generating the =E2=80=98use-modules=E2=80=99 form. * import.scm (manifest->code): Delete duplicate modules. --- guix/scripts/home/import.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index 6d9ca98f28..5ba99378af 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -149,7 +149,8 @@ (define (qualified-name entry) `(begin (use-modules (gnu home) (gnu packages) - ,@(concatenate (map cdr configurations+modul= es))) + ,@((compose delete-duplicates concatenate) + (map cdr configurations+modules))) ,(home-environment-template #:specs specs #:services (map first configurations+modules)))) @@ -192,7 +193,8 @@ (define name (use-modules (guix transformations) (gnu home) (gnu packages) - ,@(concatenate (map cdr configurations+modul= es))) + ,@((compose delete-duplicates concatenate) + (map cdr configurations+modules))) =20 ,@transformations =20 --=20 2.33.0