guix-commits
[Top][All Lists]
Advanced

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

01/22: installer: Return slurped lines in their correct order.


From: John Darrington
Subject: 01/22: installer: Return slurped lines in their correct order.
Date: Tue, 27 Dec 2016 06:02:08 +0000 (UTC)

jmd pushed a commit to branch wip-installer
in repository guix.

commit 7d3808abf8665314a7407a9520cc44142fdf33d0
Author: John Darrington <address@hidden>
Date:   Fri Dec 23 08:26:14 2016 +0100

    installer: Return slurped lines in their correct order.
    
    * gnu/system/installer/network.scm (network-page-init): Remove first member 
from
    lspci results.
    * gnu/system/installer/utils.scm (slurp-real): Reverse the list before 
returning.
---
 gnu/system/installer/network.scm |   12 +++++++++---
 gnu/system/installer/utils.scm   |    2 +-
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/gnu/system/installer/network.scm b/gnu/system/installer/network.scm
index ab8add3..da8d959 100644
--- a/gnu/system/installer/network.scm
+++ b/gnu/system/installer/network.scm
@@ -151,9 +151,15 @@
                                 ((_ . (_ . (n . _)))
                                  (string->number n 10)) (_ 0))))
                    (car (assoc-ref
-                         (slurp (format #f "lspci -vm -s~x:~x.~x" bus device 
func)
-                                (lambda (x)
-                                  (string-split x #\tab)))
+                          (cdr
+                           ;; It seems that lspci always prints an initial
+                           ;; "Device: <bus>:<device>.<func> line.  We are not
+                           ;; interested in this, and it conflicts with the 
"real"
+                           ;; (descriptive) Device: line which we want.  Hence
+                           ;; the above cdr strips the first line away.
+                           (slurp (format #f "lspci -vm -s~x:~x.~x" bus device 
func)
+                                  (lambda (x)
+                                    (string-split x #\tab))))
                          "Device:")))))))
     
 
diff --git a/gnu/system/installer/utils.scm b/gnu/system/installer/utils.scm
index 3aa2bc8..5ea4964 100644
--- a/gnu/system/installer/utils.scm
+++ b/gnu/system/installer/utils.scm
@@ -178,7 +178,7 @@ which will process each string before returning it."
   (let lp ((line-list '()))
     (let  ((l (read-line port)))
       (if (eof-object? l)
-         line-list
+         (reverse line-list)
          (lp (cons (if proc (proc l) l) line-list))))))
 
 



reply via email to

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