From 6c69cf8504626ca091607ff500979c1f738cefb1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 31 Aug 2020 13:12:01 +0000 Subject: opt package: Change comment. 0.4.7 -> 0.4.8. More Master -> Parent and Slave -> Child changes in (internal) library and test-cases --- library/auto.tcl | 2 +- library/clock.tcl | 4 ++-- library/opt/optparse.tcl | 6 +++--- library/opt/pkgIndex.tcl | 2 +- library/package.tcl | 2 +- library/safe.tcl | 14 ++++++------- tests/interp.test | 52 +++++++++++++++++++++++------------------------ tests/opt.test | 2 +- tests/safe-stock86.test | 4 ++-- tests/safe.test | 30 +++++++++++++-------------- tools/checkLibraryDoc.tcl | 1 + tools/tcltk-man2html.tcl | 1 + 12 files changed, 61 insertions(+), 59 deletions(-) diff --git a/library/auto.tcl b/library/auto.tcl index a7a8979..27173df 100644 --- a/library/auto.tcl +++ b/library/auto.tcl @@ -377,7 +377,7 @@ proc auto_mkindex_parser::mkindex {file} { # auto_mkindex_parser::hook command # # Registers a Tcl command to evaluate when initializing the slave interpreter -# used by the mkindex parser. The command is evaluated in the master +# used by the mkindex parser. The command is evaluated in the parent # interpreter, and can use the variable auto_mkindex_parser::parser to get to # the slave diff --git a/library/clock.tcl b/library/clock.tcl index 49dfdbe..2e42a98 100644 --- a/library/clock.tcl +++ b/library/clock.tcl @@ -3304,7 +3304,7 @@ proc ::tcl::clock::LoadTimeZoneFile { fileName } { return } - # Since an unsafe interp uses the [clock] command in the master, this code + # Since an unsafe interp uses the [clock] command in the parent, this code # is security sensitive. Make sure that the path name cannot escape the # given directory. @@ -3344,7 +3344,7 @@ proc ::tcl::clock::LoadTimeZoneFile { fileName } { proc ::tcl::clock::LoadZoneinfoFile { fileName } { variable ZoneinfoPaths - # Since an unsafe interp uses the [clock] command in the master, this code + # Since an unsafe interp uses the [clock] command in the parent, this code # is security sensitive. Make sure that the path name cannot escape the # given directory. diff --git a/library/opt/optparse.tcl b/library/opt/optparse.tcl index c8946fd..1639379 100644 --- a/library/opt/optparse.tcl +++ b/library/opt/optparse.tcl @@ -11,7 +11,7 @@ package require Tcl 8.5- # When this version number changes, update the pkgIndex.tcl file # and the install directory in the Makefiles. -package provide opt 0.4.7 +package provide opt 0.4.8 namespace eval ::tcl { @@ -44,8 +44,8 @@ namespace eval ::tcl { {-intflag 7} {-weirdflag "help string"} {-noStatics "Not ok to load static packages"} - {-nestedloading1 true "OK to load into nested slaves"} - {-nestedloading2 -boolean true "OK to load into nested slaves"} + {-nestedloading1 true "OK to load into nested children"} + {-nestedloading2 -boolean true "OK to load into nested children"} {-libsOK -choice {Tk SybTcl} "List of packages that can be loaded"} {-precision -int 12 "Number of digits of precision"} diff --git a/library/opt/pkgIndex.tcl b/library/opt/pkgIndex.tcl index daf9aa9..23e118c 100644 --- a/library/opt/pkgIndex.tcl +++ b/library/opt/pkgIndex.tcl @@ -9,4 +9,4 @@ # full path name of this file's directory. if {![package vsatisfies [package provide Tcl] 8.5-]} {return} -package ifneeded opt 0.4.7 [list source [file join $dir optparse.tcl]] +package ifneeded opt 0.4.8 [list source [file join $dir optparse.tcl]] diff --git a/library/package.tcl b/library/package.tcl index d6280ae..4a73346 100644 --- a/library/package.tcl +++ b/library/package.tcl @@ -237,7 +237,7 @@ proc pkg_mkIndex {args} { $c eval [list set ::tcl::file $file] $c eval [list set ::tcl::direct $direct] - # Download needed procedures into the slave because we've just deleted + # Download needed procedures into the child because we've just deleted # the unknown procedure. This doesn't handle procedures with default # arguments. diff --git a/library/safe.tcl b/library/safe.tcl index 352b302..96177d5 100644 --- a/library/safe.tcl +++ b/library/safe.tcl @@ -2,7 +2,7 @@ # # This file provide a safe loading/sourcing mechanism for safe interpreters. # It implements a virtual path mecanism to hide the real pathnames from the -# slave. It runs in a master interpreter and sets up data structure and +# slave. It runs in a parent interpreter and sets up data structure and # aliases that will be invoked when used from a slave interpreter. # # See the safe.n man page for details. @@ -20,7 +20,7 @@ # # Needed utilities package -package require opt 0.4.7 +package require opt 0.4.8 # Create the safe namespace namespace eval ::safe { @@ -270,7 +270,7 @@ proc ::safe::interpConfigure {args} { # Optional Arguments : # + slave name : if empty, generated name will be used # + access_path: path list controlling where load/source can occur, -# if empty: the master auto_path will be used. +# if empty: the parent auto_path will be used. # + staticsok : flag, if 0 :no static package can be loaded (load {} Xxx) # if 1 :static packages are ok. # + nestedok: flag, if 0 :no loading to sub-sub interps (load xx xx sub) @@ -302,7 +302,7 @@ proc ::safe::InterpCreate { # # InterpSetConfig (was setAccessPath) : # Sets up slave virtual auto_path and corresponding structure within -# the master. Also sets the tcl_library in the slave to be the first +# the parent. Also sets the tcl_library in the slave to be the first # directory in the path. # NB: If you change the path after the slave has been initialized you # probably need to call "auto_reset" in the slave in order that it gets @@ -595,7 +595,7 @@ proc ::safe::interpDelete {slave} { # Base. To clean up properly, we call safe::interpDelete recursively on each # Safe Base sub-interpreter, so each one is deleted cleanly and not by # the automatic mechanism built into [interp delete]. - foreach sub [interp slaves $slave] { + foreach sub [interp children $slave] { if {[info exists ::safe::[VarName [list $slave $sub]]]} { ::safe::interpDelete [list $slave $sub] } @@ -667,7 +667,7 @@ proc ::safe::setLogCmd {args} { # ------------------- END OF PUBLIC METHODS ------------ # -# Sets the slave auto_path to the master recorded value. Also sets +# Sets the slave auto_path to the parent recorded value. Also sets # tcl_library to the first token of the virtual path. # proc ::safe::SyncAccessPath {slave} { @@ -1081,7 +1081,7 @@ proc ::safe::AliasLoad {slave file args} { } # FileInAccessPath raises an error if the file is not found in the list of -# directories contained in the (master side recorded) slave's access path. +# directories contained in the (parent side recorded) slave's access path. # the security here relies on "file dirname" answering the proper # result... needs checking ? diff --git a/tests/interp.test b/tests/interp.test index df94678..3fe8c67 100644 --- a/tests/interp.test +++ b/tests/interp.test @@ -22,7 +22,7 @@ testConstraint testinterpdelete [llength [info commands testinterpdelete]] set hidden_cmds {cd encoding exec exit fconfigure file glob load open pwd socket source tcl:encoding:dirs tcl:file:atime tcl:file:attributes tcl:file:copy tcl:file:delete tcl:file:dirname tcl:file:executable tcl:file:exists tcl:file:extension tcl:file:isdirectory tcl:file:isfile tcl:file:link tcl:file:lstat tcl:file:mkdir tcl:file:mtime tcl:file:nativename tcl:file:normalize tcl:file:owned tcl:file:readable tcl:file:readlink tcl:file:rename tcl:file:rootname tcl:file:size tcl:file:stat tcl:file:tail tcl:file:tempfile tcl:file:type tcl:file:volumes tcl:file:writable unload} -foreach i [interp slaves] { +foreach i [interp children] { interp delete $i } @@ -46,8 +46,8 @@ test interp-1.5 {options for interp command} -returnCodes error -body { # test interp-0.6 was removed # test interp-1.6 {options for interp command} -returnCodes error -body { - interp slaves foo bar zop -} -result {wrong # args: should be "interp slaves ?path?"} + interp children foo bar zop +} -result {wrong # args: should be "interp children ?path?"} test interp-1.7 {options for interp command} -returnCodes error -body { interp hello } -result {bad option "hello": must be alias, aliases, bgerror, cancel, children, create, debug, delete, eval, exists, expose, hide, hidden, issafe, invokehidden, limit, marktrusted, recursionlimit, slaves, share, target, or transfer} @@ -120,45 +120,45 @@ test interp-2.13 {correct default when no $path arg is given} -body { interp create -- } -match regexp -result {interp[0-9]+} -foreach i [interp slaves] { +foreach i [interp children] { interp delete $i } -# Part 2: Testing "interp slaves" and "interp exists" -test interp-3.1 {testing interp exists and interp slaves} { - interp slaves +# Part 2: Testing "interp children" and "interp exists" +test interp-3.1 {testing interp exists and interp children} { + interp children } "" -test interp-3.2 {testing interp exists and interp slaves} { +test interp-3.2 {testing interp exists and interp children} { interp create a interp exists a } 1 -test interp-3.3 {testing interp exists and interp slaves} { +test interp-3.3 {testing interp exists and interp children} { interp exists nonexistent } 0 -test interp-3.4 {testing interp exists and interp slaves} -body { - interp slaves a b c -} -returnCodes error -result {wrong # args: should be "interp slaves ?path?"} -test interp-3.5 {testing interp exists and interp slaves} -body { +test interp-3.4 {testing interp exists and interp children} -body { + interp children a b c +} -returnCodes error -result {wrong # args: should be "interp children ?path?"} +test interp-3.5 {testing interp exists and interp children} -body { interp exists a b c } -returnCodes error -result {wrong # args: should be "interp exists ?path?"} -test interp-3.6 {testing interp exists and interp slaves} { +test interp-3.6 {testing interp exists and interp children} { interp exists } 1 -test interp-3.7 {testing interp exists and interp slaves} -setup { +test interp-3.7 {testing interp exists and interp children} -setup { catch {interp create a} } -body { - interp slaves + interp children } -result a -test interp-3.8 {testing interp exists and interp slaves} -body { - interp slaves a b c -} -returnCodes error -result {wrong # args: should be "interp slaves ?path?"} -test interp-3.9 {testing interp exists and interp slaves} -setup { +test interp-3.8 {testing interp exists and interp children} -body { + interp children a b c +} -returnCodes error -result {wrong # args: should be "interp children ?path?"} +test interp-3.9 {testing interp exists and interp children} -setup { catch {interp create a} } -body { interp create {a a2} -safe - expr {"a2" in [interp slaves a]} + expr {"a2" in [interp children a]} } -result 1 -test interp-3.10 {testing interp exists and interp slaves} -setup { +test interp-3.10 {testing interp exists and interp children} -setup { catch {interp create a} catch {interp create {a a2}} } -body { @@ -186,7 +186,7 @@ test interp-4.5 {testing interp delete} { interp create a interp create {a x1} interp delete {a x1} - expr {"x1" in [interp slaves a]} + expr {"x1" in [interp children a]} } 0 test interp-4.6 {testing interp delete} { interp create c1 @@ -203,14 +203,14 @@ test interp-4.8 {testing interp delete} -returnCodes error -body { interp delete {} } -result {cannot delete the current interpreter} -foreach i [interp slaves] { +foreach i [interp children] { interp delete $i } # Part 4: Consistency checking - all nondeleted interpreters should be # there: test interp-5.1 {testing consistency} { - interp slaves + interp children } "" test interp-5.2 {testing consistency} { interp exists a @@ -3667,7 +3667,7 @@ test interp-38.8 {interp debug basic setup} -body { # cleanup unset -nocomplain hidden_cmds -foreach i [interp slaves] { +foreach i [interp children] { interp delete $i } ::tcltest::cleanupTests diff --git a/tests/opt.test b/tests/opt.test index 14a6e04..7ed25b5 100644 --- a/tests/opt.test +++ b/tests/opt.test @@ -17,7 +17,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} { } # the package we are going to test -package require opt 0.4.7 +package require opt 0.4.8 # we are using implementation specifics to test the package diff --git a/tests/safe-stock86.test b/tests/safe-stock86.test index ccfdd3f..3f20d77 100644 --- a/tests/safe-stock86.test +++ b/tests/safe-stock86.test @@ -25,7 +25,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} { namespace import -force ::tcltest::* } -foreach i [interp slaves] { +foreach i [interp children] { interp delete $i } @@ -56,7 +56,7 @@ test safe-stock86-7.1 {tests that everything works at high level, uses http 2} - set i [safe::interpCreate] # no error shall occur: # (because the default access_path shall include 1st level sub dirs so - # package require in a slave works like in the master) + # package require in a slave works like in the parent) set v [interp eval $i {package require http 2}] # no error shall occur: interp eval $i {http::config} diff --git a/tests/safe.test b/tests/safe.test index eba6057..217200c 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -28,7 +28,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} { namespace import -force ::tcltest::* } -foreach i [interp slaves] { +foreach i [interp children] { interp delete $i } @@ -176,7 +176,7 @@ test safe-4.6 {safe::interpDelete, indirectly} -setup { # A replacement test using example files is "safe-9.8". # Tests 5.* test the example files before using them to test safe interpreters. -test safe-5.1 {example tclIndex commands, test in master interpreter} -setup { +test safe-5.1 {example tclIndex commands, test in parent interpreter} -setup { set tmpAutoPath $::auto_path lappend ::auto_path [file join $TestsDir auto0 auto1] [file join $TestsDir auto0 auto2] } -body { @@ -190,7 +190,7 @@ test safe-5.1 {example tclIndex commands, test in master interpreter} -setup { set ::auto_path $tmpAutoPath auto_reset } -match glob -result {0 ok1 0 ok2} -test safe-5.2 {example tclIndex commands, negative test in master interpreter} -setup { +test safe-5.2 {example tclIndex commands, negative test in parent interpreter} -setup { set tmpAutoPath $::auto_path lappend ::auto_path [file join $TestsDir auto0] } -body { @@ -204,7 +204,7 @@ test safe-5.2 {example tclIndex commands, negative test in master interpreter} - set ::auto_path $tmpAutoPath auto_reset } -match glob -result {1 {invalid command name "report1"} 1 {invalid command name "report2"}} -test safe-5.3 {example pkgIndex.tcl packages, test in master interpreter, child directories} -setup { +test safe-5.3 {example pkgIndex.tcl packages, test in parent interpreter, child directories} -setup { set tmpAutoPath $::auto_path lappend ::auto_path [file join $TestsDir auto0] } -body { @@ -221,7 +221,7 @@ test safe-5.3 {example pkgIndex.tcl packages, test in master interpreter, child catch {rename HeresPackage1 {}} catch {rename HeresPackage2 {}} } -match glob -result {0 1.2.3 0 2.3.4 0 OK1 0 OK2} -test safe-5.4 {example pkgIndex.tcl packages, test in master interpreter, main directories} -setup { +test safe-5.4 {example pkgIndex.tcl packages, test in parent interpreter, main directories} -setup { set tmpAutoPath $::auto_path lappend ::auto_path [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2] @@ -239,7 +239,7 @@ test safe-5.4 {example pkgIndex.tcl packages, test in master interpreter, main d catch {rename HeresPackage1 {}} catch {rename HeresPackage2 {}} } -match glob -result {0 1.2.3 0 2.3.4 0 OK1 0 OK2} -test safe-5.5 {example modules packages, test in master interpreter, replace path} -setup { +test safe-5.5 {example modules packages, test in parent interpreter, replace path} -setup { set oldTm [tcl::tm::path list] foreach path $oldTm { tcl::tm::path remove $path @@ -265,7 +265,7 @@ test safe-5.5 {example modules packages, test in master interpreter, replace pat catch {namespace delete ::test0} catch {namespace delete ::mod1} } -match glob -result {0 0.5 0 1.0 0 2.0 -- res0 res1 res2} -test safe-5.6 {example modules packages, test in master interpreter, append to path} -setup { +test safe-5.6 {example modules packages, test in parent interpreter, append to path} -setup { tcl::tm::path add [file join $TestsDir auto0 modules] } -body { # Try to load the modules and run a command from each one. @@ -325,7 +325,7 @@ test safe-7.1 {tests that everything works at high level} -setup { } -body { # no error shall occur: # (because the default access_path shall include 1st level sub dirs so - # package require in a slave works like in the master) + # package require in a child works like in the parent) set v [interp eval $i {package require SafeTestPackage1}] # no error shall occur: interp eval $i {HeresPackage1} @@ -338,9 +338,9 @@ test safe-7.2 {tests specific path and interpFind/AddToAccessPath} -setup { set i [safe::interpCreate -nostat -nested 1 -accessPath [list [info library]]] # should not add anything (p0) set token1 [safe::interpAddToAccessPath $i [info library]] - # should add as p* (not p1 if master has a module path) + # should add as p* (not p1 if parent has a module path) set token2 [safe::interpAddToAccessPath $i "/dummy/unixlike/test/path"] - # should add as p* (not p2 if master has a module path) + # should add as p* (not p2 if parent has a module path) set token3 [safe::interpAddToAccessPath $i [file join $TestsDir auto0]] set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] @@ -354,7 +354,7 @@ test safe-7.2 {tests specific path and interpFind/AddToAccessPath} -setup { 1 {can't find package SafeTestPackage1} --\ {TCLLIB */dummy/unixlike/test/path TESTSDIR/auto0} -- {}} test safe-7.3 {check that safe subinterpreters work} { - set g [interp slaves] + set g [interp children] if {$g ne {}} { append g { -- residue of an earlier test} } @@ -369,7 +369,7 @@ test safe-7.3 {check that safe subinterpreters work} { } {{} {} ok {} 0 {}} test safe-7.3.1 {check that safe subinterpreters work with namespace names} -setup { } -body { - set g [interp slaves] + set g [interp children] if {$g ne {}} { append g { -- residue of an earlier test} } @@ -389,7 +389,7 @@ test safe-7.4 {tests specific path and positive search} -setup { set i [safe::interpCreate -nostat -nested 1 -accessPath [list [info library]]] # should not add anything (p0) set token1 [safe::interpAddToAccessPath $i [info library]] - # should add as p* (not p1 if master has a module path) + # should add as p* (not p1 if parent has a module path) set token2 [safe::interpAddToAccessPath $i [file join $TestsDir auto0 auto1]] set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] @@ -902,7 +902,7 @@ test safe-9.20 {check module loading} -setup { 0 0.5 0 1.0 0 2.0 --\ {TCLLIB TESTSDIR/auto0/modules TESTSDIR/auto0/modules/mod1\ TESTSDIR/auto0/modules/mod2} -- res0 res1 res2} -# - The command safe::InterpSetConfig adds the master's [tcl::tm::list] in +# - The command safe::InterpSetConfig adds the parent's [tcl::tm::list] in # tokenized form to the slave's access path, and then adds all the # descendants, discovered recursively by using glob. # - The order of the directories in the list returned by glob is system-dependent, @@ -1514,7 +1514,7 @@ rename buildEnvironment {} rename buildEnvironment2 {} #### Test for the module path -test safe-14.1 {Check that module path is the same as in the master interpreter [Bug 2964715]} -setup { +test safe-14.1 {Check that module path is the same as in the parent interpreter [Bug 2964715]} -setup { set i [safe::interpCreate] } -body { set tm {} diff --git a/tools/checkLibraryDoc.tcl b/tools/checkLibraryDoc.tcl index 6d147ac..d560b98 100755 --- a/tools/checkLibraryDoc.tcl +++ b/tools/checkLibraryDoc.tcl @@ -69,6 +69,7 @@ set StructList { Tk_GeomMgr \ Tk_Image \ Tk_ImageMaster \ + Tk_ImageModel \ Tk_ImageType \ Tk_Item \ Tk_ItemType \ diff --git a/tools/tcltk-man2html.tcl b/tools/tcltk-man2html.tcl index d607905..a7231f7 100755 --- a/tools/tcltk-man2html.tcl +++ b/tools/tcltk-man2html.tcl @@ -557,6 +557,7 @@ array set remap_link_target { Tk_Font Tk_GetFont Tk_Image Tk_GetImage Tk_ImageMaster Tk_GetImage + Tk_ImageModel Tk_GetImage Tk_ItemType Tk_CreateItemType Tk_Justify Tk_GetJustify Ttk_Theme Ttk_GetTheme -- cgit v0.12