From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id cCUHNrpk6l7VBgAA0tVLHw (envelope-from ) for ; Wed, 17 Jun 2020 18:45:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id Ld/PMbpk6l6iBQAAB5/wlQ (envelope-from ) for ; Wed, 17 Jun 2020 18:45:14 +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 11F559401D0 for ; Wed, 17 Jun 2020 18:45:13 +0000 (UTC) Received: from localhost ([::1]:42988 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jld3f-0006W3-Kw for larch@yhetil.org; Wed, 17 Jun 2020 14:45:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53674) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jld3W-0006Tr-Rt for guix-patches@gnu.org; Wed, 17 Jun 2020 14:45:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:40643) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jld3W-0000uc-GI for guix-patches@gnu.org; Wed, 17 Jun 2020 14:45:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jld3W-0003VS-DE for guix-patches@gnu.org; Wed, 17 Jun 2020 14:45: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 18:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41924 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41924@debbugs.gnu.org X-Debbugs-Original-To: guix-patches Received: via spool by submit@debbugs.gnu.org id=B.159241949213443 (code B ref -1); Wed, 17 Jun 2020 18:45:02 +0000 Received: (at submit) by debbugs.gnu.org; 17 Jun 2020 18:44:52 +0000 Received: from localhost ([127.0.0.1]:52189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jld3L-0003Ul-SV for submit@debbugs.gnu.org; Wed, 17 Jun 2020 14:44:52 -0400 Received: from lists.gnu.org ([209.51.188.17]:44392) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jld3H-0003Ua-4V for submit@debbugs.gnu.org; Wed, 17 Jun 2020 14:44:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jld3G-00067v-DV for guix-patches@gnu.org; Wed, 17 Jun 2020 14:44:46 -0400 Received: from forward105o.mail.yandex.net ([2a02:6b8:0:1a2d::608]:37554) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jld3D-0000rH-DZ for guix-patches@gnu.org; Wed, 17 Jun 2020 14:44:46 -0400 Received: from mxback7o.mail.yandex.net (mxback7o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::21]) by forward105o.mail.yandex.net (Yandex) with ESMTP id 9BCD74201FA5 for ; Wed, 17 Jun 2020 21:44:36 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback7o.mail.yandex.net (mxback/Yandex) with ESMTP id A25J3XgW8z-iaD86kf0; Wed, 17 Jun 2020 21:44:36 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1592419476; bh=cuBP9eYbsCczWZxxR3m68zNUr3hnM4KD9j+NGCWzzuU=; h=Message-Id:Date:Subject:To:From; b=hLduEs3ba0DXGiKEg+tym6c7DkWX4EGWFg5+1GwIgrOsDJiyBlZbW3uECc79Iyw/A PqnA7+uQk46tx4J4fgxvPCYoBM6xGVJDLjUfafDRLTaGbMIw7zFs/6Qb3LqHsONl8l rxUuySeUA3ot6SE9HP+NwDiDDT8gIixM2dk0b8pQ= Received: by myt6-6c65baa90efa.qloud-c.yandex.net with HTTP; Wed, 17 Jun 2020 21:44:35 +0300 From: Ivan Kozlov MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Wed, 17 Jun 2020 21:44:35 +0300 Message-Id: <169811592419302@mail.yandex.ru> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 Received-SPF: pass client-ip=2a02:6b8:0:1a2d::608; envelope-from=kanichos@yandex.ru; helo=forward105o.mail.yandex.net X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -2.3 (--) 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=hLduEs3b; 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: Ciz6f7MdkEOB 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