From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:60540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gn4xW-0005xJ-QJ for guix-patches@gnu.org; Fri, 25 Jan 2019 12:08:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gn4xW-0001Kh-4j for guix-patches@gnu.org; Fri, 25 Jan 2019 12:08:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:46215) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gn4xW-0001Kd-02 for guix-patches@gnu.org; Fri, 25 Jan 2019 12:08:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gn4xV-0000ip-Ns for guix-patches@gnu.org; Fri, 25 Jan 2019 12:08:01 -0500 Subject: [bug#34195] [PATCH v2] linux-modules: Add modules-soft-dependencies. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20190125113032.8372-1-dannym@scratchpost.org> <20190125114838.8680-1-dannym@scratchpost.org> Date: Fri, 25 Jan 2019 18:07:07 +0100 In-Reply-To: <20190125114838.8680-1-dannym@scratchpost.org> (Danny Milosavljevic's message of "Fri, 25 Jan 2019 12:48:38 +0100") Message-ID: <87bm44oedg.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Danny Milosavljevic Cc: 34195@debbugs.gnu.org Hi Danny, Danny Milosavljevic skribis: > * gnu/build/linux-modules.scm (not-softdep-whitespace): New variable. > (module-soft-dependencies): New procedure. That was fast! :-) [...] > +(define (module-soft-dependencies file) > + "Return a list of (cons mode soft-dependency) of module FILE." > + ;; TEXT: "pre: baz blubb foo post: bax bar" > + (define (parse-softdep text) > + (let loop ((value '()) > + (tokens (string-tokenize text not-softdep-whitespace)) > + (section #f)) > + (match tokens > + ((token _ ...) > + (if (string=3D? (string-take-right token 1) ":") ; section > + (loop value > + (cdr tokens) > + (string-trim-both token)) You can use the pattern (token rest ...) and then: (loop value rest (string-trim-both token)) instead of the not-so-nice =E2=80=98cdr=E2=80=99. :-) > + (let ((info (modinfo-section-contents file))) > + (apply append > + (filter-map (match-lambda > + (('softdep . value) > + (parse-softdep value)) > + (_ #f)) > + (modinfo-section-contents file))))) Replace =E2=80=98apply append=E2=80=99 with =E2=80=98concatenate=E2=80=99. OK with these changes, thank you! Ludo=E2=80=99.