unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: 30303@debbugs.gnu.org
Subject: [bug#30303] [PATCH] linux-boot: Add find-long-options.
Date: Wed, 31 Jan 2018 13:29:33 +0100	[thread overview]
Message-ID: <20180131122933.6051-1-dannym@scratchpost.org> (raw)

* gnu/build/linux/boot.scm (find-long-options): New variable.
---
 gnu/build/linux-boot.scm | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm
index 0ab8391b0..b88ce6b99 100644
--- a/gnu/build/linux-boot.scm
+++ b/gnu/build/linux-boot.scm
@@ -37,6 +37,7 @@
   #:export (mount-essential-file-systems
             linux-command-line
             find-long-option
+            find-long-options
             make-essential-device-nodes
             make-static-device-nodes
             configure-qemu-networking
@@ -99,6 +100,18 @@ Return the value associated with OPTION, or #f on failure."
            (lambda (arg)
              (substring arg (+ 1 (string-index arg #\=)))))))
 
+(define (find-long-options option arguments)
+  "Find OPTIONs among ARGUMENTS, where OPTION is something like \"console\".
+Return the values associated with OPTIONs as a list, or the empty list on
+failure."
+  (let ((opt (string-append option "=")))
+    (map (lambda (arg)
+           (substring arg (+ 1 (string-index arg #\=))))
+         (filter
+           (lambda (arg)
+             (string-prefix? opt arg))
+         arguments))))
+
 (define* (make-disk-device-nodes base major #:optional (minor 0))
   "Make the block device nodes around BASE (something like \"/root/dev/sda\")
 with the given MAJOR number, starting with MINOR."

             reply	other threads:[~2018-01-31 12:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-31 12:29 Danny Milosavljevic [this message]
2018-01-31 22:41 ` [bug#30303] [PATCH] linux-boot: Add find-long-options Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180131122933.6051-1-dannym@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=30303@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).