Browse Source

make.tcl for unix-like platforms ensure copy of runtime is writable; add dollarcent module

master
Julian Noble 6 months ago
parent
commit
96985cec5f
  1. 15
      src/bootsupport/modules/punk/mix/commandset/project-0.1.0.tm
  2. BIN
      src/bootsupport/modules/test/tomlish-1.1.1.tm
  3. BIN
      src/bootsupport/modules/test/tomlish-1.1.3.tm
  4. 3
      src/make.tcl
  5. 15
      src/modules/punk/mix/commandset/project-999999.0a1.0.tm
  6. 4
      src/project_layouts/custom/_project/punk.basic/src/make.tcl
  7. 15
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/mix/commandset/project-0.1.0.tm
  8. 4
      src/project_layouts/custom/_project/punk.project-0.1/src/make.tcl
  9. 15
      src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk/mix/commandset/project-0.1.0.tm
  10. 4
      src/project_layouts/custom/_project/punk.shell-0.1/src/make.tcl
  11. 1522
      src/vendormodules/dollarcent-1.1.tm
  12. 1
      src/vendormodules/include_modules.config
  13. 1522
      src/vfs/_vfscommon.vfs/modules/dollarcent-1.1.tm
  14. 15
      src/vfs/_vfscommon.vfs/modules/punk/mix/commandset/project-0.1.0.tm

15
src/bootsupport/modules/punk/mix/commandset/project-0.1.0.tm

@ -433,20 +433,26 @@ namespace eval punk::mix::commandset::project {
#scan all files in template #scan all files in template
# #
#TODO - deck command to substitute templates? #TODO - deck command to substitute templates?
set templatefiles [punk::mix::commandset::layout::lib::layout_scan_for_template_files $opt_layout] set templateinfo_list [punk::mix::commandset::layout::lib::layout_scan_for_template_files $opt_layout]
set stripprefix [file normalize $layout_path] set stripprefix [file normalize $layout_path]
set tagmap [list [lib::template_tag project] $projectname] set tagmap [list [lib::template_tag project] $projectname]
if {[llength $templatefiles]} { if {[llength $templateinfo_list]} {
puts stdout "Filling template file placeholders with the following tag map:" puts stdout "Filling template file placeholders with the following tag map:"
foreach {placeholder value} $tagmap { foreach {placeholder value} $tagmap {
puts stdout " $placeholder -> $value" puts stdout " $placeholder -> $value"
} }
} }
foreach templatefullpath $templatefiles { foreach templateinfo $templateinfo_list {
lassign $templateinfo templatefullpath template_tagnames_found
set templatetail [punk::repo::path_strip_alreadynormalized_prefixdepth $templatefullpath $stripprefix] set templatetail [punk::repo::path_strip_alreadynormalized_prefixdepth $templatefullpath $stripprefix]
set fpath [file join $projectdir $templatetail] set fpath [file join $projectdir $templatetail]
foreach t $template_tagnames_found {
if {"%$t%" ni [dict keys $tagmap]} {
puts stderr "warning: No substitution available for tag: %$t% in $fpath"
}
}
if {[file exists $fpath]} { if {[file exists $fpath]} {
set fd [open $fpath r]; fconfigure $fd -translation binary; set data [read $fd]; close $fd set fd [open $fpath r]; fconfigure $fd -translation binary; set data [read $fd]; close $fd
set data2 [string map $tagmap $data] set data2 [string map $tagmap $data]
@ -458,7 +464,6 @@ namespace eval punk::mix::commandset::project {
puts stderr "warning: Missing template file $fpath" puts stderr "warning: Missing template file $fpath"
} }
} }
#todo - tag substitutions in src/doc tree
::cd $projectdir ::cd $projectdir

BIN
src/bootsupport/modules/test/tomlish-1.1.1.tm

Binary file not shown.

BIN
src/bootsupport/modules/test/tomlish-1.1.3.tm

Binary file not shown.

3
src/make.tcl

@ -3006,6 +3006,8 @@ foreach vfstail $vfs_tails {
#'archive' based zip offsets - editable in 7z,peazip #'archive' based zip offsets - editable in 7z,peazip
file copy $raw_runtime $buildfolder/$vfsname.new file copy $raw_runtime $buildfolder/$vfsname.new
#runtime in runtime folder may not have write perm set - ensure the copy does as we need to append
catch {exec chmod +w $buildfolder/$vfsname.new}
file delete $buildfolder/$vfsname.zip file delete $buildfolder/$vfsname.zip
if {[info commands ::tcl::zipfs] ne ""} { if {[info commands ::tcl::zipfs] ne ""} {
@ -3073,6 +3075,7 @@ foreach vfstail $vfs_tails {
#copy the version that is mounted in this runtime to vfsname.new #copy the version that is mounted in this runtime to vfsname.new
if {[catch { if {[catch {
file copy -force $building_runtime $buildfolder/$vfsname.new file copy -force $building_runtime $buildfolder/$vfsname.new
catch {exec chmod +x $buildfolder/$vfsname.new}
} errM]} { } errM]} {
puts stderr "$kit_type 'file copy -force $building_runtime $buildfolder/$vfsname.new' failed\n$errM" puts stderr "$kit_type 'file copy -force $building_runtime $buildfolder/$vfsname.new' failed\n$errM"
error $errM error $errM

15
src/modules/punk/mix/commandset/project-999999.0a1.0.tm

@ -433,20 +433,26 @@ namespace eval punk::mix::commandset::project {
#scan all files in template #scan all files in template
# #
#TODO - deck command to substitute templates? #TODO - deck command to substitute templates?
set templatefiles [punk::mix::commandset::layout::lib::layout_scan_for_template_files $opt_layout] set templateinfo_list [punk::mix::commandset::layout::lib::layout_scan_for_template_files $opt_layout]
set stripprefix [file normalize $layout_path] set stripprefix [file normalize $layout_path]
set tagmap [list [lib::template_tag project] $projectname] set tagmap [list [lib::template_tag project] $projectname]
if {[llength $templatefiles]} { if {[llength $templateinfo_list]} {
puts stdout "Filling template file placeholders with the following tag map:" puts stdout "Filling template file placeholders with the following tag map:"
foreach {placeholder value} $tagmap { foreach {placeholder value} $tagmap {
puts stdout " $placeholder -> $value" puts stdout " $placeholder -> $value"
} }
} }
foreach templatefullpath $templatefiles { foreach templateinfo $templateinfo_list {
lassign $templateinfo templatefullpath template_tagnames_found
set templatetail [punk::repo::path_strip_alreadynormalized_prefixdepth $templatefullpath $stripprefix] set templatetail [punk::repo::path_strip_alreadynormalized_prefixdepth $templatefullpath $stripprefix]
set fpath [file join $projectdir $templatetail] set fpath [file join $projectdir $templatetail]
foreach t $template_tagnames_found {
if {"%$t%" ni [dict keys $tagmap]} {
puts stderr "warning: No substitution available for tag: %$t% in $fpath"
}
}
if {[file exists $fpath]} { if {[file exists $fpath]} {
set fd [open $fpath r]; fconfigure $fd -translation binary; set data [read $fd]; close $fd set fd [open $fpath r]; fconfigure $fd -translation binary; set data [read $fd]; close $fd
set data2 [string map $tagmap $data] set data2 [string map $tagmap $data]
@ -458,7 +464,6 @@ namespace eval punk::mix::commandset::project {
puts stderr "warning: Missing template file $fpath" puts stderr "warning: Missing template file $fpath"
} }
} }
#todo - tag substitutions in src/doc tree
::cd $projectdir ::cd $projectdir

4
src/project_layouts/custom/_project/punk.basic/src/make.tcl

@ -375,6 +375,7 @@ if {$bootsupport_paths_exist || $sourcesupport_paths_exist} {
set support_contents_exist 0 set support_contents_exist 0
foreach p [list {*}$bootsupport_module_paths {*}$bootsupport_library_paths {*}$sourcesupport_module_paths {*}$sourcesupport_library_paths] { foreach p [list {*}$bootsupport_module_paths {*}$bootsupport_library_paths {*}$sourcesupport_module_paths {*}$sourcesupport_library_paths] {
#set contents [glob -nocomplain -dir $p -tail *] #set contents [glob -nocomplain -dir $p -tail *]
if {![file exists $p]} {continue}
set contents [punkboot::lib::folder_nondotted_children $p] set contents [punkboot::lib::folder_nondotted_children $p]
set readmeposn [lsearch -nocase $contents readme.md] set readmeposn [lsearch -nocase $contents readme.md]
#don't assume 'ledit' available #don't assume 'ledit' available
@ -3005,6 +3006,8 @@ foreach vfstail $vfs_tails {
#'archive' based zip offsets - editable in 7z,peazip #'archive' based zip offsets - editable in 7z,peazip
file copy $raw_runtime $buildfolder/$vfsname.new file copy $raw_runtime $buildfolder/$vfsname.new
#runtime in runtime folder may not have write perm set - ensure the copy does as we need to append
catch {exec chmod +w $buildfolder/$vfsname.new}
file delete $buildfolder/$vfsname.zip file delete $buildfolder/$vfsname.zip
if {[info commands ::tcl::zipfs] ne ""} { if {[info commands ::tcl::zipfs] ne ""} {
@ -3072,6 +3075,7 @@ foreach vfstail $vfs_tails {
#copy the version that is mounted in this runtime to vfsname.new #copy the version that is mounted in this runtime to vfsname.new
if {[catch { if {[catch {
file copy -force $building_runtime $buildfolder/$vfsname.new file copy -force $building_runtime $buildfolder/$vfsname.new
catch {exec chmod +x $buildfolder/$vfsname.new}
} errM]} { } errM]} {
puts stderr "$kit_type 'file copy -force $building_runtime $buildfolder/$vfsname.new' failed\n$errM" puts stderr "$kit_type 'file copy -force $building_runtime $buildfolder/$vfsname.new' failed\n$errM"
error $errM error $errM

15
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/mix/commandset/project-0.1.0.tm

@ -433,20 +433,26 @@ namespace eval punk::mix::commandset::project {
#scan all files in template #scan all files in template
# #
#TODO - deck command to substitute templates? #TODO - deck command to substitute templates?
set templatefiles [punk::mix::commandset::layout::lib::layout_scan_for_template_files $opt_layout] set templateinfo_list [punk::mix::commandset::layout::lib::layout_scan_for_template_files $opt_layout]
set stripprefix [file normalize $layout_path] set stripprefix [file normalize $layout_path]
set tagmap [list [lib::template_tag project] $projectname] set tagmap [list [lib::template_tag project] $projectname]
if {[llength $templatefiles]} { if {[llength $templateinfo_list]} {
puts stdout "Filling template file placeholders with the following tag map:" puts stdout "Filling template file placeholders with the following tag map:"
foreach {placeholder value} $tagmap { foreach {placeholder value} $tagmap {
puts stdout " $placeholder -> $value" puts stdout " $placeholder -> $value"
} }
} }
foreach templatefullpath $templatefiles { foreach templateinfo $templateinfo_list {
lassign $templateinfo templatefullpath template_tagnames_found
set templatetail [punk::repo::path_strip_alreadynormalized_prefixdepth $templatefullpath $stripprefix] set templatetail [punk::repo::path_strip_alreadynormalized_prefixdepth $templatefullpath $stripprefix]
set fpath [file join $projectdir $templatetail] set fpath [file join $projectdir $templatetail]
foreach t $template_tagnames_found {
if {"%$t%" ni [dict keys $tagmap]} {
puts stderr "warning: No substitution available for tag: %$t% in $fpath"
}
}
if {[file exists $fpath]} { if {[file exists $fpath]} {
set fd [open $fpath r]; fconfigure $fd -translation binary; set data [read $fd]; close $fd set fd [open $fpath r]; fconfigure $fd -translation binary; set data [read $fd]; close $fd
set data2 [string map $tagmap $data] set data2 [string map $tagmap $data]
@ -458,7 +464,6 @@ namespace eval punk::mix::commandset::project {
puts stderr "warning: Missing template file $fpath" puts stderr "warning: Missing template file $fpath"
} }
} }
#todo - tag substitutions in src/doc tree
::cd $projectdir ::cd $projectdir

4
src/project_layouts/custom/_project/punk.project-0.1/src/make.tcl

@ -375,6 +375,7 @@ if {$bootsupport_paths_exist || $sourcesupport_paths_exist} {
set support_contents_exist 0 set support_contents_exist 0
foreach p [list {*}$bootsupport_module_paths {*}$bootsupport_library_paths {*}$sourcesupport_module_paths {*}$sourcesupport_library_paths] { foreach p [list {*}$bootsupport_module_paths {*}$bootsupport_library_paths {*}$sourcesupport_module_paths {*}$sourcesupport_library_paths] {
#set contents [glob -nocomplain -dir $p -tail *] #set contents [glob -nocomplain -dir $p -tail *]
if {![file exists $p]} {continue}
set contents [punkboot::lib::folder_nondotted_children $p] set contents [punkboot::lib::folder_nondotted_children $p]
set readmeposn [lsearch -nocase $contents readme.md] set readmeposn [lsearch -nocase $contents readme.md]
#don't assume 'ledit' available #don't assume 'ledit' available
@ -3005,6 +3006,8 @@ foreach vfstail $vfs_tails {
#'archive' based zip offsets - editable in 7z,peazip #'archive' based zip offsets - editable in 7z,peazip
file copy $raw_runtime $buildfolder/$vfsname.new file copy $raw_runtime $buildfolder/$vfsname.new
#runtime in runtime folder may not have write perm set - ensure the copy does as we need to append
catch {exec chmod +w $buildfolder/$vfsname.new}
file delete $buildfolder/$vfsname.zip file delete $buildfolder/$vfsname.zip
if {[info commands ::tcl::zipfs] ne ""} { if {[info commands ::tcl::zipfs] ne ""} {
@ -3072,6 +3075,7 @@ foreach vfstail $vfs_tails {
#copy the version that is mounted in this runtime to vfsname.new #copy the version that is mounted in this runtime to vfsname.new
if {[catch { if {[catch {
file copy -force $building_runtime $buildfolder/$vfsname.new file copy -force $building_runtime $buildfolder/$vfsname.new
catch {exec chmod +x $buildfolder/$vfsname.new}
} errM]} { } errM]} {
puts stderr "$kit_type 'file copy -force $building_runtime $buildfolder/$vfsname.new' failed\n$errM" puts stderr "$kit_type 'file copy -force $building_runtime $buildfolder/$vfsname.new' failed\n$errM"
error $errM error $errM

15
src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk/mix/commandset/project-0.1.0.tm

@ -433,20 +433,26 @@ namespace eval punk::mix::commandset::project {
#scan all files in template #scan all files in template
# #
#TODO - deck command to substitute templates? #TODO - deck command to substitute templates?
set templatefiles [punk::mix::commandset::layout::lib::layout_scan_for_template_files $opt_layout] set templateinfo_list [punk::mix::commandset::layout::lib::layout_scan_for_template_files $opt_layout]
set stripprefix [file normalize $layout_path] set stripprefix [file normalize $layout_path]
set tagmap [list [lib::template_tag project] $projectname] set tagmap [list [lib::template_tag project] $projectname]
if {[llength $templatefiles]} { if {[llength $templateinfo_list]} {
puts stdout "Filling template file placeholders with the following tag map:" puts stdout "Filling template file placeholders with the following tag map:"
foreach {placeholder value} $tagmap { foreach {placeholder value} $tagmap {
puts stdout " $placeholder -> $value" puts stdout " $placeholder -> $value"
} }
} }
foreach templatefullpath $templatefiles { foreach templateinfo $templateinfo_list {
lassign $templateinfo templatefullpath template_tagnames_found
set templatetail [punk::repo::path_strip_alreadynormalized_prefixdepth $templatefullpath $stripprefix] set templatetail [punk::repo::path_strip_alreadynormalized_prefixdepth $templatefullpath $stripprefix]
set fpath [file join $projectdir $templatetail] set fpath [file join $projectdir $templatetail]
foreach t $template_tagnames_found {
if {"%$t%" ni [dict keys $tagmap]} {
puts stderr "warning: No substitution available for tag: %$t% in $fpath"
}
}
if {[file exists $fpath]} { if {[file exists $fpath]} {
set fd [open $fpath r]; fconfigure $fd -translation binary; set data [read $fd]; close $fd set fd [open $fpath r]; fconfigure $fd -translation binary; set data [read $fd]; close $fd
set data2 [string map $tagmap $data] set data2 [string map $tagmap $data]
@ -458,7 +464,6 @@ namespace eval punk::mix::commandset::project {
puts stderr "warning: Missing template file $fpath" puts stderr "warning: Missing template file $fpath"
} }
} }
#todo - tag substitutions in src/doc tree
::cd $projectdir ::cd $projectdir

4
src/project_layouts/custom/_project/punk.shell-0.1/src/make.tcl

@ -375,6 +375,7 @@ if {$bootsupport_paths_exist || $sourcesupport_paths_exist} {
set support_contents_exist 0 set support_contents_exist 0
foreach p [list {*}$bootsupport_module_paths {*}$bootsupport_library_paths {*}$sourcesupport_module_paths {*}$sourcesupport_library_paths] { foreach p [list {*}$bootsupport_module_paths {*}$bootsupport_library_paths {*}$sourcesupport_module_paths {*}$sourcesupport_library_paths] {
#set contents [glob -nocomplain -dir $p -tail *] #set contents [glob -nocomplain -dir $p -tail *]
if {![file exists $p]} {continue}
set contents [punkboot::lib::folder_nondotted_children $p] set contents [punkboot::lib::folder_nondotted_children $p]
set readmeposn [lsearch -nocase $contents readme.md] set readmeposn [lsearch -nocase $contents readme.md]
#don't assume 'ledit' available #don't assume 'ledit' available
@ -3005,6 +3006,8 @@ foreach vfstail $vfs_tails {
#'archive' based zip offsets - editable in 7z,peazip #'archive' based zip offsets - editable in 7z,peazip
file copy $raw_runtime $buildfolder/$vfsname.new file copy $raw_runtime $buildfolder/$vfsname.new
#runtime in runtime folder may not have write perm set - ensure the copy does as we need to append
catch {exec chmod +w $buildfolder/$vfsname.new}
file delete $buildfolder/$vfsname.zip file delete $buildfolder/$vfsname.zip
if {[info commands ::tcl::zipfs] ne ""} { if {[info commands ::tcl::zipfs] ne ""} {
@ -3072,6 +3075,7 @@ foreach vfstail $vfs_tails {
#copy the version that is mounted in this runtime to vfsname.new #copy the version that is mounted in this runtime to vfsname.new
if {[catch { if {[catch {
file copy -force $building_runtime $buildfolder/$vfsname.new file copy -force $building_runtime $buildfolder/$vfsname.new
catch {exec chmod +x $buildfolder/$vfsname.new}
} errM]} { } errM]} {
puts stderr "$kit_type 'file copy -force $building_runtime $buildfolder/$vfsname.new' failed\n$errM" puts stderr "$kit_type 'file copy -force $building_runtime $buildfolder/$vfsname.new' failed\n$errM"
error $errM error $errM

1522
src/vendormodules/dollarcent-1.1.tm

File diff suppressed because it is too large Load Diff

1
src/vendormodules/include_modules.config

@ -13,6 +13,7 @@ set local_modules [list\
c:/repo/jn/tclmodules/tomlish/modules tomlish\ c:/repo/jn/tclmodules/tomlish/modules tomlish\
c:/repo/jn/tclmodules/tomlish/modules test::tomlish\ c:/repo/jn/tclmodules/tomlish/modules test::tomlish\
c:/repo/jn/tclmodules/dictn/modules dictn\ c:/repo/jn/tclmodules/dictn/modules dictn\
c:/repo/jn/tclmodules/dollarcent/modules dollarcent\
] ]
set fossil_modules [dict create\ set fossil_modules [dict create\

1522
src/vfs/_vfscommon.vfs/modules/dollarcent-1.1.tm

File diff suppressed because it is too large Load Diff

15
src/vfs/_vfscommon.vfs/modules/punk/mix/commandset/project-0.1.0.tm

@ -433,20 +433,26 @@ namespace eval punk::mix::commandset::project {
#scan all files in template #scan all files in template
# #
#TODO - deck command to substitute templates? #TODO - deck command to substitute templates?
set templatefiles [punk::mix::commandset::layout::lib::layout_scan_for_template_files $opt_layout] set templateinfo_list [punk::mix::commandset::layout::lib::layout_scan_for_template_files $opt_layout]
set stripprefix [file normalize $layout_path] set stripprefix [file normalize $layout_path]
set tagmap [list [lib::template_tag project] $projectname] set tagmap [list [lib::template_tag project] $projectname]
if {[llength $templatefiles]} { if {[llength $templateinfo_list]} {
puts stdout "Filling template file placeholders with the following tag map:" puts stdout "Filling template file placeholders with the following tag map:"
foreach {placeholder value} $tagmap { foreach {placeholder value} $tagmap {
puts stdout " $placeholder -> $value" puts stdout " $placeholder -> $value"
} }
} }
foreach templatefullpath $templatefiles { foreach templateinfo $templateinfo_list {
lassign $templateinfo templatefullpath template_tagnames_found
set templatetail [punk::repo::path_strip_alreadynormalized_prefixdepth $templatefullpath $stripprefix] set templatetail [punk::repo::path_strip_alreadynormalized_prefixdepth $templatefullpath $stripprefix]
set fpath [file join $projectdir $templatetail] set fpath [file join $projectdir $templatetail]
foreach t $template_tagnames_found {
if {"%$t%" ni [dict keys $tagmap]} {
puts stderr "warning: No substitution available for tag: %$t% in $fpath"
}
}
if {[file exists $fpath]} { if {[file exists $fpath]} {
set fd [open $fpath r]; fconfigure $fd -translation binary; set data [read $fd]; close $fd set fd [open $fpath r]; fconfigure $fd -translation binary; set data [read $fd]; close $fd
set data2 [string map $tagmap $data] set data2 [string map $tagmap $data]
@ -458,7 +464,6 @@ namespace eval punk::mix::commandset::project {
puts stderr "warning: Missing template file $fpath" puts stderr "warning: Missing template file $fpath"
} }
} }
#todo - tag substitutions in src/doc tree
::cd $projectdir ::cd $projectdir

Loading…
Cancel
Save