From ce9a74ca72f0eefdadd0c9babf03ba79ee9b6578 Mon Sep 17 00:00:00 2001 From: Andreas Kupries Date: Fri, 6 Feb 2009 19:13:27 +0000 Subject: [PATCH] * library/vfs.tcl.in: New file encapsulating the package load process. Cleaner than the loadvfs proc, and much more suitable for conversion to a teabag. * pkgIndex.tcl.in: Cleaned up the declarations for package 'vfs'. Removed the 'vfslib' package, it never was such. * Makefile.in: Added installation of library/vfs.tcl. * configure.in: Added library/vfs.tcl.in. * configure: Regenerated. * win/makefile.vc: Updated the windows build file to configure vfs.tcl.in, and install vfs.tcl. --- ChangeLog | 18 +++++++++++++++++- Makefile.in | 11 ++++++++++- configure | 21 +++++++++++---------- configure.in | 4 ++-- library/vfs.tcl.in | 36 ++++++++++++++++++++++++++++++++++++ pkgIndex.tcl.in | 26 +++----------------------- win/makefile.vc | 13 +++++++++++-- 7 files changed, 90 insertions(+), 39 deletions(-) create mode 100644 library/vfs.tcl.in diff --git a/ChangeLog b/ChangeLog index d3b1b4b..85b24af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2009-02-06 Andreas Kupries + + * library/vfs.tcl.in: New file encapsulating the package load + process. Cleaner than the loadvfs proc, and much more suitable for + conversion to a teabag. + + * pkgIndex.tcl.in: Cleaned up the declarations for package 'vfs'. + Removed the 'vfslib' package, it never was such. + + * Makefile.in: Added installation of library/vfs.tcl. + * configure.in: Added library/vfs.tcl.in. + * configure: Regenerated. + + * win/makefile.vc: Updated the windows build file to configure + vfs.tcl.in, and install vfs.tcl. + 2009-01-22 Pat Thoyts * tests/vfslib.test: Make use of the core zlib and refchan features @@ -21,7 +37,7 @@ 2008-12-22 Pat Thoyts - * library/mk4vfs.tcl: Fix vfs::ztream to support 8.6 core zlib + * library/mk4vfs.tcl: Fix vfs::zstream to support 8.6 core zlib * library/vfslib.tcl: 2008-12-12 Pat Thoyts diff --git a/Makefile.in b/Makefile.in index 4447a4f..97eea0f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -36,6 +36,10 @@ PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@ # this package that need to be installed, if any. #======================================================================== +# vfs.tcl is found in the build, as it was generated by configure from +# library/vfs.tcl.in. This necessitated extensions to the target +# install-lib-binaries. + PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ \ ftpvfs.tcl httpvfs.tcl mk4vfs.tcl starkit.tcl \ tarvfs.tcl tclprocvfs.tcl testvfs.tcl \ @@ -45,7 +49,7 @@ PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ \ template/fishvfs.tcl template/globfind.tcl \ template/quotavfs.tcl template/tdelta.tcl \ template/templatevfs.tcl template/versionvfs.tcl \ - template/chrootvfs.tcl + template/chrootvfs.tcl vfs.tcl #======================================================================== @@ -334,6 +338,11 @@ install-lib-binaries: echo " $$p"; \ mkdir -p $(DESTDIR)$(pkglibdir)/$$destd; \ $(INSTALL_DATA) $(srcdir)/library/$$p $(DESTDIR)$(pkglibdir)/$$p; \ + elif test -f $(top_builddir)/library/$$p; then \ + destd=`dirname $$p`; \ + echo " $$p (generated)"; \ + mkdir -p $(DESTDIR)$(pkglibdir)/$$destd; \ + $(INSTALL_DATA) $(top_builddir)/library/$$p $(DESTDIR)$(pkglibdir)/$$p; \ fi; \ done @echo "Installing pkgIndex.tcl in $(DESTDIR)$(pkglibdir)"; diff --git a/configure b/configure index 6b1c5cb..48285f3 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for vfs 1.4. +# Generated by GNU Autoconf 2.59 for vfs 1.4.1. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation @@ -267,8 +267,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='vfs' PACKAGE_TARNAME='vfs' -PACKAGE_VERSION='1.4' -PACKAGE_STRING='vfs 1.4' +PACKAGE_VERSION='1.4.1' +PACKAGE_STRING='vfs 1.4.1' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. @@ -777,7 +777,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures vfs 1.4 to adapt to many kinds of systems. +\`configure' configures vfs 1.4.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -834,7 +834,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of vfs 1.4:";; + short | recursive ) echo "Configuration of vfs 1.4.1:";; esac cat <<\_ACEOF @@ -966,7 +966,7 @@ fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -vfs configure 1.4 +vfs configure 1.4.1 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. @@ -980,7 +980,7 @@ cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by vfs $as_me 1.4, which was +It was created by vfs $as_me 1.4.1, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -10308,7 +10308,7 @@ echo "${ECHO_T}${TCLSH_PROG}" >&6 - ac_config_files="$ac_config_files Makefile pkgIndex.tcl" + ac_config_files="$ac_config_files Makefile pkgIndex.tcl library/vfs.tcl" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -10703,7 +10703,7 @@ _ASBOX } >&5 cat >&5 <<_CSEOF -This file was extended by vfs $as_me 1.4, which was +This file was extended by vfs $as_me 1.4.1, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -10758,7 +10758,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -vfs config.status 1.4 +vfs config.status 1.4.1 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" @@ -10863,6 +10863,7 @@ do # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "pkgIndex.tcl" ) CONFIG_FILES="$CONFIG_FILES pkgIndex.tcl" ;; + "library/vfs.tcl" ) CONFIG_FILES="$CONFIG_FILES library/vfs.tcl" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; diff --git a/configure.in b/configure.in index 23936d7..e4b8276 100644 --- a/configure.in +++ b/configure.in @@ -13,7 +13,7 @@ dnl to configure the system for the local environment. # http://www.tcl.tk/ Tcl Developer Exchange #-------------------------------------------------------------------- -AC_INIT([vfs], [1.4]) +AC_INIT([vfs], [1.4.1]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. @@ -80,4 +80,4 @@ TEA_MAKE_LIB TEA_PROG_TCLSH -AC_OUTPUT([Makefile pkgIndex.tcl]) +AC_OUTPUT([Makefile pkgIndex.tcl library/vfs.tcl]) diff --git a/library/vfs.tcl.in b/library/vfs.tcl.in new file mode 100644 index 0000000..cea8334 --- /dev/null +++ b/library/vfs.tcl.in @@ -0,0 +1,36 @@ +# -*- tcl -*- + +# Activate the binary and Tcl parts of the package, in the proper +# order. + +# The location of the Tcl parts can be redirected via the environment +# variable VFS_LIBRARY. This is for use by testing of tclvfs without +# having to actually install the package. In that case the location of +# the binary part is redirected through the environment variable +# TCLLIBPATH (indirect modification of the auto_path). Not used here +# however, but by Tcl's package management code itself when searching +# for the package. + +namespace eval ::vfs { + variable self [file dirname [info script]] + variable redir [info exists ::env(VFS_LIBRARY)] + variable corezip [package vsatisfies [package provide Tcl] 8.6] +} + +if {[lsearch -exact $::auto_path $::vfs::self] == -1} { + lappend ::auto_path $::vfs::self +} + +load [file join $::vfs::self @PKG_LIB_FILE@] + +if {$::vfs::redir} { + set ::vfs::self $::env(VFS_LIBRARY) +} + +source [file join $::vfs::self vfsUtils.tcl] + +if {$::vfs::corezip} { + source [file join $::vfs::self vfslib.tcl] +} + +unset ::vfs::self ::vfs::redir ::vfs::corezip diff --git a/pkgIndex.tcl.in b/pkgIndex.tcl.in index 88e5a35..e5c6a78 100644 --- a/pkgIndex.tcl.in +++ b/pkgIndex.tcl.in @@ -1,3 +1,4 @@ +# -*- tcl -*- # Tcl package index file, version 1.1 # This file was generated by hand. # @@ -11,30 +12,9 @@ if {[package provide Tcl] < 8.4} { } package require Tcl 8.4 -namespace eval ::vfs {} -variable ::vfs::dll [file join $dir @PKG_LIB_FILE@] +package ifneeded vfs @PACKAGE_VERSION@ [list source [file join $dir vfs.tcl]] -proc ::vfs::loadvfs {libdir dll} { - if {![file exists $dll]} { return } - set dir [file dirname $dll] - if {[lsearch -exact $::auto_path $dir] == -1} { - lappend ::auto_path $dir - } - uplevel #0 [list load $dll] - uplevel #0 [list source [file join $libdir vfsUtils.tcl]] - if {[package vsatisfies [package provide Tcl] 8.6]} { - uplevel #0 [list source [file join $libdir vfslib.tcl]] - } -} - -# Allow optional redirect of VFS_LIBRARY components. Only necessary -# for testing, but could be used elsewhere. -if {[info exists ::env(VFS_LIBRARY)]} { set dir $::env(VFS_LIBRARY) } - -package ifneeded vfs @PACKAGE_VERSION@ [list ::vfs::loadvfs $dir $vfs::dll] - -package ifneeded starkit 1.3.3 [list source [file join $dir starkit.tcl]] -package ifneeded vfslib 1.4 [list source [file join $dir vfslib.tcl]] +package ifneeded starkit 1.3.3 [list source [file join $dir starkit.tcl]] # New, for the old, keep version numbers synchronized. package ifneeded vfs::mk4 1.10.1 [list source [file join $dir mk4vfs.tcl]] diff --git a/win/makefile.vc b/win/makefile.vc index 2080b0c..f494cd7 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -352,7 +352,7 @@ TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT) all: setup $(PROJECT) $(PROJECT): setup $(PRJLIB) pkgIndex install: install-binaries install-libraries install-docs -pkgIndex: setup $(OUT_DIR)\pkgIndex.tcl +pkgIndex: setup $(OUT_DIR)\pkgIndex.tcl $(OUT_DIR)\vfs.tcl test: setup $(PROJECT) @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) @@ -451,7 +451,7 @@ $< # #------------------------------------------------------------------------- -.PHONY: $(OUT_DIR)\pkgIndex.tcl +.PHONY: $(OUT_DIR)\pkgIndex.tcl $(OUT_DIR)\vfs.tcl $(OUT_DIR)\pkgIndex.tcl: $(ROOT)\pkgIndex.tcl.in nmakehlp -s << $** > $@ @@ -460,6 +460,13 @@ $(OUT_DIR)\pkgIndex.tcl: $(ROOT)\pkgIndex.tcl.in @PKG_LIB_FILE@ $(PRJLIBNAME) << +$(OUT_DIR)\vfs.tcl: $(ROOT)\library\vfs.tcl.in + nmakehlp -s << $** > $@ +@PACKAGE_NAME@ $(PROJECT) +@PACKAGE_VERSION@ $(DOTVERSION) +@PKG_LIB_FILE@ $(PRJLIBNAME) +<< + #--------------------------------------------------------------------- # Installation. (EDIT) # @@ -476,6 +483,8 @@ install-binaries: install-libraries: pkgIndex @echo Installing libraries to '$(SCRIPT_INSTALL_DIR)' @if exist $(LIBDIR) $(CPY) $(LIBDIR)\*.tcl "$(SCRIPT_INSTALL_DIR)" + @echo Installing package entrypoint in '$(SCRIPT_INSTALL_DIR)' + @$(CPY) $(OUT_DIR)\vfs.tcl "$(SCRIPT_INSTALL_DIR)" @echo Installing package index in '$(SCRIPT_INSTALL_DIR)' @$(CPY) $(OUT_DIR)\pkgIndex.tcl "$(SCRIPT_INSTALL_DIR)" -- 2.23.0