[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))))))
- branch wip-installer updated (704f546 -> d654694), John Darrington, 2016/12/27
- 01/22: installer: Return slurped lines in their correct order.,
John Darrington <=
- 15/22: installer: Remove ad-hoc completed predicate and use standard one., John Darrington, 2016/12/27
- 02/22: installer: Fix incorrect host in ping task., John Darrington, 2016/12/27
- 06/22: installer: Connect ethernet interfaces on selection., John Darrington, 2016/12/27
- 14/22: installer: Make minumum-store-size variable global., John Darrington, 2016/12/27
- 04/22: installer: Use a cleaner way of generating the lspci information., John Darrington, 2016/12/27
- 16/22: installer: Improve dependencies on the final task., John Darrington, 2016/12/27
- 22/22: gnu: Add guix to the path environment for the guix-installer service., John Darrington, 2016/12/27
- 09/22: installer: Add a variable to represent the minimum recommended store size., John Darrington, 2016/12/27
- 17/22: installer: Replace some instances of "car"., John Darrington, 2016/12/27
- 20/22: install: Define new procedure pipe-cmd and use it to implement window-pipe., John Darrington, 2016/12/27