From b809905a9958545a4bbe6f16d5618ca25b72a5d2 Mon Sep 17 00:00:00 2001 From: Julian Noble Date: Tue, 23 Dec 2025 12:34:38 +1100 Subject: [PATCH] punk::libunknown ensure source performed in global scope --- src/bootsupport/modules/punk/libunknown-0.1.tm | 6 ++++-- src/modules/punk/libunknown-0.1.tm | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/bootsupport/modules/punk/libunknown-0.1.tm b/src/bootsupport/modules/punk/libunknown-0.1.tm index 2b63010c..ce35138e 100644 --- a/src/bootsupport/modules/punk/libunknown-0.1.tm +++ b/src/bootsupport/modules/punk/libunknown-0.1.tm @@ -444,6 +444,8 @@ tcl::namespace::eval ::punk::libunknown { proc zipfs_tclPkgUnknown {name args} { #puts "-> zipfs_tclPkgUnknown $name $args EXPERIMENTAL" + global dir + variable epoch set pkg_epoch [dict get $epoch pkg current] @@ -609,7 +611,7 @@ tcl::namespace::eval ::punk::libunknown { incr sourced ;#count as sourced even if source fails; keep before actual source action #::tcl::Pkg::source $file #lappend sourced_files $file - tcl_Pkg_source $file + namespace eval :: [list ::punk::libunknown::tcl_Pkg_source $file] } trap {POSIX EACCES} {} { # $file was not readable; silently ignore puts stderr "zipfs_tclPkgUnknown file unreadable '$file' while trying to load $name (1)" @@ -640,7 +642,7 @@ tcl::namespace::eval ::punk::libunknown { incr sourced #lappend sourced_files $file #::tcl::Pkg::source $file - tcl_Pkg_source $file + namespace eval :: [list punk::libunknown::tcl_Pkg_source $file] } trap {POSIX EACCES} {} { # $file was not readable; silently ignore puts stderr "zipfs_tclPkgUnknown file unreadable '$file' while trying to load $name (2)" diff --git a/src/modules/punk/libunknown-0.1.tm b/src/modules/punk/libunknown-0.1.tm index 2b63010c..ce35138e 100644 --- a/src/modules/punk/libunknown-0.1.tm +++ b/src/modules/punk/libunknown-0.1.tm @@ -444,6 +444,8 @@ tcl::namespace::eval ::punk::libunknown { proc zipfs_tclPkgUnknown {name args} { #puts "-> zipfs_tclPkgUnknown $name $args EXPERIMENTAL" + global dir + variable epoch set pkg_epoch [dict get $epoch pkg current] @@ -609,7 +611,7 @@ tcl::namespace::eval ::punk::libunknown { incr sourced ;#count as sourced even if source fails; keep before actual source action #::tcl::Pkg::source $file #lappend sourced_files $file - tcl_Pkg_source $file + namespace eval :: [list ::punk::libunknown::tcl_Pkg_source $file] } trap {POSIX EACCES} {} { # $file was not readable; silently ignore puts stderr "zipfs_tclPkgUnknown file unreadable '$file' while trying to load $name (1)" @@ -640,7 +642,7 @@ tcl::namespace::eval ::punk::libunknown { incr sourced #lappend sourced_files $file #::tcl::Pkg::source $file - tcl_Pkg_source $file + namespace eval :: [list punk::libunknown::tcl_Pkg_source $file] } trap {POSIX EACCES} {} { # $file was not readable; silently ignore puts stderr "zipfs_tclPkgUnknown file unreadable '$file' while trying to load $name (2)"