From patchwork Wed Oct 30 14:30:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Janneke Nieuwenhuizen X-Patchwork-Id: 69647 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 4AC9027BBE2; Wed, 30 Oct 2024 14:35:25 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED 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 1870227BBEA for ; Wed, 30 Oct 2024 14:35:23 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t69n8-00039Q-3t; Wed, 30 Oct 2024 10:35:22 -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 1t69mu-0002pW-0D for guix-patches@gnu.org; Wed, 30 Oct 2024 10:35:10 -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 1t69mp-0003tU-73; Wed, 30 Oct 2024 10:35:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=hH3yNAhUyHMSo8d06nb5LU0qNi+QM2cJadabsvH0PmU=; b=Ntw0AQDCVBhvxZ65gbVyq8ysqZN1+wdXHVkIQaQakLm7ngBEbfT2OBPl57q/W9YU6Ff3g/aYqBlLy5OtPVroNYh3N/2zUCEEDAJBhhXxFTUxPzus3gdkNFJI9p7k/hIGFyf5Jln9wJzV+59gab2l3vpodAPvoaZmg9XZEW9MSdydhM4xvGGthgVI1Iy5FeihQZvLGQnXxltqX0ENuIWIXMFNIwtQt9aFITgEtoNPFeL/volKrjp2ptwfS5qY0iDZzsdsDxjf/Sxn8lilikSdpjQBDjXQzYaGfOwuLxxhmK24RoiuwjDTtQYO/MHdrpurSWZ17OfX8bv86Ey+2pV+mg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t69mp-000413-1H; Wed, 30 Oct 2024 10:35:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73927] [PATCH v4 15/18] installer: Add dry-run? Resent-From: Janneke Nieuwenhuizen Original-Sender: "Debbugs-submit" Resent-CC: dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, guix-patches@gnu.org Resent-Date: Wed, 30 Oct 2024 14:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73927 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73927@debbugs.gnu.org Cc: Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe X-Debbugs-Original-Xcc: Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe Received: via spool by 73927-submit@debbugs.gnu.org id=B73927.173029885515371 (code B ref 73927); Wed, 30 Oct 2024 14:35:02 +0000 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:34:15 +0000 Received: from localhost ([127.0.0.1]:35382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69m2-0003zm-JU for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:34:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69li-0003wD-1S for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69jX-0003O4-7e; Wed, 30 Oct 2024 10:31:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=hH3yNAhUyHMSo8d06nb5LU0qNi+QM2cJadabsvH0PmU=; b=PEXSlk3BPgywLCEw2hk/ rNNekVWjjYH0GwhADc8W3iN2q1NuCV+AP1Bi1EurxpWu7S9MmbAwlxfcQcoFX3ZxKvO/9020HYdyE unwTUndIIBjDnp++pnANBDOY/r91Ukv1vspscNr8CKdA8S/pT1/CAFgcq7rjGt8F+cxM8TziFeOd3 YHyjkZgw1fuxlpRkHyYh46I1UrXP4UZ8SaMkfr4w4q0iDAGq7FxjtvDaGJmi253HnKhdioxO6hU5w AGSEq85iqiCdD9pRvWMfArzeGjJyVvEFI6aVx2kcm6CHCVBR2TYtE/WaHn6ICQdyzRz+gG+5QxUam ZIrG2LmCVtSO0g==; From: Janneke Nieuwenhuizen Date: Wed, 30 Oct 2024 15:30:44 +0100 Message-ID: <8f8ac43e07951ab068ed7ad52baf8424090cf8fa.1730296564.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches This allows running the installer without root privileges. Do something like ./pre-inst-env guix repl ,use (guix) ,use (gnu installer) (installer-program #:dry-run? #t) ,build $1 => "/gnu/store/...-installer-program" and run /gnu/store/...-installer-program * gnu/installer/newt.scm (locale-page): Add #:dry-run? parameter. (keymap-page): Likewise. * gnu/installer/newt/keymap.scm (run-keymap-page): Likewise. * gnu/installer/steps.scm (run-installer-steps): Likewise. Use it to skip writing to socket. * gnu/installer/newt/final.scm (run-final-page): Rename to... (run-final-page-install): ...this. (dry-run-final-page, run-final-page): New procedures. * gnu/installer/parted.scm (bootloader-configuration): Cater for empty user partitions. * gnu/installer/utils.scm (dry-run-command): New procedure. * gnu/installer.scm (compute-locale-step): Add #:dry-run? parameter. Use it to avoid actually applying locale. (compute-keymap-step): Add dry-run? parameter. Pass it to keymap-page. (installer-program): Add #:dry-run? parameter. If #:true avoid writing to /proc, use dry-run-command, skip sync and reboot, and pass dry-run? to... (installer-steps): ...here. Add #:dry-run? parameter. Use it to disable skip network, substitutes, partitioning pages, and pass it to... compute-locale-step, compute-keymap-step, and final-page. Change-Id: I0ff4c3b0a0c69539af617c27ba37654beed44619 --- gnu/installer.scm | 81 ++++++++++++++++++++------------ gnu/installer/newt.scm | 14 +++--- gnu/installer/newt/final.scm | 20 +++++++- gnu/installer/newt/keymap.scm | 5 +- gnu/installer/newt/locale.scm | 6 ++- gnu/installer/newt/partition.scm | 1 + gnu/installer/parted.scm | 29 +++++++----- gnu/installer/steps.scm | 16 +++++-- gnu/installer/utils.scm | 4 ++ 9 files changed, 116 insertions(+), 60 deletions(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index 21809e4259..39a83c4455 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -134,7 +134,8 @@ (define apply-locale (define* (compute-locale-step #:key locales-name iso639-languages-name - iso3166-territories-name) + iso3166-territories-name + dry-run?) "Return a gexp that run the locale-page of INSTALLER, and install the selected locale. The list of locales, languages and territories passed to locale-page are computed in derivations named respectively LOCALES-NAME, @@ -177,8 +178,11 @@ (define* (compute-locale-step #:key ((installer-locale-page current-installer) #:supported-locales #$locales-loader #:iso639-languages #$iso639-loader - #:iso3166-territories #$iso3166-loader))) - (#$apply-locale result) + #:iso3166-territories #$iso3166-loader + #:dry-run? #$dry-run?))) + (if #$dry-run? + '() + (#$apply-locale result)) result)))) (define apply-keymap @@ -188,7 +192,7 @@ (define apply-keymap (kmscon-update-keymap (default-keyboard-model) layout variant options)))) -(define* (compute-keymap-step context) +(define (compute-keymap-step context dry-run?) "Return a gexp that runs the keymap-page of INSTALLER and install the selected keymap." #~(lambda (current-installer) @@ -200,15 +204,16 @@ (define* (compute-keymap-step context) "/share/X11/xkb/rules/base.xml"))) (lambda (models layouts) ((installer-keymap-page current-installer) - layouts '#$context))))) + layouts '#$context #$dry-run?))))) (and result (#$apply-keymap result)) result))) -(define (installer-steps) +(define* (installer-steps #:key dry-run?) (let ((locale-step (compute-locale-step #:locales-name "locales" #:iso639-languages-name "iso639-languages" - #:iso3166-territories-name "iso3166-territories")) + #:iso3166-territories-name "iso3166-territories" + #:dry-run? dry-run?)) (timezone-data #~(string-append #$tzdata "/share/zoneinfo/zone.tab"))) #~(lambda (current-installer) @@ -216,7 +221,7 @@ (define (installer-steps) (lambda () ((installer-parameters-page current-installer) (lambda _ - (#$(compute-keymap-step 'param) + (#$(compute-keymap-step 'param dry-run?) current-installer))))) (list ;; Ask the user to choose a locale among those supported by @@ -262,8 +267,10 @@ (define (installer-steps) (id 'keymap) (description (G_ "Keyboard mapping selection")) (compute (lambda _ - (#$(compute-keymap-step 'default) - current-installer))) + (if #$dry-run? + '("en" "US" #f) + (#$(compute-keymap-step 'default dry-run?) + current-installer)))) (configuration-formatter keyboard-layout->configuration)) ;; Ask the user to input a hostname for the system. @@ -280,14 +287,18 @@ (define (installer-steps) (id 'network) (description (G_ "Network selection")) (compute (lambda _ - ((installer-network-page current-installer))))) + (if #$dry-run? + '() + ((installer-network-page current-installer)))))) ;; Ask whether to enable substitute server discovery. (installer-step (id 'substitutes) (description (G_ "Substitute server discovery")) (compute (lambda _ - ((installer-substitutes-page current-installer))))) + (if #$dry-run? + '() + ((installer-substitutes-page current-installer)))))) ;; Prompt for users (name, group and home directory). (installer-step @@ -313,7 +324,9 @@ (define (installer-steps) (id 'partition) (description (G_ "Partitioning")) (compute (lambda _ - ((installer-partitioning-page current-installer)))) + (if #$dry-run? + '() + ((installer-partitioning-page current-installer))))) (configuration-formatter user-partitions->configuration)) (installer-step @@ -322,7 +335,7 @@ (define (installer-steps) (compute (lambda (result prev-steps) ((installer-final-page current-installer) - result prev-steps)))))))) + result prev-steps #$dry-run?)))))))) (define (provenance-sexp) "Return an sexp representing the currently-used channels, for logging @@ -343,7 +356,7 @@ (define (provenance-sexp) `(channel ,(channel-name channel) ,url ,(channel-commit channel)))) channels)))) -(define (installer-program) +(define* (installer-program #:key dry-run?) "Return a file-like object that runs the given INSTALLER." (define init-gettext ;; Initialize gettext support, so that installer messages can be @@ -377,7 +390,7 @@ (define (installer-program) (lambda () (set-path-environment-variable "PATH" '("bin" "sbin") inputs))))) - (define steps (installer-steps)) + (define steps (installer-steps #:dry-run? dry-run?)) (define modules (scheme-modules* (string-append (current-source-directory) "/..") @@ -425,9 +438,10 @@ (define (installer-program) ;; Enable core dump generation. (setrlimit 'core #f #f) - (call-with-output-file "/proc/sys/kernel/core_pattern" - (lambda (port) - (format port %core-dump))) + (unless #$dry-run? + (call-with-output-file "/proc/sys/kernel/core_pattern" + (lambda (port) + (format port %core-dump)))) ;; Initialize gettext support so that installers can use ;; (guix i18n) module. @@ -466,24 +480,29 @@ (define (installer-program) (lambda () (parameterize ((%run-command-in-installer - (installer-run-command current-installer))) + (if #$dry-run? + dry-run-command + (installer-run-command current-installer)))) (catch #t (lambda () (define results (run-installer-steps #:rewind-strategy 'menu #:menu-proc (installer-menu-page current-installer) - #:steps steps)) - - (match (result-step results 'final) - ('success - ;; We did it! Let's reboot! - (sync) - (stop-service 'root)) - (_ - ;; The installation failed, exit so that it is - ;; restarted by login. - #f))) + #:steps steps + #:dry-run? #$dry-run?)) + + (let ((result (result-step results 'final))) + (unless #$dry-run? + (match (result-step results 'final) + ('success + ;; We did it! Let's reboot! + (sync) + (stop-service 'root)) + (_ + ;; The installation failed, exit so that it is + ;; restarted by login. + #f))))) (const #f) (lambda (key . args) (installer-log-line "crashing due to uncaught exception: ~s ~s" diff --git a/gnu/installer/newt.scm b/gnu/installer/newt.scm index 6d8ea35fff..d53bc058b3 100644 --- a/gnu/installer/newt.scm +++ b/gnu/installer/newt.scm @@ -158,17 +158,19 @@ (define (newt-run-command . args) (term-signal term-sig) (stop-signal stop-sig))))))))))) -(define (final-page result prev-steps) - (run-final-page result prev-steps)) +(define (final-page result prev-steps dry-run?) + (run-final-page result prev-steps dry-run?)) (define* (locale-page #:key supported-locales iso639-languages - iso3166-territories) + iso3166-territories + dry-run?) (run-locale-page #:supported-locales supported-locales #:iso639-languages iso639-languages - #:iso3166-territories iso3166-territories)) + #:iso3166-territories iso3166-territories + #:dry-run? dry-run?)) (define (timezone-page zonetab) (run-timezone-page zonetab)) @@ -179,8 +181,8 @@ (define* (welcome-page logo #:key pci-database) (define (menu-page steps) (run-menu-page steps)) -(define* (keymap-page layouts context) - (run-keymap-page layouts #:context context)) +(define (keymap-page layouts context dry-run?) + (run-keymap-page layouts #:context context #:dry-run? dry-run?)) (define (network-page) (run-network-page)) diff --git a/gnu/installer/newt/final.scm b/gnu/installer/newt/final.scm index 9f950a0551..c4e53f6d79 100644 --- a/gnu/installer/newt/final.scm +++ b/gnu/installer/newt/final.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2020 Mathieu Othacehe ;;; Copyright © 2019, 2020 Ludovic Courtès +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -106,7 +107,7 @@ (define* (run-install-shell locale (newt-resume) install-ok?)) -(define (run-final-page result prev-steps) +(define (run-final-page-install result prev-steps) (define (wait-for-clients) (unless (null? (current-clients)) (installer-log-line "waiting with clients before starting final step") @@ -133,3 +134,20 @@ (define (run-final-page result prev-steps) (if install-ok? (run-install-success-page) (run-install-failed-page)))) + +(define (dry-run-final-page result prev-steps) + (installer-log-line "proceeding with final step -- dry-run") + (let* ((configuration (format-configuration prev-steps result)) + (user-partitions (result-step result 'partition)) + (locale (result-step result 'locale)) + (users (result-step result 'user)) + (file (configuration->file configuration)) + (install-ok? (run-config-display-page #:locale locale))) + (if install-ok? + (run-install-success-page) + (run-install-failed-page)))) + +(define (run-final-page result prev-steps dry-run?) + (if dry-run? + (dry-run-final-page result prev-steps) + (run-final-page-install result prev-steps))) diff --git a/gnu/installer/newt/keymap.scm b/gnu/installer/newt/keymap.scm index 109ec55e0a..57f6d6530c 100644 --- a/gnu/installer/newt/keymap.scm +++ b/gnu/installer/newt/keymap.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2018, 2020 Mathieu Othacehe ;;; Copyright © 2019 Ludovic Courtès ;;; Copyright © 2020 Florian Pelz +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -153,7 +154,7 @@ (define (toggleable-latin-layout layout variant) "grp:alt_shift_toggle")) (list layout variant #f))) -(define* (run-keymap-page layouts #:key (context #f)) +(define* (run-keymap-page layouts #:key context dry-run?) "Run a page asking the user to select a keyboard layout and variant. LAYOUTS is a list of supported X11-KEYMAP-LAYOUT. For non-Latin keyboard layouts, a second layout and toggle options will be added automatically. Return a list @@ -201,7 +202,7 @@ (define* (run-keymap-page layouts #:key (context #f)) "xkeyboard-config"))))) (toggleable-latin-layout layout variant))) - (let* ((result (run-installer-steps #:steps keymap-steps)) + (let* ((result (run-installer-steps #:steps keymap-steps #:dry-run? dry-run?)) (layout (result-step result 'layout)) (variant (result-step result 'variant))) (and layout diff --git a/gnu/installer/newt/locale.scm b/gnu/installer/newt/locale.scm index a226b39ba6..0be9db449e 100644 --- a/gnu/installer/newt/locale.scm +++ b/gnu/installer/newt/locale.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Mathieu Othacehe ;;; Copyright © 2019 Ludovic Courtès +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -92,7 +93,8 @@ (define (run-modifier-page modifiers modifier->text) (define* (run-locale-page #:key supported-locales iso639-languages - iso3166-territories) + iso3166-territories + dry-run?) "Run a page asking the user to select a locale language and possibly territory, codeset and modifier. Use SUPPORTED-LOCALES as the list of glibc available locales. ISO639-LANGUAGES is an association list associating a @@ -212,4 +214,4 @@ (define* (run-locale-page #:key ;; step, turn the result into a glibc locale string and return it. (result->locale-string supported-locales - (run-installer-steps #:steps locale-steps))) + (run-installer-steps #:steps locale-steps #:dry-run? dry-run?))) diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm index 37656696c1..48dd306080 100644 --- a/gnu/installer/newt/partition.scm +++ b/gnu/installer/newt/partition.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2018, 2019, 2022 Mathieu Othacehe ;;; Copyright © 2019, 2020 Ludovic Courtès ;;; Copyright © 2020 Tobias Geerinckx-Rice +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index e59df3d8e6..b36b238d8b 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -1461,19 +1461,22 @@ (define (root-user-partition? partition) (define (bootloader-configuration user-partitions) "Return the bootloader configuration field for USER-PARTITIONS." - (let* ((root-partition (find root-user-partition? - user-partitions)) - (root-partition-disk (user-partition-disk-file-name root-partition))) - `((bootloader-configuration - ,@(if (efi-installation?) - `((bootloader grub-efi-bootloader) - (targets (list ,(default-esp-mount-point)))) - `((bootloader grub-bootloader) - (targets (list ,root-partition-disk)))) - - ;; XXX: Assume we defined the 'keyboard-layout' field of - ;; right above. - (keyboard-layout keyboard-layout))))) + (let ((root-partition (find root-user-partition? user-partitions))) + (match user-partitions + (() '()) + (_ + (let ((root-partition-disk (user-partition-disk-file-name + root-partition))) + `((bootloader-configuration + ,@(if (efi-installation?) + `((bootloader grub-efi-bootloader) + (targets (list ,(default-esp-mount-point)))) + `((bootloader grub-bootloader) + (targets (list ,root-partition-disk)))) + + ;; XXX: Assume we defined the 'keyboard-layout' field of + ;; right above. + (keyboard-layout keyboard-layout)))))))) (define (user-partition-missing-modules user-partitions) "Return the list of kernel modules missing from the default set of kernel diff --git a/gnu/installer/steps.scm b/gnu/installer/steps.scm index 0c505e40e4..de0a852f02 100644 --- a/gnu/installer/steps.scm +++ b/gnu/installer/steps.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2019 Mathieu Othacehe ;;; Copyright © 2020-2022 Ludovic Courtès +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -84,7 +85,8 @@ (define-record-type* (define* (run-installer-steps #:key steps (rewind-strategy 'previous) - (menu-proc (const #f))) + (menu-proc (const #f)) + dry-run?) "Run the COMPUTE procedure of all records in STEPS sequentially, inside a the 'installer-step prompt. When aborted to with a parameter of 'abort, fallback to a previous install-step, accordingly to the @@ -191,10 +193,14 @@ (define* (run-installer-steps #:key ;; prematurely. (sigaction SIGPIPE SIG_IGN) - (with-server-socket - (run '() - #:todo-steps steps - #:done-steps '()))) + (if dry-run? + (run '() + #:todo-steps steps + #:done-steps '()) + (with-server-socket + (run '() + #:todo-steps steps + #:done-steps '())))) (define (find-step-by-id steps id) "Find and return the step in STEPS whose id is equal to ID." diff --git a/gnu/installer/utils.scm b/gnu/installer/utils.scm index 170f036537..a8eb6cee83 100644 --- a/gnu/installer/utils.scm +++ b/gnu/installer/utils.scm @@ -49,6 +49,7 @@ (define-module (gnu installer utils) run-external-command-with-handler run-external-command-with-handler/tty run-external-command-with-line-hooks + dry-run-command run-command %run-command-in-installer @@ -222,6 +223,9 @@ (define* (run-command command #:key (tty? #f)) (pause) succeeded?) +(define (dry-run-command . args) + (format #t "dry-run-command: skipping: ~a\n" args)) + (define %run-command-in-installer (make-parameter (lambda (. args)