From patchwork Mon Oct 21 08:17:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Janneke Nieuwenhuizen X-Patchwork-Id: 69248 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 3B0C227BBE9; Mon, 21 Oct 2024 09:19:04 +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=-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 AC7EC27BBE2 for ; Mon, 21 Oct 2024 09:19:01 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t2ncf-0000VS-6q; Mon, 21 Oct 2024 04:18:41 -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 1t2ncd-0000T3-7c for guix-patches@gnu.org; Mon, 21 Oct 2024 04:18:39 -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 1t2ncc-0003aE-U8; Mon, 21 Oct 2024 04:18:38 -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=z4dZ6KyAzFhF7tUzPFd3nYzp9ZEnAxoW67m1LqaIbwU=; b=UcSDIv59javEDPgtRGTSGbLPh9xcRlh6GeWtChIhfypDTOotnnEyFxhfwrxhroY+qkizNbGziCyqV6PL6qlk9UA2WORrwAbu16Ey1hTsvxntjZ02Vd3esj64t76HrDkTK+rzBNHB91vK7FyDyCwzLvHaUa+rL1xAvrLvvtePt+ubKBA2+mc7N/tZTc6nJIZAceE2/5VKsmc6indce542X3ki5Kgb73B95gqkHsWuL5oJKF4xz+Oyjfh78YtYUSuXsBIODh63RVCimot7++jbYs8sOJLXU13gDDPw9HuLwHbXMlyYJwYSJ/f9nV/gvbM5rR++WK0rVeDSdYGHV/CsTg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t2nd3-0003jv-2U; Mon, 21 Oct 2024 04:19:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73927] [PATCH 13/16] 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: Mon, 21 Oct 2024 08:19:05 +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.172949870014255 (code B ref 73927); Mon, 21 Oct 2024 08:19:05 +0000 Received: (at 73927) by debbugs.gnu.org; 21 Oct 2024 08:18:20 +0000 Received: from localhost ([127.0.0.1]:50037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2ncJ-0003hk-IP for submit@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36408) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2nc6-0003eY-Dy for 73927@debbugs.gnu.org; Mon, 21 Oct 2024 04:18:07 -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 1t2nba-0003TK-TT; Mon, 21 Oct 2024 04:17:34 -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=z4dZ6KyAzFhF7tUzPFd3nYzp9ZEnAxoW67m1LqaIbwU=; b=rHnMP6338BAZQ3zy0JJr M/lDCa5usLIlP+2Y2uebrl29fhQfZqzQg58/iUxq0CDroRU5c0w/xDAU/gqU15xZruf0e0LT03It6 pjFx0jvpVkGk8xSrMk+BT1V6J0FfBk787DyWmFhJ7ePxwaLIeo58ASzP8FiRRJpsWnxqHDLLCsplO W4+ugGqQo+KkUPj+02zleK11SykTKG9VLD759DtzAqIXGUSX5+w7+NiozvsPf2AlAVeG2TLfvK6dS YqiS3JRiHGWXptDLzSP05kAcEpDup0hNCPVt7U1Jv/D5BJ0bbGpjTSlKCliwODdUagXsWRP6Bo7kH GtUSy6vu4VcUXQ==; From: Janneke Nieuwenhuizen Date: Mon, 21 Oct 2024 10:17:09 +0200 Message-ID: <5c147111fed1208e96f5e54619ceefd5bfc073f8.1729494414.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)