Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/port1.0/portextract.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace eval portextract {
}

# define options
options extract.only extract.mkdir extract.rename extract.asroot
options extract.only extract.mkdir extract.rename extract.rename_filter extract.asroot
commands extract

# Set up defaults
Expand All @@ -58,6 +58,7 @@ default extract.pre_args -dc
default extract.post_args {| ${portutil::autoconf::tar_command} -xf -}
default extract.mkdir no
default extract.rename no
default extract.rename_filter {*}

set_ui_prefix

Expand Down Expand Up @@ -159,9 +160,10 @@ proc portextract::extract_main {args} {
}

if {[option extract.rename] && ![file exists [option worksrcpath]]} {
global workpath distname
global workpath distname extract.rename_filter
# rename whatever directory exists in $workpath to $distname
set worksubdirs [glob -nocomplain -types d -directory $workpath *]
ui_debug [format [msgcat::mc "extract.rename: using filter '%s'"] ${extract.rename_filter}]
set worksubdirs [glob -nocomplain -types d -directory $workpath ${extract.rename_filter}]
if {[llength $worksubdirs] == 1} {
set origpath [lindex $worksubdirs 0]
set newpath [file join $workpath $distname]
Expand Down