From patchwork Mon Jul 8 19:52:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jakob L. Kreuze" X-Patchwork-Id: 14538 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 7FA5E171E0; Mon, 8 Jul 2019 20:53:11 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id E9874171DD for ; Mon, 8 Jul 2019 20:53:10 +0100 (BST) Received: from localhost ([::1]:44382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkZhF-0004e1-IK for patchwork@mira.cbaines.net; Mon, 08 Jul 2019 15:53:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42466) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkZhB-0004cK-8S for guix-patches@gnu.org; Mon, 08 Jul 2019 15:53:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkZhA-0001Hp-7r for guix-patches@gnu.org; Mon, 08 Jul 2019 15:53:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50783) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hkZhA-0001Hj-4q for guix-patches@gnu.org; Mon, 08 Jul 2019 15:53:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hkZh8-00047q-BP for guix-patches@gnu.org; Mon, 08 Jul 2019 15:53:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36555] [PATCH 0/2] Refactor out common behavior for system reconfiguration. Resent-From: zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 08 Jul 2019 19:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36555 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 36555@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.156261554815809 (code B ref -1); Mon, 08 Jul 2019 19:53:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Jul 2019 19:52:28 +0000 Received: from localhost ([127.0.0.1]:59604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkZga-00046v-F7 for submit@debbugs.gnu.org; Mon, 08 Jul 2019 15:52:28 -0400 Received: from lists.gnu.org ([209.51.188.17]:43322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkZgX-00046k-OR for submit@debbugs.gnu.org; Mon, 08 Jul 2019 15:52:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42356) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkZgV-0004Y2-Pw for guix-patches@gnu.org; Mon, 08 Jul 2019 15:52:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkZgT-00018N-JR for guix-patches@gnu.org; Mon, 08 Jul 2019 15:52:23 -0400 Received: from mx.sdf.org ([205.166.94.20]:60162) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hkZgS-000174-Lj for guix-patches@gnu.org; Mon, 08 Jul 2019 15:52:21 -0400 Received: from Upsilon (mobile-166-171-186-40.mycingular.net [166.171.186.40]) (authenticated (0 bits)) by mx.sdf.org (8.15.2/8.14.5) with ESMTPSA id x68JqGPE004411 (using TLSv1.2 with cipher AES256-GCM-SHA384 (256 bits) verified NO) for ; Mon, 8 Jul 2019 19:52:18 GMT From: zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) Date: Mon, 08 Jul 2019 15:52:12 -0400 Message-ID: <87imsci9sj.fsf@sdf.lonestar.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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 Hello, Guix! This is the preliminary version of a patch series to turn the behavior common between 'guix deploy' and 'guix system reconfigure' into a module that both can use. I am submitting it as-is both for comments and for tracking the refactoring effort. Note that this is _not_ ready to be merged. There are several things that I need to do before I would consider it ready for upstream Guix: - This passes my old test suite for 'guix deploy', but I haven't dared to run the new 'guix system reconfigure'. I'll set up a new virtual machine so I don't put myself out of a working laptop. - 'switch-system-program', 'upgrade-services-program', and 'install-bootloader-program' omit some of the features that were present in the procedures they replace. For example, 'install-bootloader' previously supported installing the bootloader configuration without actually running the installation script. This was fine for 'guix deploy', but I'll need to add it back in for 'guix system reconfigure'. - I plan to implement system tests for '(guix scripts system reconfigure)'. I suppose I can always submit them as a separate patch, but I'll likely finish them before we're through with code review, so it may make sense to include them with as part of this patch series, albeit as a distinct commit. - I suspect that some of the effectful procedures in 'system.scm' could be refactored out in a similar fashion. Not that 'guix deploy' would necessarily be using them, but it would be more consistent to have them as 'program-file' objects, and those procedures could then also be tested. I look forward to your comments. Regards, Jakob Jakob L. Kreuze (2): guix system: Add 'reconfigure' module. guix system: Reimplement 'reconfigure'. Makefile.am | 1 + gnu/machine/ssh.scm | 235 ++++++++-------------------- guix/scripts/system.scm | 140 +++++------------ guix/scripts/system/reconfigure.scm | 158 +++++++++++++++++++ 4 files changed, 255 insertions(+), 279 deletions(-) create mode 100644 guix/scripts/system/reconfigure.scm --- 2.22.0