aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-04-22 22:32:09 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-04-22 22:32:09 -0700
commitf5ca2ea1f9436ca12dabaecaeed8fe3db69c0c58 (patch)
tree93e174b501783cd085e067683a0c5e57ab040359 /src
parentc1f5de3aff294e770ae7a4b54043d6ebd9f20421 (diff)
downloadconsfigurator-f5ca2ea1f9436ca12dabaecaeed8fe3db69c0c58.tar.gz
factor out CHROOT-PATHNAME
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src')
-rw-r--r--src/package.lisp1
-rw-r--r--src/property/disk.lisp4
-rw-r--r--src/util.lisp4
3 files changed, 6 insertions, 3 deletions
diff --git a/src/package.lisp b/src/package.lisp
index 9c8decf..494304c 100644
--- a/src/package.lisp
+++ b/src/package.lisp
@@ -67,6 +67,7 @@
#:pathname-file
#:quote-nonselfeval
#:define-print-object-for-structlike
+ #:chroot-pathname
#:*consfigurator-debug-level*
#:with-indented-inform
diff --git a/src/property/disk.lisp b/src/property/disk.lisp
index 4fd67ed..cb53d85 100644
--- a/src/property/disk.lisp
+++ b/src/property/disk.lisp
@@ -378,9 +378,7 @@ unmounted, since the actual mount point is not stored.")
(defclass-opened-volume mounted-filesystem (filesystem))
(defmethod open-volume ((volume filesystem) (file pathname))
- (let ((mount-point
- (merge-pathnames (enough-pathname (mount-point volume) #P"/")
- (ensure-directory-pathname *mount-below*))))
+ (let ((mount-point (chroot-pathname (mount-point volume) *mount-below*)))
(file:directory-exists mount-point)
(mrun "mount" file mount-point))
(make-opened-volume volume file))
diff --git a/src/util.lisp b/src/util.lisp
index c611c65..82a7f55 100644
--- a/src/util.lisp
+++ b/src/util.lisp
@@ -174,6 +174,10 @@ one-dimensional collections of values."
(call-next-method))
object))
+(defun chroot-pathname (pathname chroot)
+ (merge-pathnames (enough-pathname pathname #P"/")
+ (ensure-directory-pathname chroot)))
+
;;;; Progress & debug printing