From patchwork Sat Oct 30 10:42:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xinglu Chen X-Patchwork-Id: 34154 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 70DD227BBE3; Sat, 30 Oct 2021 11:43:23 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4046427BBE1 for ; Sat, 30 Oct 2021 11:43:23 +0100 (BST) Received: from localhost ([::1]:52132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mglpa-0001OE-9Q for patchwork@mira.cbaines.net; Sat, 30 Oct 2021 06:43:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mglpJ-0000vu-6W for guix-patches@gnu.org; Sat, 30 Oct 2021 06:43:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45190) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mglpI-0001sp-UY for guix-patches@gnu.org; Sat, 30 Oct 2021 06:43:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mglpI-0002bt-Sc for guix-patches@gnu.org; Sat, 30 Oct 2021 06:43:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50873] [PATCH v3 5/8] guix home: import: Delete duplicate modules when importing. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 30 Oct 2021 10:43:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50873 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50873@debbugs.gnu.org, Oleg Pykhalov , Andrew Tropin , Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 50873-submit@debbugs.gnu.org id=B50873.16355905669950 (code B ref 50873); Sat, 30 Oct 2021 10:43:04 +0000 Received: (at 50873) by debbugs.gnu.org; 30 Oct 2021 10:42:46 +0000 Received: from localhost ([127.0.0.1]:56728 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgloz-0002aL-Pa for submit@debbugs.gnu.org; Sat, 30 Oct 2021 06:42:46 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:59332 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mglow-0002Z6-SY for 50873@debbugs.gnu.org; Sat, 30 Oct 2021 06:42:43 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1635590557; bh=Hd1VakLjtxnp6jV7Q0I9BKs8lo/pxC+h662NKXyuRvs=; h=From:To:Subject:In-Reply-To:References:Date; b=lB4qnlY62dSgSMO87xm7ZwTFDkyuiCZZBFoLQA8UV0Kqs41WmGt9dQfVXGPv+AqCb 5OB0pODejG0IK6RYpDcfGSlGJ6aOPESfR/Gpa0LPjdSpZVfgyUtRAttn+5V66bM3Z6 OzlCpTp2y3j3xNoUKePM83Ax9Tklz15aD5QCFA24= In-Reply-To: References: Message-Id: <40ca56d2d949f7a56bce56d1221396fb85e57a4d.1635590221.git.public@yoctocell.xyz> Date: Sat, 30 Oct 2021 12:42:37 +0200 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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(-) diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index 0e7c454f45..f0ae233b75 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -145,7 +145,8 @@ (define (qualified-name entry) (use-modules (gnu home) (gnu packages) (gnu services) - ,@(concatenate (map cdr configurations+modules))) + ,@((compose delete-duplicates concatenate) + (map cdr configurations+modules))) ,(home-environment-template #:specs specs #:services (map first configurations+modules)))) @@ -190,7 +191,8 @@ (define name (gnu home) (gnu packages) (gnu services) - ,@(concatenate (map cdr configurations+modules))) + ,@((compose delete-duplicates concatenate) + (map cdr configurations+modules))) ,@transformations