From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id YNpQAWyP6l6YTAAA0tVLHw (envelope-from ) for ; Wed, 17 Jun 2020 21:47:24 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id wNSlOGuP6l5GbQAAbx9fmQ (envelope-from ) for ; Wed, 17 Jun 2020 21:47:23 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 537589401D0 for ; Wed, 17 Jun 2020 21:47:23 +0000 (UTC) Received: from localhost ([::1]:55394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlftw-0000Q6-Qu for larch@yhetil.org; Wed, 17 Jun 2020 17:47:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfTW-0006fz-MB for guix-patches@gnu.org; Wed, 17 Jun 2020 17:20:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:40737) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfTW-0002uC-97 for guix-patches@gnu.org; Wed, 17 Jun 2020 17:20:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jlfTW-00078u-1f for guix-patches@gnu.org; Wed, 17 Jun 2020 17:20:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41924] [PATCH] profiles: Make linux-module-database skip inappropriate inputs Resent-From: Ivan Kozlov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 17 Jun 2020 21:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41924 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: "41924@debbugs.gnu.org" <41924@debbugs.gnu.org> Received: via spool by 41924-submit@debbugs.gnu.org id=B41924.159242874927388 (code B ref 41924); Wed, 17 Jun 2020 21:20:02 +0000 Received: (at 41924) by debbugs.gnu.org; 17 Jun 2020 21:19:09 +0000 Received: from localhost ([127.0.0.1]:52283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jlfSe-00077f-Qq for submit@debbugs.gnu.org; Wed, 17 Jun 2020 17:19:09 -0400 Received: from forward501j.mail.yandex.net ([5.45.198.251]:51738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jlfSa-000777-3D for 41924@debbugs.gnu.org; Wed, 17 Jun 2020 17:19:06 -0400 Received: from mxback28o.mail.yandex.net (mxback28o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::79]) by forward501j.mail.yandex.net (Yandex) with ESMTP id E841F338002E for <41924@debbugs.gnu.org>; Thu, 18 Jun 2020 00:18:56 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback28o.mail.yandex.net (mxback/Yandex) with ESMTP id eiJfClVMNX-Iuq40si8; Thu, 18 Jun 2020 00:18:56 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1592428736; bh=xDHzHkNjncpew0U2dWjAdje58NYc1/bnXO7phOA78Lw=; h=References:Date:Message-Id:Subject:In-Reply-To:To:From; b=HtZByRSyx273/tz0paBOUv7Dk/Oyl9Nmt2EZ3Vt/TnmhUpUBJ3YJQm9rXQD1MujQ1 dU8NAj5s9Q3efm1UG+qvzpgfmns+/RukM22dD2hUq/tRl6rseV1AeQPkcLKYP7Aql+ e79uonCW5T7e/VzL208iXeP/lLwn6hz0aelXvbWg= Received: by sas8-f59b61ed75ea.qloud-c.yandex.net with HTTP; Thu, 18 Jun 2020 00:18:55 +0300 From: Ivan Kozlov In-Reply-To: <169811592419302@mail.yandex.ru> References: <169811592419302@mail.yandex.ru> MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Thu, 18 Jun 2020 00:18:55 +0300 Message-Id: <182531592428678@mail.yandex.ru> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.7 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=yandex.ru header.s=mail header.b=HtZByRSy; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yandex.ru (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: nZ4aQfFa+mYy mkdir should of course be changed to mkdir-p. 17.06.2020, 21:45, "Ivan Kozlov" : > This allows a Linux package with CONFIG_MODULES=n, that doesn’t contain the ‘lib/modules’ directory, to be used. > > * guix/profiles.scm (linux-module-database): Add if clause to ignore unrelated inputs. Allow empty result. > --- >  guix/profiles.scm | 10 +++++++--- >  1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/guix/profiles.scm b/guix/profiles.scm > index 25ff146bdf..a3868e8343 100644 > --- a/guix/profiles.scm > +++ b/guix/profiles.scm > @@ -1220,9 +1220,11 @@ This is meant to be used as a profile hook." >                         inputs)) >                   (directory-entries >                    (lambda (directory) > - (scandir directory (lambda (basename) > - (not > - (string-prefix? "." basename)))))) > + (if (file-exists? directory) > + (scandir directory (lambda (basename) > + (not > + (string-prefix? "." basename)))) > + '()))) >                   ;; Note: Should usually result in one entry. >                   (versions (delete-duplicates >                              (append-map directory-entries > @@ -1233,6 +1235,8 @@ This is meant to be used as a profile hook." >                    (setenv "PATH" #+(file-append kmod "/bin")) >                    (make-linux-module-directory inputs version #$output) >                    (setenv "PATH" old-path))) > + ;; Do nothing when there is nothing to do > + (() (mkdir #$output)) >                 (_ (error "Specified Linux kernel and Linux kernel modules >  are not all of the same version"))))))) >    (gexp->derivation "linux-module-database" build > -- > 2.26.2