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} }