From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egrWn-0004ZP-DC for guix-patches@gnu.org; Wed, 31 Jan 2018 07:30:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egrWd-0008IE-Q6 for guix-patches@gnu.org; Wed, 31 Jan 2018 07:30:13 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:42471) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1egrWd-0008I8-La for guix-patches@gnu.org; Wed, 31 Jan 2018 07:30:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1egrWd-0005OL-8Y for guix-patches@gnu.org; Wed, 31 Jan 2018 07:30:03 -0500 Subject: [bug#30303] [PATCH] linux-boot: Add find-long-options. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egrWK-0004SP-4U for guix-patches@gnu.org; Wed, 31 Jan 2018 07:29:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egrWF-0008C6-Vy for guix-patches@gnu.org; Wed, 31 Jan 2018 07:29:44 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:50696) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1egrWF-0008BX-Pc for guix-patches@gnu.org; Wed, 31 Jan 2018 07:29:39 -0500 From: Danny Milosavljevic Date: Wed, 31 Jan 2018 13:29:33 +0100 Message-Id: <20180131122933.6051-1-dannym@scratchpost.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 30303@debbugs.gnu.org * 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."