diff mbox series

[bug#53826,1/2] system: Add helper file-system-mount-point-predicate.

Message ID 20220206212045.19257-1-dev@jpoiret.xyz
State Accepted
Headers show
Series Improve Swap Space examples | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Josselin Poiret Feb. 6, 2022, 9:20 p.m. UTC
* gnu/system/file-systems.scm (file-system-mount-point-predicate): Add
it.
---
 gnu/system/file-systems.scm | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

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.