From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id EL1KLkqFQGDVYwAA0tVLHw (envelope-from ) for ; Thu, 04 Mar 2021 06:59:22 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id UG8MKkqFQGCmfAAAbx9fmQ (envelope-from ) for ; Thu, 04 Mar 2021 06:59:22 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id ED9E81AC6D for ; Thu, 4 Mar 2021 07:59:21 +0100 (CET) Received: from localhost ([::1]:44856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHhxB-00076y-56 for larch@yhetil.org; Thu, 04 Mar 2021 01:59:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35722) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHhws-0006uD-VS for guix-patches@gnu.org; Thu, 04 Mar 2021 01:59:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45982) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lHhws-000400-Oa for guix-patches@gnu.org; Thu, 04 Mar 2021 01:59:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lHhws-0000te-Oe for guix-patches@gnu.org; Thu, 04 Mar 2021 01:59:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#46560] [PATCH v2 2/2] scripts: system: Activate system when switching generations. Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 04 Mar 2021 06:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46560 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 46560@debbugs.gnu.org Cc: ludo@gnu.org Received: via spool by 46560-submit@debbugs.gnu.org id=B46560.16148410913372 (code B ref 46560); Thu, 04 Mar 2021 06:59:02 +0000 Received: (at 46560) by debbugs.gnu.org; 4 Mar 2021 06:58:11 +0000 Received: from localhost ([127.0.0.1]:57526 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lHhw2-0000sK-OL for submit@debbugs.gnu.org; Thu, 04 Mar 2021 01:58:11 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:29273) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lHhvz-0000rf-Vo for 46560@debbugs.gnu.org; Thu, 04 Mar 2021 01:58:08 -0500 X-Originating-IP: 176.181.186.101 Received: from localhost (i15-les02-ntr-176-181-186-101.sfr.lns.abo.bbox.fr [176.181.186.101]) (Authenticated sender: brice@waegenei.re) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id EE9CC240003; Thu, 4 Mar 2021 06:58:01 +0000 (UTC) From: Brice Waegeneire Date: Thu, 4 Mar 2021 07:57:54 +0100 Message-Id: <20210304065754.18619-3-brice@waegenei.re> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210304065754.18619-1-brice@waegenei.re> References: <87czx06ubt.fsf@waegenei.re> <20210304065754.18619-1-brice@waegenei.re> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1614841162; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=TZYE45CJACZww8nRKDO3NT4iE9iigNscxu74+hezJaI=; b=hMUmQ9Ex5P/cdddXaLPJ2BJwmpxe9v1WWalkt/5HqRdklELzIxM2bbKjcc+/49MCIRUvr9 bnb7i3PaQka4+QxVT4u4xtyjeG5B9cSq+z9y7FazNB1gQ+61RVn8/VtDDZh/QaWjoFPUCl X+ZdqxyJfkoOf2bzJeWvvUGpiZAm+L552vXToHbspfhO2ZOqkiFpudCqogD2O6b918bg4G v360vbjOH0a78qzvBTL0+1okLkT1ITK9npYdXv4mtEBmHpC6tOx36WoE/Lt7Y88GuouEmN e+JKNp6AwMfHT+imf6mpDnqbewTbKeVj6Dbz9Qn6TlUCo2i67dnp4ShUWtJX4w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1614841162; a=rsa-sha256; cv=none; b=TvfgLvB1cQLWjDNi+f9IU0G2TvQnqesbXTY3xsxekRCV9pJ9hvqHj6Gh9vjOpAvCbMFvI4 GnyMJ7eSY9AHnLOmI/Fo1PArl42+a+pCYSVgZEStA/eEhiTu+pMb3H3Vkjw35f0EfoM4/L fGnsST5dQeC4ww9b2W/15F6n1lVpibdxhBDQdrTiBRmzG/FWwQHD8rl3CqEapaPoKN/y7i 9ac3AFthGJpBHMFQ9hg3x/r51Ut04S9v2nHTMUbtofFPHiPdMpF+LSFx4hNrEgPrwEgN74 rclNUlHg+R5ObNV+ViX+QUltY84KctIevZAt3dcxdlOPVN5Fa2TqLfkKf/Hm4g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -1.36 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: ED9E81AC6D X-Spam-Score: -1.36 X-Migadu-Scanner: scn0.migadu.com X-TUID: rcH7Bi4X1/qJ Fixes . * guix/scripts/system.scm (switch-to-system-generation): Load the activate script for that generation. squash! scripts: system: Activate system when switching generations. --- guix/scripts/system.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index e3cf99acc6..c226f08371 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2020 Julien Lepiller ;;; Copyright © 2020 Efraim Flashner +;;; Copyright © 2021 Brice Waegeneire ;;; ;;; This file is part of GNU Guix. ;;; @@ -363,11 +364,14 @@ connection to the store." "Switch the system profile to the generation specified by SPEC, and re-install bootloader with a configuration file that uses the specified system generation as its default entry. STORE is an open connection to the store." - (let ((number (relative-generation-spec->number %system-profile spec))) + (let* ((number (relative-generation-spec->number %system-profile spec)) + (generation (generation-file-name %system-profile number)) + (activate (string-append generation "/activate"))) (if number (begin (reinstall-bootloader store number) - (switch-to-generation* %system-profile number)) + (switch-to-generation* %system-profile number) + (unless-file-not-found (primitive-load activate))) (leave (G_ "cannot switch to system generation '~a'~%") spec)))) (define* (system-bootloader-name #:optional (system %system-profile)) -- 2.30.1