guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: installer: Fix configuration edition during testi


From: guix-commits
Subject: branch master updated: installer: Fix configuration edition during testing.
Date: Sat, 24 Sep 2022 06:48:32 -0400

This is an automated email from the git hooks/post-receive script.

mothacehe pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new fe4663ae24 installer: Fix configuration edition during testing.
fe4663ae24 is described below

commit fe4663ae2476cb527d4f1f49ff8fa077d43f7251
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Sat Sep 24 12:42:21 2022 +0200

    installer: Fix configuration edition during testing.
    
    When the configuration is edited, it looks like there are some leftover
    fragments from the input configuration:
    
    Example content of config.scm after edition:
    
      #:imported-modules
      '((gnu services herd)
        (guix build utils)
        (guix combinators)))
    
    unted".  The unique
      ;; file system identifiers there ("UUIDs") can be obtained
      ;; by running 'blkid' in a terminal.
    
    ...
    
    This is strange because call-with-output-file uses the O_TRUNC flag which
    resets the file size to zero. Remove the configuration file before writing 
it
    as a work-around.
    
    * gnu/installer/tests.scm (edit-configuration-file): Remove the 
configuration
    file before re-writing it.
---
 gnu/installer/tests.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gnu/installer/tests.scm b/gnu/installer/tests.scm
index 3c049a1c85..82c3d3ee88 100644
--- a/gnu/installer/tests.scm
+++ b/gnu/installer/tests.scm
@@ -280,6 +280,10 @@ instrumented for further testing."
        exp)))
 
   (let ((content (call-with-input-file file read-expressions)))
+    ;; XXX: Remove the file before re-writing it, to be sure there are no
+    ;; leftovers.  We shouldn't have to to that as CALL-WITH-OUTPUT-FILE uses
+    ;; the O_TRUNC flag by default.
+    (delete-file file)
     (call-with-output-file file
       (lambda (port)
         (format port "\



reply via email to

[Prev in Thread] Current Thread [Next in Thread]