From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:49851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gnPka-0005sb-St for guix-patches@gnu.org; Sat, 26 Jan 2019 10:20:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gnPkY-0004Dz-Sb for guix-patches@gnu.org; Sat, 26 Jan 2019 10:20:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:47427) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gnPkY-0004DS-LQ for guix-patches@gnu.org; Sat, 26 Jan 2019 10:20:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gnPkY-0000uQ-GO for guix-patches@gnu.org; Sat, 26 Jan 2019 10:20:02 -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> <87bm44oedg.fsf@gnu.org> <20190125182537.0535b710@scratchpost.org> <87womrjyr0.fsf@gnu.org> <20190126160036.17dda684@scratchpost.org> Date: Sat, 26 Jan 2019 16:19:15 +0100 In-Reply-To: <20190126160036.17dda684@scratchpost.org> (Danny Milosavljevic's message of "Sat, 26 Jan 2019 16:00:36 +0100") Message-ID: <87zhrnigzw.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-done@debbugs.gnu.org Danny Milosavljevic skribis: > On Sat, 26 Jan 2019 15:10:27 +0100 > Ludovic Court=C3=A8s wrote: > >> Danny Milosavljevic skribis: >>=20 >> > scheme> (module-soft-dependencies "/tmp/vfio.ko")=20=20 >> > $2 =3D (("post" . "vfio_iommu_spapr_tce") ("post" . "vfio_iommu_type1"= ))=20=20 >>=20 >> That=E2=80=99s probably not the best interface. :-) >>=20 >> Perhaps it should return two values: the list of modules to be loaded >> before (=E2=80=9Cpre=E2=80=9D), followed by the list of modules to be lo= aded after >> (=E2=80=9Cpost=E2=80=9D). > > I had thought about it - but for our use case it makes it slower and more > complicated. Once you have the result above, you can simply do: (partition (match-lambda (("pre" . _) #t) (("post" . _) #f)) $2) and then remove the cars. Or you can fold over the elements instead of constructing the alist in the first place. Anyway it should be a few more lines at most, I think. Ludo=E2=80=99.