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

commit 71d7ad5285ccdefaefab959ecdc335cb128179d4
Author: John Darrington <[email protected]>
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