From patchwork Thu Jun 27 15:36:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 65692 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 34CC927BBE2; Thu, 27 Jun 2024 16:37:37 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id E3AF127BBEA for ; Thu, 27 Jun 2024 16:37:22 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMrBL-0001hp-Ew; Thu, 27 Jun 2024 11:37:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMrBE-0001gQ-Lx for guix-patches@gnu.org; Thu, 27 Jun 2024 11:37:01 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMrBE-0005Zz-E6 for guix-patches@gnu.org; Thu, 27 Jun 2024 11:37:00 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sMrBG-00028b-TK for guix-patches@gnu.org; Thu, 27 Jun 2024 11:37:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71802] [PATCH] guix: home: Avoid home reconfiguration when nothing is to be done. References: <20240627150643.30981-1-ngraves@ngraves.fr> In-Reply-To: <20240627150643.30981-1-ngraves@ngraves.fr> Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 27 Jun 2024 15:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71802 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71802@debbugs.gnu.org Cc: ngraves@ngraves.fr, andrew@trop.in Received: via spool by 71802-submit@debbugs.gnu.org id=B71802.17195026148187 (code B ref 71802); Thu, 27 Jun 2024 15:37:02 +0000 Received: (at 71802) by debbugs.gnu.org; 27 Jun 2024 15:36:54 +0000 Received: from localhost ([127.0.0.1]:43187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMrB8-00027z-4c for submit@debbugs.gnu.org; Thu, 27 Jun 2024 11:36:54 -0400 Received: from 6.mo582.mail-out.ovh.net ([87.98.177.69]:52259) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMrB4-00027o-J8 for 71802@debbugs.gnu.org; Thu, 27 Jun 2024 11:36:52 -0400 Received: from director11.ghost.mail-out.ovh.net (unknown [10.108.25.152]) by mo582.mail-out.ovh.net (Postfix) with ESMTP id 4W92jm50p7z1Bws for <71802@debbugs.gnu.org>; Thu, 27 Jun 2024 15:36:44 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-j6b4p (unknown [10.111.182.7]) by director11.ghost.mail-out.ovh.net (Postfix) with ESMTPS id CFCBF1FEA7; Thu, 27 Jun 2024 15:36:42 +0000 (UTC) Received: from ngraves.fr ([37.59.142.102]) by ghost-submission-6684bf9d7b-j6b4p with ESMTPSA id Zof9NgqHfWam1QMAMsdf5g (envelope-from ); Thu, 27 Jun 2024 15:36:42 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-102R00430d05ee9-eba9-4392-ad86-34b8cf5d374a, EF1A3882BBF0FDD95E9CFC0F8FCF195DD0B940A8) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 81.67.146.208 Date: Thu, 27 Jun 2024 17:36:18 +0200 Message-ID: <20240627153634.5181-1-ngraves@ngraves.fr> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-Ovh-Tracer-Id: 9731152895955296859 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeeftddrtdeggdeludcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvvefufffkofgggfestdekredtredttdenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeekffegteffgfffjeegjedvfffgtddvueeutefgfeeuvdejgedvgeejjeevueeuveenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddruddtvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepjedukedtvdesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekvddpmhhouggvpehsmhhtphhouhht 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: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/scripts/home.scm (perform-action): In case of 'reconfigure action, when the output profile is the current profile, avoid reconfiguration. Change-Id: I9d4413df05455a1ebbe10773a851a61e1c8c9e66 --- guix/scripts/home.scm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm index b4c82d275f1..f0b8251c435 100644 --- a/guix/scripts/home.scm +++ b/guix/scripts/home.scm @@ -446,12 +446,16 @@ (define println (generation (generation-file-name %guix-home (+ 1 number)))) - (switch-symlinks generation he-out-path) - (switch-symlinks %guix-home generation) - (setenv "GUIX_NEW_HOME" he-out-path) - (primitive-load (string-append he-out-path "/activate")) - (setenv "GUIX_NEW_HOME" #f) - (return he-out-path))) + (if (equal? he-out-path (readlink* %guix-home)) + (begin (info (G_ "Nothing to be done.~%")) + (return #f)) + (begin + (switch-symlinks generation he-out-path) + (switch-symlinks %guix-home generation) + (setenv "GUIX_NEW_HOME" he-out-path) + (primitive-load (string-append he-out-path "/activate")) + (setenv "GUIX_NEW_HOME" #f) + (return he-out-path))))) ((container) (mlet %store-monad ((status (spawn-home-container he