summaryrefslogtreecommitdiffstats
path: root/library/init.tcl
diff options
context:
space:
mode:
authorhypnotoad <yoda@etoyoc.com>2017-12-29 20:40:29 (GMT)
committerhypnotoad <yoda@etoyoc.com>2017-12-29 20:40:29 (GMT)
commit983b089edb6d9c4f233f21a1792393758dea4f65 (patch)
tree49215652c944a50a270a9a4ac5c905caf64bb11a /library/init.tcl
parent47c7771af1ba8080797098c3f3840e376c800f2d (diff)
downloadtcl-983b089edb6d9c4f233f21a1792393758dea4f65.zip
tcl-983b089edb6d9c4f233f21a1792393758dea4f65.tar.gz
tcl-983b089edb6d9c4f233f21a1792393758dea4f65.tar.bz2
Removing the standalone pkgIndex.tcl. There is enough stuff that needs to be
manually edited in the init.tcl script for new releases as it is, there is no sense in having yet another file to edit. Marking which distributed packages are safe to load in a safe interpreter
Diffstat (limited to 'library/init.tcl')
-rw-r--r--library/init.tcl25
1 files changed, 21 insertions, 4 deletions
diff --git a/library/init.tcl b/library/init.tcl
index d4a66e2..e58dcfc 100644
--- a/library/init.tcl
+++ b/library/init.tcl
@@ -6,7 +6,10 @@
# Copyright (c) 1991-1993 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 Scriptics Corporation.
-# Copyright (c) 2004 by Kevin B. Kenny. All rights reserved.
+# Copyright (c) 2004 by Kevin B. Kenny.
+# Copyright (c) 2018 by Sean Woods
+#
+# All rights reserved.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -795,7 +798,21 @@ proc tcl::CopyDirectory {action src dest} {
}
return
}
-if {[file exists [file join $::tcl_library pkgIndex.tcl]]} {
- set dir $::tcl_library
- source [file join $::tcl_library pkgIndex.tcl]
+set isafe [interp issafe]
+###
+# Package manifest for all Tcl packages included in the /library file system
+###
+set isafe [interp issafe]
+set dir [file dirname [info script]]
+foreach {safe package version file} {
+ 0 http 2.8.12 {http http.tcl}
+ 0 http 1.0 {http1.0 http.tcl}
+ 1 msgcat 1.6.1 {msgcat msgcat.tcl}
+ 1 opt 0.4.7 {opt optparse.tcl}
+ 0 platform 1.0.14 {platform platform.tcl}
+ 0 platform::shell 1.1.4 {platform shell.tcl}
+ 1 tcltest 2.4.1 {tcltest tcltest.tcl}
+} {
+ if {$isafe && !$safe} continue
+ package ifneeded $package $version [list source [file join $dir {*}$file]]
}