From 8db11c80a859bbe0a91d9162d56fec3bef88f511 Mon Sep 17 00:00:00 2001 From: Joshua Root Date: Wed, 4 Oct 2023 03:10:40 +1100 Subject: [PATCH] Keep destroot.keepdirs inside of $destroot Closes: https://trac.macports.org/ticket/55673 --- src/port1.0/portdestroot.tcl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/port1.0/portdestroot.tcl b/src/port1.0/portdestroot.tcl index 364ce16b38..ec10139f9c 100644 --- a/src/port1.0/portdestroot.tcl +++ b/src/port1.0/portdestroot.tcl @@ -33,6 +33,7 @@ package provide portdestroot 1.0 package require portutil 1.0 +package require fileutil set org.macports.destroot [target_new org.macports.destroot portdestroot::destroot_main] target_provides ${org.macports.destroot} destroot @@ -175,6 +176,8 @@ proc portdestroot::destroot_finish {args} { # Prune empty directories in ${destroot} foreach path ${destroot.keepdirs} { + # Prepend $destroot if $path isn't already inside it + set path [::fileutil::jail $destroot $path] if {![file isdirectory ${path}]} { xinstall -m 0755 -d ${path} }