From patchwork Sun Feb 6 21:20:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josselin Poiret X-Patchwork-Id: 37030 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 030EE27BBEA; Sun, 6 Feb 2022 21:23:39 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id BE0D027BBE9 for ; Sun, 6 Feb 2022 21:23:38 +0000 (GMT) Received: from localhost ([::1]:56036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nGp0T-0001sD-W6 for patchwork@mira.cbaines.net; Sun, 06 Feb 2022 16:23:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGoyw-0008RP-OG for guix-patches@gnu.org; Sun, 06 Feb 2022 16:22:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:46068) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nGoyw-0003Vn-EX for guix-patches@gnu.org; Sun, 06 Feb 2022 16:22:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nGoyw-0005lH-CW for guix-patches@gnu.org; Sun, 06 Feb 2022 16:22:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53826] [PATCH 1/2] system: Add helper file-system-mount-point-predicate. Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 06 Feb 2022 21:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53826 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53826@debbugs.gnu.org Cc: Josselin Poiret Received: via spool by 53826-submit@debbugs.gnu.org id=B53826.164418246722074 (code B ref 53826); Sun, 06 Feb 2022 21:22:02 +0000 Received: (at 53826) by debbugs.gnu.org; 6 Feb 2022 21:21:07 +0000 Received: from localhost ([127.0.0.1]:39965 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGoy3-0005jx-Cc for submit@debbugs.gnu.org; Sun, 06 Feb 2022 16:21:07 -0500 Received: from jpoiret.xyz ([206.189.101.64]:50556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGoxn-0005id-J8 for 53826@debbugs.gnu.org; Sun, 06 Feb 2022 16:21:06 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 2B48E1851ED; Sun, 6 Feb 2022 21:20:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1644182450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7eEwvNL9L9HIwiUL6+wUqNSJ0L3vbgZMP1ZQvIkh94Y=; b=JjJJVdx/Z7O7bqpbfdlKp1SFbUTY3Wovas8QiXAPsTlPWh8pVBm/KY/sMrsEVvIGIxgrMD Y13515k+TOItM5cb7qKf98U2d4ErVDjxFRJEhBlTJKDmErlpa47PlT5JK3m9Op2Qx7FK+S 7PQbBHPpzijib/R3ZmRlB+XOZFASn1pm3cI06/swrkmMGDsHikad2+0aenXGR/g63i9bXa bGRcOBX/fp2CBmi8MtrIwTLB31u/mHvpflHkdyh5GHb7mIHtS53K2HRpiZkXGfEfx+096G SxZIIawecvl/K4Hk0h8mxu/TBpbji7esWKW2bsr2tseR87+mjVu7uQs4mg7SXQ== Date: Sun, 6 Feb 2022 22:20:44 +0100 Message-Id: <20220206212045.19257-1-dev@jpoiret.xyz> In-Reply-To: References: MIME-Version: 1.0 Authentication-Results: jpoiret.xyz; auth=pass smtp.auth=jpoiret@jpoiret.xyz smtp.mailfrom=dev@jpoiret.xyz X-Spamd-Bar: / X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Josselin Poiret X-ACL-Warn: , Josselin Poiret via Guix-patches X-Patchwork-Original-From: Josselin Poiret via Guix-patches via From: Josselin Poiret X-getmail-retrieved-from-mailbox: Patches * gnu/system/file-systems.scm (file-system-mount-point-predicate): Add it. --- gnu/system/file-systems.scm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index e1d1fb72cc..437f8da898 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -60,6 +60,7 @@ (define-module (gnu system file-systems) file-system-location file-system-type-predicate + file-system-mount-point-predicate btrfs-subvolume? btrfs-store-subvolume-file-name @@ -671,6 +672,12 @@ (define (file-system-type-predicate type) (lambda (fs) (string=? (file-system-type fs) type))) +(define (file-system-mount-point-predicate mount-point) + "Return a predicate that, when passed a file system, returns #t if that file +system has the given MOUNT-POINT." + (lambda (fs) + (string=? (file-system-mount-point fs) mount-point))) + ;;; ;;; Btrfs specific helpers.