From patchwork Tue Aug 2 21:44:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 41112 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 3AC1E27BBEB; Wed, 3 Aug 2022 00:19:17 +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.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 4B4D827BBE9 for ; Wed, 3 Aug 2022 00:19:09 +0100 (BST) Received: from localhost ([::1]:60418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oIzjD-0003WY-4p for patchwork@mira.cbaines.net; Tue, 02 Aug 2022 17:47:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44474) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIzhK-0001zI-WE for guix-patches@gnu.org; Tue, 02 Aug 2022 17:45:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55565) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oIzhK-0006R1-MV for guix-patches@gnu.org; Tue, 02 Aug 2022 17:45:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oIzhK-0003Ad-JK for guix-patches@gnu.org; Tue, 02 Aug 2022 17:45:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56898] [PATCH 12/13] installer: Render the final configuration with (guix read-print). Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 02 Aug 2022 21:45:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56898 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56898@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 56898-submit@debbugs.gnu.org id=B56898.165947668712053 (code B ref 56898); Tue, 02 Aug 2022 21:45:06 +0000 Received: (at 56898) by debbugs.gnu.org; 2 Aug 2022 21:44:47 +0000 Received: from localhost ([127.0.0.1]:45301 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIzh0-00038F-Rm for submit@debbugs.gnu.org; Tue, 02 Aug 2022 17:44:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59602) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIzgu-000364-W6 for 56898@debbugs.gnu.org; Tue, 02 Aug 2022 17:44:42 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55172) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIzgo-0006At-Nw; Tue, 02 Aug 2022 17:44: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=P3RQ1AuJWjp6RfoXgiAZa60MZewlUPiuWpxN5KGGu/E=; b=LTRWTmpDEhmwt+lgxvkC CsRJuipscQ/pELuggdSiLHaGwz8BXlGneT0kzB2RZKPFXf4TGqK7wZIPPBKqDQRb+FK5oCFbyTiou C3uAVMFa035JM4sx0FMQtJY8ccOo/etsgd8wl7UMI5hHSTTQj5dYi5w8F5sc2cL8ViPlQ/SRNZSPt fZvcyh30KjoeSmgmrdpRKrhW3F64vMcQx0BogHo5C2ZpLRazR5c1MyVUglBLpWsIHv9eZ8PiQTD/i F/CYUmCfGgv9L/uxT/5nbx+zj5ROkQnxxbfsCY2e+FDsK0iGjGwLtjlNMUgFK3KcjpveIaPm9Tmpc abBQhzIC346pYg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:52235 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oIzgo-0006W4-A6; Tue, 02 Aug 2022 17:44:34 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Tue, 2 Aug 2022 23:44:18 +0200 Message-Id: <20220802214419.19013-12-ludo@gnu.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220802214419.19013-1-ludo@gnu.org> References: <20220802214419.19013-1-ludo@gnu.org> 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" X-getmail-retrieved-from-mailbox: Patches * gnu/installer.scm (module-to-import?): Return #t for (guix read-print). * gnu/installer/steps.scm (configuration->file): Use 'pretty-print-with-comments/splice' instead of 'for-each' and 'pretty-print'. --- gnu/installer.scm | 3 ++- gnu/installer/steps.scm | 12 +++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index 415f5a7af7..8a6e604fa5 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2020 Mathieu Othacehe -;;; Copyright © 2019, 2020 Ludovic Courtès +;;; Copyright © 2019, 2020, 2022 Ludovic Courtès ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2020 Florian Pelz ;;; @@ -63,6 +63,7 @@ (define module-to-import? (('gnu 'installer _ ...) #t) (('gnu 'build _ ...) #t) (('guix 'build _ ...) #t) + (('guix 'read-print) #t) (_ #f))) (define not-config? diff --git a/gnu/installer/steps.scm b/gnu/installer/steps.scm index 8bc38181a7..f1d61a2bc5 100644 --- a/gnu/installer/steps.scm +++ b/gnu/installer/steps.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2019 Mathieu Othacehe -;;; Copyright © 2020, 2021 Ludovic Courtès +;;; Copyright © 2020-2022 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,9 +21,9 @@ (define-module (gnu installer steps) #:use-module (guix records) #:use-module (guix build utils) #:use-module (guix i18n) + #:use-module (guix read-print) #:use-module (gnu installer utils) #:use-module (ice-9 match) - #:use-module (ice-9 pretty-print) #:use-module (srfi srfi-1) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) @@ -244,11 +244,9 @@ (define* (configuration->file configuration ;; by the graphical installer.\n") port) (newline port) - (for-each (lambda (part) - (if (null? part) - (newline port) - (pretty-print part port))) - configuration) + (pretty-print-with-comments/splice port configuration + #:max-width 75) + (flush-output-port port)))) ;;; Local Variables: