Browse Source

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

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

48
src/bootsupport/modules/README.md

@ -1,24 +1,24 @@
This is primarily for tcl .tm modules required for your bootstrapping/make/build process.
It could include other files necessary for this process.
The .tm modules here may be required for your build script if it intended the installation operator uses an existing tclsh or other shell as opposed to a tclkit you may have for distribution which is more likely to include necessary libraries.
The modules here are loaded by your initialisation scripts and so can be a snapshot of different versions than those in your project src.
The modules can be your own, or 3rd party such as individual items from tcllib.
You can copy modules from a running punk shell to this location using the dev command.
e.g
dev lib.copyasmodule some::module::lib bootsupport
The dev command will help you pick the latest version, and will create any necessary file structure matching the namespace of the package.
e.g the result might be a file such as
<projectname>/src/bootsupport/some/module/lib-0.1.tm
The originating library may not yet be in .tm form.
You can copy a pkgIndex.tcl based library that is composed of a single .tcl file the same way using the above process and it will automatically name and file it appropriately but you need to check that the library doesn't require/load additional files - and that it is Tcl script only.
Always verify that the library is copyable in this manner and test in a shell with tcl::tm::path pointed to ./bootsupport that it works.
This is primarily for tcl .tm modules required for your bootstrapping/make/build process.
It could include other files necessary for this process.
The .tm modules here may be required for your build script if it intended the installation operator uses an existing tclsh or other shell as opposed to a tclkit you may have for distribution which is more likely to include necessary libraries.
The modules here are loaded by your initialisation scripts and so can be a snapshot of different versions than those in your project src.
The modules can be your own, or 3rd party such as individual items from tcllib.
You can copy modules from a running punk shell to this location using the dev command.
e.g
dev lib.copyasmodule some::module::lib bootsupport
The dev command will help you pick the latest version, and will create any necessary file structure matching the namespace of the package.
e.g the result might be a file such as
<projectname>/src/bootsupport/some/module/lib-0.1.tm
The originating library may not yet be in .tm form.
You can copy a pkgIndex.tcl based library that is composed of a single .tcl file the same way using the above process and it will automatically name and file it appropriately but you need to check that the library doesn't require/load additional files - and that it is Tcl script only.
Always verify that the library is copyable in this manner and test in a shell with tcl::tm::path pointed to ./bootsupport that it works.

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
#
#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 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:"
foreach {placeholder value} $tagmap {
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 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]} {
set fd [open $fpath r]; fconfigure $fd -translation binary; set data [read $fd]; close $fd
set data2 [string map $tagmap $data]
@ -458,7 +464,6 @@ namespace eval punk::mix::commandset::project {
puts stderr "warning: Missing template file $fpath"
}
}
#todo - tag substitutions in src/doc tree
::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
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
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
if {[catch {
file copy -force $building_runtime $buildfolder/$vfsname.new
catch {exec chmod +x $buildfolder/$vfsname.new}
} errM]} {
puts stderr "$kit_type 'file copy -force $building_runtime $buildfolder/$vfsname.new' failed\n$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
#
#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 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:"
foreach {placeholder value} $tagmap {
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 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]} {
set fd [open $fpath r]; fconfigure $fd -translation binary; set data [read $fd]; close $fd
set data2 [string map $tagmap $data]
@ -458,7 +464,6 @@ namespace eval punk::mix::commandset::project {
puts stderr "warning: Missing template file $fpath"
}
}
#todo - tag substitutions in src/doc tree
::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
foreach p [list {*}$bootsupport_module_paths {*}$bootsupport_library_paths {*}$sourcesupport_module_paths {*}$sourcesupport_library_paths] {
#set contents [glob -nocomplain -dir $p -tail *]
if {![file exists $p]} {continue}
set contents [punkboot::lib::folder_nondotted_children $p]
set readmeposn [lsearch -nocase $contents readme.md]
#don't assume 'ledit' available
@ -3005,6 +3006,8 @@ foreach vfstail $vfs_tails {
#'archive' based zip offsets - editable in 7z,peazip
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
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
if {[catch {
file copy -force $building_runtime $buildfolder/$vfsname.new
catch {exec chmod +x $buildfolder/$vfsname.new}
} errM]} {
puts stderr "$kit_type 'file copy -force $building_runtime $buildfolder/$vfsname.new' failed\n$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
#
#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 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:"
foreach {placeholder value} $tagmap {
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 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]} {
set fd [open $fpath r]; fconfigure $fd -translation binary; set data [read $fd]; close $fd
set data2 [string map $tagmap $data]
@ -458,7 +464,6 @@ namespace eval punk::mix::commandset::project {
puts stderr "warning: Missing template file $fpath"
}
}
#todo - tag substitutions in src/doc tree
::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
foreach p [list {*}$bootsupport_module_paths {*}$bootsupport_library_paths {*}$sourcesupport_module_paths {*}$sourcesupport_library_paths] {
#set contents [glob -nocomplain -dir $p -tail *]
if {![file exists $p]} {continue}
set contents [punkboot::lib::folder_nondotted_children $p]
set readmeposn [lsearch -nocase $contents readme.md]
#don't assume 'ledit' available
@ -3005,6 +3006,8 @@ foreach vfstail $vfs_tails {
#'archive' based zip offsets - editable in 7z,peazip
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
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
if {[catch {
file copy -force $building_runtime $buildfolder/$vfsname.new
catch {exec chmod +x $buildfolder/$vfsname.new}
} errM]} {
puts stderr "$kit_type 'file copy -force $building_runtime $buildfolder/$vfsname.new' failed\n$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
#
#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 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:"
foreach {placeholder value} $tagmap {
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 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]} {
set fd [open $fpath r]; fconfigure $fd -translation binary; set data [read $fd]; close $fd
set data2 [string map $tagmap $data]
@ -458,7 +464,6 @@ namespace eval punk::mix::commandset::project {
puts stderr "warning: Missing template file $fpath"
}
}
#todo - tag substitutions in src/doc tree
::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
foreach p [list {*}$bootsupport_module_paths {*}$bootsupport_library_paths {*}$sourcesupport_module_paths {*}$sourcesupport_library_paths] {
#set contents [glob -nocomplain -dir $p -tail *]
if {![file exists $p]} {continue}
set contents [punkboot::lib::folder_nondotted_children $p]
set readmeposn [lsearch -nocase $contents readme.md]
#don't assume 'ledit' available
@ -3005,6 +3006,8 @@ foreach vfstail $vfs_tails {
#'archive' based zip offsets - editable in 7z,peazip
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
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
if {[catch {
file copy -force $building_runtime $buildfolder/$vfsname.new
catch {exec chmod +x $buildfolder/$vfsname.new}
} errM]} {
puts stderr "$kit_type 'file copy -force $building_runtime $buildfolder/$vfsname.new' failed\n$errM"
error $errM

48
src/project_layouts/vendor/punk/project-0.1/src/bootsupport/modules/README.md vendored

@ -1,24 +1,24 @@
This is primarily for tcl .tm modules required for your bootstrapping/make/build process.
It could include other files necessary for this process.
The .tm modules here may be required for your build script if it intended the installation operator uses an existing tclsh or other shell as opposed to a tclkit you may have for distribution which is more likely to include necessary libraries.
The modules here are loaded by your initialisation scripts and so can be a snapshot of different versions than those in your project src.
The modules can be your own, or 3rd party such as individual items from tcllib.
You can copy modules from a running punk shell to this location using the dev command.
e.g
dev lib.copyasmodule some::module::lib bootsupport
The dev command will help you pick the latest version, and will create any necessary file structure matching the namespace of the package.
e.g the result might be a file such as
<projectname>/src/bootsupport/some/module/lib-0.1.tm
The originating library may not yet be in .tm form.
You can copy a pkgIndex.tcl based library that is composed of a single .tcl file the same way using the above process and it will automatically name and file it appropriately but you need to check that the library doesn't require/load additional files - and that it is Tcl script only.
Always verify that the library is copyable in this manner and test in a shell with tcl::tm::path pointed to ./bootsupport that it works.
This is primarily for tcl .tm modules required for your bootstrapping/make/build process.
It could include other files necessary for this process.
The .tm modules here may be required for your build script if it intended the installation operator uses an existing tclsh or other shell as opposed to a tclkit you may have for distribution which is more likely to include necessary libraries.
The modules here are loaded by your initialisation scripts and so can be a snapshot of different versions than those in your project src.
The modules can be your own, or 3rd party such as individual items from tcllib.
You can copy modules from a running punk shell to this location using the dev command.
e.g
dev lib.copyasmodule some::module::lib bootsupport
The dev command will help you pick the latest version, and will create any necessary file structure matching the namespace of the package.
e.g the result might be a file such as
<projectname>/src/bootsupport/some/module/lib-0.1.tm
The originating library may not yet be in .tm form.
You can copy a pkgIndex.tcl based library that is composed of a single .tcl file the same way using the above process and it will automatically name and file it appropriately but you need to check that the library doesn't require/load additional files - and that it is Tcl script only.
Always verify that the library is copyable in this manner and test in a shell with tcl::tm::path pointed to ./bootsupport that it works.

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 test::tomlish\
c:/repo/jn/tclmodules/dictn/modules dictn\
c:/repo/jn/tclmodules/dollarcent/modules dollarcent\
]
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
#
#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 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:"
foreach {placeholder value} $tagmap {
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 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]} {
set fd [open $fpath r]; fconfigure $fd -translation binary; set data [read $fd]; close $fd
set data2 [string map $tagmap $data]
@ -458,7 +464,6 @@ namespace eval punk::mix::commandset::project {
puts stderr "warning: Missing template file $fpath"
}
}
#todo - tag substitutions in src/doc tree
::cd $projectdir

Loading…
Cancel
Save