|
|
|
@ -10,9 +10,9 @@ puts stdout "::argv $::argv"
|
|
|
|
|
set dirname [file normalize [file dirname [info script]]] |
|
|
|
|
|
|
|
|
|
# ---------------------------------------- |
|
|
|
|
set src_module_dir $dirname/modules |
|
|
|
|
|
|
|
|
|
proc copy_modules_in_dir {srcdir basedir {subdirlist {}}} { |
|
|
|
|
set module_list [list] |
|
|
|
|
set src_modules [glob -nocomplain -dir $srcdir -type f -tail *.tm] |
|
|
|
|
if {![file exists $basedir]} { |
|
|
|
|
error "copy_modules_in_dir basedir:'$basedir' doesn't exist" |
|
|
|
@ -25,26 +25,38 @@ proc copy_modules_in_dir {srcdir basedir {subdirlist {}}} {
|
|
|
|
|
foreach m $src_modules { |
|
|
|
|
puts stdout "copying module $srcdir/$m to $target_module_dir" |
|
|
|
|
file copy -force $srcdir/$m $target_module_dir |
|
|
|
|
lappend module_list $srcdir/$m |
|
|
|
|
} |
|
|
|
|
set subdirs [glob -nocomplain -dir $srcdir -type d -tail *] |
|
|
|
|
#puts stderr "subdirs: $subdirs" |
|
|
|
|
foreach d $subdirs { |
|
|
|
|
if {[string match "#*" $d]} { |
|
|
|
|
if {[string match "#*" $d] || ($d eq "_aside")} { |
|
|
|
|
continue |
|
|
|
|
} |
|
|
|
|
if {![file exists $target_module_dir/$d]} { |
|
|
|
|
file mkdir $target_module_dir/$d |
|
|
|
|
} |
|
|
|
|
copy_modules_in_dir $srcdir/$d $basedir [list {*}$subdirlist $d] |
|
|
|
|
lappend module_list {*}[copy_modules_in_dir $srcdir/$d $basedir [list {*}$subdirlist $d]] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $module_list |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set src_modules [glob -nocomplain -dir $src_module_dir -type f -tail *.tm] |
|
|
|
|
set target_modules_base [file dirname $dirname]/modules |
|
|
|
|
file mkdir $target_modules_base |
|
|
|
|
copy_modules_in_dir $src_module_dir $target_modules_base |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#external modules first |
|
|
|
|
set copied [copy_modules_in_dir $dirname/deps $target_modules_base] |
|
|
|
|
puts stderr "Copied [llength $copied] dependencies" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set src_module_dir $dirname/modules |
|
|
|
|
#modules belonging to this package/app |
|
|
|
|
set copied [copy_modules_in_dir $src_module_dir $target_modules_base] |
|
|
|
|
puts stderr "Copied [llength $copied] app modules" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#set src_modules [glob -nocomplain -dir $src_module_dir -type f -tail *.tm] |
|
|
|
|
#foreach m $src_modules { |
|
|
|
|
# puts stdout "copying module $src_module_dir/$m to $target_module_dir" |
|
|
|
|
# file copy -force $src_module_dir/$m $target_module_dir |
|
|
|
|