[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
23/197: installer: Use a cleaner way of generating the lspci information
From: |
Danny Milosavljevic |
Subject: |
23/197: installer: Use a cleaner way of generating the lspci information. |
Date: |
Mon, 3 Jul 2017 20:36:53 -0400 (EDT) |
dannym pushed a commit to branch wip-installer-2
in repository guix.
commit 703c92e814b23ef0da63e46fb1dea1bb9636e243
Author: John Darrington <address@hidden>
Date: Sat Dec 24 10:57:45 2016 +0100
installer: Use a cleaner way of generating the lspci information.
* gnu/system/installer/network.scm (network-page-init): Clean up
implementation.
---
gnu/system/installer/network.scm | 40 +++++++++++++++++++---------------------
1 file changed, 19 insertions(+), 21 deletions(-)
diff --git a/gnu/system/installer/network.scm b/gnu/system/installer/network.scm
index 4e3abd6..61af33b 100644
--- a/gnu/system/installer/network.scm
+++ b/gnu/system/installer/network.scm
@@ -147,27 +147,25 @@
;; something more descriptive like
;; "82567LM Gigabit Network Connection"
(let* ((name (assq-ref datum 'name))
- (addr (string-tokenize name char-set:digit))
- (bus (match addr ((n . _)
- (string->number n 10))))
-
- (device (match addr ((_ . (n . _))
- (string->number n 10))))
-
- (func (match addr
- ((_ . (_ . (n . _)))
- (string->number n 10)) (_ 0))))
- (car (assoc-ref
- (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:")))))))
+ (addr (string-tokenize name char-set:digit)))
+ (match addr
+ ((bus device . func)
+ (car (assoc-ref
+ (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"
+ (string->number bus 10)
+ (string->number device 10)
+ (if (null? func) 0
+ (string->number func 10)))
+ (lambda (x)
+ (string-split x #\tab))))
+ "Device:")))))))))
(addstr* text-window (format #f
- 42/197: installer: Wrap installer in (catch #t ...), (continued)
- 42/197: installer: Wrap installer in (catch #t ...), Danny Milosavljevic, 2017/07/03
- 48/197: installer: Close unused ports in pipe-cmd., Danny Milosavljevic, 2017/07/03
- 47/197: installer: Improve install page., Danny Milosavljevic, 2017/07/03
- 29/197: installer: Add a task to actually call guix system init., Danny Milosavljevic, 2017/07/03
- 53/197: installer: Change N_ from a procedure to a macro., Danny Milosavljevic, 2017/07/03
- 50/197: installer: Issue message to user on failure of filesystems task., Danny Milosavljevic, 2017/07/03
- 61/197: installer: Indicate which wireless access points are encrypted., Danny Milosavljevic, 2017/07/03
- 59/197: installer: Format configuration to fix width of window., Danny Milosavljevic, 2017/07/03
- 65/197: installer: Ensure that all mount points are absolute paths., Danny Milosavljevic, 2017/07/03
- 09/197: installer: Use a record instead of a list to contain tasks., Danny Milosavljevic, 2017/07/03
- 23/197: installer: Use a cleaner way of generating the lspci information.,
Danny Milosavljevic <=
- 35/197: installer: New predicate valid-hostname?, Danny Milosavljevic, 2017/07/03
- 36/197: installer: Ensure that all mount-points have a file system., Danny Milosavljevic, 2017/07/03
- 39/197: installer: Replace an instance of cdr with match., Danny Milosavljevic, 2017/07/03
- 46/197: installer: Replace "%temporary-configuration-file-port" with "config-file"., Danny Milosavljevic, 2017/07/03
- 30/197: installer: Write the configuration to a temporary file., Danny Milosavljevic, 2017/07/03
- 24/197: installer: Add a new menu to configure wireless interfaces., Danny Milosavljevic, 2017/07/03
- 49/197: installer: Replace spawned mount command with the mount syscall., Danny Milosavljevic, 2017/07/03
- 44/197: installer: Use consistent window heights., Danny Milosavljevic, 2017/07/03
- 52/197: installer: Prevent the user specifying the same mount point twice., Danny Milosavljevic, 2017/07/03
- 51/197: installer: Allow users to remove mount points during configuration., Danny Milosavljevic, 2017/07/03