From fcfb05f5d36322a8ecfdc033cdf8de9994f37e5b Mon Sep 17 00:00:00 2001 From: hypnotoad Date: Wed, 21 Nov 2018 00:40:32 +0000 Subject: Further refinements for the fix for bug [4e812aadae68af384605a5e78845abe40206fbe9] Moved the package manifest for the /library file system out of init.tcl file and into a new file "manifest.txt". If a VFS is populating tcl_library via a file copy it will rename that file to pkgIndex.tcl, which will allow all of the packages the core distributes in this way to be available via the standard package discovery mechanism (as tcl_library is already in the auto_path of an unmodified tcl interpreter. And if you've modified the tcl interpreter, you probably know better anyway. Probably...) --- library/init.tcl | 12 ------------ library/manifest.txt | 18 ++++++++++++++++++ unix/Makefile.in | 3 ++- win/Makefile.in | 1 + 4 files changed, 21 insertions(+), 13 deletions(-) create mode 100644 library/manifest.txt diff --git a/library/init.tcl b/library/init.tcl index 2e3ac23..1ccce27 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -798,15 +798,3 @@ proc tcl::CopyDirectory {action src dest} { } return } -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} { - 1 opt 0.4.7 {opt optparse.tcl} -} { - if {$isafe && !$safe} continue - package ifneeded $package $version [list source [file join $dir {*}$file]] -} diff --git a/library/manifest.txt b/library/manifest.txt new file mode 100644 index 0000000..11a755a --- /dev/null +++ b/library/manifest.txt @@ -0,0 +1,18 @@ +### +# Package manifest for all Tcl packages included in the /library file system +### +apply {{dir} { + set ::test [info script] + set isafe [interp issafe] + foreach {safe package version file} { + 0 http 2.9.0 {http http.tcl} + 1 msgcat 1.7.0 {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.5.0 {tcltest tcltest.tcl} + } { + if {$isafe && !$safe} continue + package ifneeded $package $version [list source [file join $dir {*}$file]] + } +}} $dir diff --git a/unix/Makefile.in b/unix/Makefile.in index 270cff7..6061298 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -681,7 +681,8 @@ ${TCL_ZIP_FILE}: ${ZIP_INSTALL_OBJS} @rm -rf ${TCL_VFS_ROOT} @mkdir -p ${TCL_VFS_PATH} cp -a $(TOP_DIR)/library/* ${TCL_VFS_PATH} - -find ${TCL_VFS_ROOT} -type d -empty -delete + cp -a ${TCL_VFS_PATH}/manifest.txt ${TCL_VFS_PATH}/pkgIndex.tcl + find ${TCL_VFS_ROOT} -type d -empty -delete ( cd ${TCL_VFS_ROOT} ; ${NATIVE_ZIP} ${ZIP_PROG_OPTIONS} ../${TCL_ZIP_FILE} ${ZIP_PROG_VFSSEARCH}) # The following target is configured by autoconf to generate either a shared diff --git a/win/Makefile.in b/win/Makefile.in index f57a160..fa9f4a7 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -487,6 +487,7 @@ ${TCL_ZIP_FILE}: ${ZIP_INSTALL_OBJS} ${DDE_DLL_FILE} ${REG_DLL_FILE} rm -rf ${TCL_VFS_ROOT} mkdir -p ${TCL_VFS_PATH} $(COPY) -a $(TOP_DIR)/library/* ${TCL_VFS_PATH} + $(COPY) -a ${TCL_VFS_PATH}/manfest.txt ${TCL_VFS_PATH}/pkgIndex.tcl $(COPY) ${DDE_DLL_FILE} ${TCL_VFS_PATH}/dde $(COPY) ${REG_DLL_FILE} ${TCL_VFS_PATH}/reg cd ${TCL_VFS_ROOT} ; ${NATIVE_ZIP} ${ZIP_PROG_OPTIONS} ../${TCL_ZIP_FILE} ${ZIP_PROG_VFSSEARCH} -- cgit v0.12