Overview
Comment: | Add more comments. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | pending |
Files: | files | file ages | folders |
SHA1: |
ffccb611a39a1b7776390a03e1e0f5db |
User & Date: | mistachkin on 2020-03-26 15:12:35 |
Other Links: | branch diff | manifest | tags |
Context
2020-03-27
| ||
20:58 | Various fixes related to package version checking and OpenPGP integration. check-in: 1ba61d8533 user: mistachkin tags: trunk | |
2020-03-26
| ||
15:12 | Add more comments. Closed-Leaf check-in: ffccb611a3 user: mistachkin tags: pending | |
14:52 | Add comments. check-in: cf6edd5132 user: mistachkin tags: pending | |
Changes
Modified client/1.0/neutral/pkgd.eagle from [3b1b700ac5] to [eff6e99d05].
︙ | |||
1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 | 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | # NOTE: This procedure creates a new interpreter, which may be "safe", and # places a reference to it in a variable in the context of the caller # identified by the varName argument. The created interpreter has a # fully functioning [package] command ensemble; all other commands do # nothing and return nothing. This procedure may raise script errors. # proc createInterp { varName } { # # NOTE: Prepare to provide the caller with the newly created interpreter # reference. # upvar 1 $varName interp # # NOTE: Create a "safe" interpreter and set the global "dir" variable to # a single period. Generally, this is the only variable used by a # package index file. It should be noted that since [set] will be # a NOP, attempts to use other variables in the specified package # index file (e.g. ones [set] within it) will fail. # set interp [interp create -safe] interp eval $interp [list set dir .] # # NOTE: First, obtain the list of child namespaces to delete, if any, and # then delete them all. This should leave the global namespace and # its commands / variables untouched. # set namespaces [interp eval $interp [list namespace children ::]] foreach namespace $namespaces { catch { interp eval $interp [list namespace delete $namespace] } } # # NOTE: Next, obtain the list of global commands and delete all of them # except the [proc] and [package] commands. The [proc] command is # handled specially (last) and the [package] command is retained. # set commands [interp eval $interp [list info commands]] foreach command $commands { if {$command ne "proc" && $command ne "package"} then { interp eval $interp [list proc $command args ""]; # NOP } } if {![isEagle]} then { # # HACK: The "safe" interpreters in native Tcl do not contain # the [file] command at all, not even for [file join] # and [file split], which may be used in package index # files; therefore, add it as a NOP command. # interp eval $interp [list proc file args ""]; # NOP } # # NOTE: Next, disable the [proc] command. This must be done last # because it is used to disable (i.e. via NOP) all the other # global commands. # interp eval $interp [list proc proc args ""]; # NOP # # NOTE: Finally, return nothing as the created interpreter reference # is placed directly into the variable specified by the caller. # return "" } # # NOTE: This procedure evaluates a script file and attempts to determine the # list of new [package ifneeded] scripts added by it. When successful # it returns a list-of-lists. Each element of the outer list contains |
︙ |