diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-12-21 09:42:57 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-12-21 09:42:57 (GMT) |
commit | 7cd696d234348fee7d05b41112028901a9d7cdad (patch) | |
tree | a0e4d31b5f4586f6d823db6c510f4a2b22e3c300 | |
parent | 9cbf765d3e88d3b7fae05fe2337f82c5486c1a11 (diff) | |
parent | f87e7cdade0bf88329c0502b62047b06a645b264 (diff) | |
download | tcl-7cd696d234348fee7d05b41112028901a9d7cdad.zip tcl-7cd696d234348fee7d05b41112028901a9d7cdad.tar.gz tcl-7cd696d234348fee7d05b41112028901a9d7cdad.tar.bz2 |
merge trunk
-rw-r--r-- | ChangeLog | 50 | ||||
-rw-r--r-- | changes | 4 | ||||
-rw-r--r-- | generic/tclCompCmdsSZ.c | 28 | ||||
-rw-r--r-- | generic/tclOO.h | 2 | ||||
-rw-r--r-- | generic/tclOOInfo.c | 26 | ||||
-rw-r--r-- | generic/tclStubLib.c | 39 | ||||
-rw-r--r-- | pkgs/package.list.txt | 2 | ||||
-rw-r--r-- | tests/oo.test | 2 | ||||
-rw-r--r-- | tests/ooNext2.test | 2 | ||||
-rwxr-xr-x | tools/tcltk-man2html.tcl | 57 | ||||
-rw-r--r-- | unix/Makefile.in | 3 | ||||
-rw-r--r-- | unix/dltest/pkgb.c | 29 | ||||
-rw-r--r-- | unix/tclooConfig.sh | 2 | ||||
-rw-r--r-- | win/tclooConfig.sh | 2 |
14 files changed, 158 insertions, 90 deletions
@@ -1,14 +1,50 @@ -2012-11-13 Miguel Sofer <msofer@users.sf.net> +2012-12-21 Jan Nijtmans <nijtmans@users.sf.net> - * generic/tclCmdAH.c (CatchObjCmdCallback): do not decrRefCount - the newValuePtr sent to Tcl_ObjSetVar2: TOSV2 is 'fire and - forget', it decrs on its own. Fix for [Bug 3595576], found by - andrewsh. + * unix/dltest/pkgb.c: Inline compat Tcl_GetDefaultEncodingDir. + * generic/tclStubLib.c: Eliminate unnecessary static HasStubSupport() and + isDigit() functions, just do the same inline. + +2012-12-18 Donal K. Fellows <dkf@users.sf.net> + + * generic/tclCompCmdsSZ.c (TclSubstCompile): Improved the sequence of + instructions issued for [subst] when dealing with simple variable + references. + +2012-12-14 Don Porter <dgp@users.sourceforge.net> + + *** 8.6.0 TAGGED FOR RELEASE *** + + * changes: updates for 8.6.0 + +2012-12-13 Don Porter <dgp@users.sourceforge.net> + + * generic/tclZlib.c: Repair same issue with misusing the + * tests/zlib.test: 'fire and forget' nature of Tcl_ObjSetVar2 + in the new TIP 400 implementation. + +2012-12-13 Miguel Sofer <msofer@users.sf.net> + + * generic/tclCmdAH.c: (CatchObjCmdCallback): do not decrRefCount + * tests/cmdAH.test: the newValuePtr sent to Tcl_ObjSetVar2: + TOSV2 is 'fire and forget', it decrs on its own. + Fix for [Bug 3595576], found by andrewsh. 2012-12-13 Jan Nijtmans <nijtmans@users.sf.net> - * generic/tcl.h: Fix Tcl_DecrRefCount macro such that it - doesn't access its objPtr parameter twice any more. + * generic/tcl.h: Fix Tcl_DecrRefCount macro such that it doesn't + access its objPtr parameter twice any more. + +2012-12-11 Don Porter <dgp@users.sourceforge.net> + + * generic/tcl.h: Bump version number to 8.6.0. + * library/init.tcl: + * unix/configure.in: + * win/configure.in: + * unix/tcl.spec: + * README: + + * unix/configure: autoconf-2.59 + * win/configure: 2012-12-10 Donal K. Fellows <dkf@users.sf.net> @@ -8158,4 +8158,8 @@ Dropped support for OS X versions less than 10.4 (Tiger) (fellows) 2012-12-03 (bug fix) [configure] query broke init from argv (porter) => tcltest 2.3.5 +2012-12-13 (bug fix)[3595576] crash: [catch {} -> noSuchNs::var] (sofer,porter) + +2012-12-13 (bug fix) crash: [zlib gunzip $data -header noSuchNs::var] (porter) + --- Released 8.6.0, December 20, 2012 --- See ChangeLog for details --- diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c index 9c93fb2..7bead0d 100644 --- a/generic/tclCompCmdsSZ.c +++ b/generic/tclCompCmdsSZ.c @@ -836,6 +836,34 @@ TclSubstCompile( TclEmitPush(literal, envPtr); count++; continue; + case TCL_TOKEN_VARIABLE: + /* + * Check for simple variable access; see if we can only generate + * TCL_OK or TCL_ERROR from the substituted variable read; if so, + * there is no need to generate elaborate exception-management + * code. Note that the first component of TCL_TOKEN_VARIABLE is + * always TCL_TOKEN_TEXT... + */ + + if (tokenPtr->numComponents > 1) { + int i, foundCommand = 0; + + for (i=2 ; i<=tokenPtr->numComponents ; i++) { + if (tokenPtr[i].type == TCL_TOKEN_COMMAND) { + foundCommand = 1; + break; + } + } + if (foundCommand) { + break; + } + } + + envPtr->line = bline; + TclCompileVarSubst(interp, tokenPtr, envPtr); + bline = envPtr->line; + count++; + continue; } while (count > 255) { diff --git a/generic/tclOO.h b/generic/tclOO.h index 280481c..cf253b1 100644 --- a/generic/tclOO.h +++ b/generic/tclOO.h @@ -39,7 +39,7 @@ extern const char *TclOOInitializeStubs( * win/tclooConfig.sh */ -#define TCLOO_VERSION "0.7" +#define TCLOO_VERSION "1.0" #define TCLOO_PATCHLEVEL TCLOO_VERSION /* diff --git a/generic/tclOOInfo.c b/generic/tclOOInfo.c index e09ee4e..5be9b01 100644 --- a/generic/tclOOInfo.c +++ b/generic/tclOOInfo.c @@ -100,6 +100,7 @@ TclOOInitInfo( Tcl_Interp *interp) { Tcl_Command infoCmd; + Tcl_Obj *mapDict; /* * Build the ensembles used to implement [info object] and [info class]. @@ -113,25 +114,12 @@ TclOOInitInfo( */ infoCmd = Tcl_FindCommand(interp, "info", NULL, TCL_GLOBAL_ONLY); - if (infoCmd != NULL && Tcl_IsEnsemble(infoCmd)) { - Tcl_Obj *mapDict, *objectObj, *classObj; - - Tcl_GetEnsembleMappingDict(NULL, infoCmd, &mapDict); - if (mapDict != NULL) { - objectObj = Tcl_NewStringObj("object", -1); - classObj = Tcl_NewStringObj("class", -1); - - Tcl_IncrRefCount(objectObj); - Tcl_IncrRefCount(classObj); - Tcl_DictObjPut(NULL, mapDict, objectObj, - Tcl_NewStringObj("::oo::InfoObject", -1)); - Tcl_DictObjPut(NULL, mapDict, classObj, - Tcl_NewStringObj("::oo::InfoClass", -1)); - Tcl_DecrRefCount(objectObj); - Tcl_DecrRefCount(classObj); - Tcl_SetEnsembleMappingDict(interp, infoCmd, mapDict); - } - } + Tcl_GetEnsembleMappingDict(NULL, infoCmd, &mapDict); + Tcl_DictObjPut(NULL, mapDict, Tcl_NewStringObj("object", -1), + Tcl_NewStringObj("::oo::InfoObject", -1)); + Tcl_DictObjPut(NULL, mapDict, Tcl_NewStringObj("class", -1), + Tcl_NewStringObj("::oo::InfoClass", -1)); + Tcl_SetEnsembleMappingDict(interp, infoCmd, mapDict); } /* diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c index 720d9ef..eefa300 100644 --- a/generic/tclStubLib.c +++ b/generic/tclStubLib.c @@ -23,34 +23,11 @@ const TclPlatStubs *tclPlatStubsPtr = NULL; const TclIntStubs *tclIntStubsPtr = NULL; const TclIntPlatStubs *tclIntPlatStubsPtr = NULL; -static const TclStubs * -HasStubSupport( - Tcl_Interp *interp, - const char *tclversion, - int magic) -{ - /* TODO: Whatever additional checks using tclversion - * and/or magic should be done here. */ - - Interp *iPtr = (Interp *) interp; - - if (iPtr->stubTable && iPtr->stubTable->magic == magic) { - return iPtr->stubTable; - } - iPtr->legacyResult - = "interpreter uses an incompatible stubs mechanism"; - iPtr->legacyFreeProc = 0; /* TCL_STATIC */ - return NULL; -} - /* - * Use our own isdigit to avoid linking to libc on windows + * Use our own ISDIGIT to avoid linking to libc on windows */ -static int isDigit(const int c) -{ - return (c >= '0' && c <= '9'); -} +#define ISDIGIT(c) (((unsigned)((c)-'0')) <= 9) /* *---------------------------------------------------------------------- @@ -78,9 +55,10 @@ TclInitStubs( const char *tclversion, int magic) { + Interp *iPtr = (Interp *) interp; const char *actualVersion = NULL; ClientData pkgData = NULL; - const TclStubs *stubsPtr; + const TclStubs *stubsPtr = iPtr->stubTable; /* * We can't optimize this check by caching tclStubsPtr because that @@ -88,8 +66,9 @@ TclInitStubs( * times. [Bug 615304] */ - stubsPtr = HasStubSupport(interp, tclversion, magic); - if (!stubsPtr) { + if (!stubsPtr || (stubsPtr->magic != TCL_STUB_MAGIC)) { + iPtr->legacyResult = "interpreter uses an incompatible stubs mechanism"; + iPtr->legacyFreeProc = 0; /* TCL_STATIC */ return NULL; } @@ -102,7 +81,7 @@ TclInitStubs( int count = 0; while (*p) { - count += !isDigit(*p++); + count += !ISDIGIT(*p++); } if (count == 1) { const char *q = actualVersion; @@ -111,7 +90,7 @@ TclInitStubs( while (*p && (*p == *q)) { p++; q++; } - if (*p || isDigit(*q)) { + if (*p || ISDIGIT(*q)) { /* Construct error message */ stubsPtr->tcl_PkgRequireEx(interp, "Tcl", version, 1, NULL); return NULL; diff --git a/pkgs/package.list.txt b/pkgs/package.list.txt index f12111d..a13b0fb 100644 --- a/pkgs/package.list.txt +++ b/pkgs/package.list.txt @@ -23,4 +23,4 @@ TDBC TDBC tdbcmysql tdbc::mysql tdbcodbc tdbc::odbc tdbcpostgres tdbc::postgres -tdbcsqlite3- tdbc::sqlite3 +tdbcsqlite3 tdbc::sqlite3 diff --git a/tests/oo.test b/tests/oo.test index 540cdf3..5d34077 100644 --- a/tests/oo.test +++ b/tests/oo.test @@ -7,7 +7,7 @@ # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. -package require -exact TclOO 0.7 ;# Must match value in generic/tclOO.h +package require TclOO 1.0 package require tcltest 2 if {"::tcltest" in [namespace children]} { namespace import -force ::tcltest::* diff --git a/tests/ooNext2.test b/tests/ooNext2.test index e78e0d0..d77e8d1 100644 --- a/tests/ooNext2.test +++ b/tests/ooNext2.test @@ -7,7 +7,7 @@ # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. -package require -exact TclOO 0.7 ;# Must match value in configure.in +package require TclOO 1.0 package require tcltest 2 if {"::tcltest" in [namespace children]} { namespace import -force ::tcltest::* diff --git a/tools/tcltk-man2html.tcl b/tools/tcltk-man2html.tcl index 4d7b989..f87f701 100755 --- a/tools/tcltk-man2html.tcl +++ b/tools/tcltk-man2html.tcl @@ -461,18 +461,15 @@ proc plus-pkgs {type args} { if {!$build_tcl} return set result {} set pkgsdir $tcltkdir/$tcldir/pkgs - foreach {dir name} $args { - set globpat $pkgsdir/{$dir,$dir\[0-9\]*}/doc/*.$type + foreach {dir name version} $args { + set globpat $pkgsdir/$dir/doc/*.$type if {![llength [glob -type f -nocomplain $globpat]]} { # Fallback for manpages generated using doctools - set globpat $pkgsdir/{$dir,$dir\[0-9\]*}/doc/man/*.$type + set globpat $pkgsdir/$dir/doc/man/*.$type if {![llength [glob -type f -nocomplain $globpat]]} { continue } } - regexp "pkgs/${dir}(.*)/doc$" \ - [lindex [glob -type d $pkgsdir/{$dir,$dir\[0-9\]*}/doc] 0] \ - -> version switch $type { n { set title "$name Package Commands" @@ -650,6 +647,42 @@ try { append appdir "$tkdir" } + + # When building docs for Tcl, try to build docs for bundled packages too + set packageBuildList {} + if {$build_tcl} { + set pkgsDir [file join $tcltkdir $tcldir pkgs] + set subdirs [glob -nocomplain -types d -tails -directory $pkgsDir *] + + foreach dir [lsort $subdirs] { + # Parse the subdir name into (name, version) as fallback... + set description [split $dir -] + if {2 != [llength $description]} { + regexp {([^0-9]*)(.*)} $dir -> n v + set description [list $n $v] + } + + # ... but try to extract (name, version) from subdir contents + try { + set f [open [file join $pkgsDir $dir configure.in]] + foreach line [split [read $f] \n] { + if {2 == [scan $line \ + { AC_INIT ( [%[^]]] , [%[^]]] ) } n v]} { + set description [list $n $v] + break + } + } + } finally { + catch {close $f; unset f} + } + + if {[file exists [file join $pkgsDir $dir configure]]} { + # Looks like a package, record our best extraction attempt + lappend packageBuildList $dir {*}$description + } + } + } + # Get the list of packages to try, and what their human-readable names # are. Note that the package directory list should be version-less. try { @@ -674,6 +707,14 @@ try { } } + # Convert to human readable names, if applicable + for {set idx 0} {$idx < [llength $packageBuildList]} {incr idx 3} { + lassign [lrange $packageBuildList $idx $idx+2] d n v + if {[dict exists $packageDirNameMap $n]} { + lset packageBuildList $idx+1 [dict get $packageDirNameMap $n] + } + } + # # Invoke the scraper/converter engine. # @@ -684,12 +725,12 @@ try { "The commands which the <B>tclsh</B> interpreter implements."] \ [plus-base $build_tk $tkdir doc/*.n {Tk Commands} TkCmd \ "The additional commands which the <B>wish</B> interpreter implements."] \ - {*}[plus-pkgs n {*}$packageDirNameMap] \ + {*}[plus-pkgs n {*}$packageBuildList] \ [plus-base $build_tcl $tcldir doc/*.3 {Tcl C API} TclLib \ "The C functions which a Tcl extended C program may use."] \ [plus-base $build_tk $tkdir doc/*.3 {Tk C API} TkLib \ "The additional C functions which a Tk extended C program may use."] \ - {*}[plus-pkgs 3 {*}$packageDirNameMap] + {*}[plus-pkgs 3 {*}$packageBuildList] } on error {msg opts} { # On failure make sure we show what went wrong. We're not supposed # to get here though; it represents a bug in the script. diff --git a/unix/Makefile.in b/unix/Makefile.in index 680d4ce..df05759 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -2019,8 +2019,7 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tclConfig.h.in $(UNIX_DIR)/tcl.pc.in $(M cp -p $(TOMMATH_SRCS) $(TOMMATH_DIR)/*.h \ $(DISTDIR)/libtommath mkdir $(DISTDIR)/pkgs - cp $(TOP_DIR)/pkgs/README $(TOP_DIR)/pkgs/package.list.txt \ - $(DISTDIR)/pkgs + cp $(TOP_DIR)/pkgs/README $(DISTDIR)/pkgs for i in `ls $(DISTROOT)/pkgs/*.tar.gz 2> /dev/null`; do \ tar -C $(DISTDIR)/pkgs -xzf "$$i"; \ done diff --git a/unix/dltest/pkgb.c b/unix/dltest/pkgb.c index e003ed6..86b1ee6 100644 --- a/unix/dltest/pkgb.c +++ b/unix/dltest/pkgb.c @@ -89,22 +89,6 @@ Pkgb_UnsafeObjCmd( return Tcl_EvalEx(interp, "list unsafe command invoked", -1, TCL_EVAL_GLOBAL); } -#if (TCL_MAJOR_VERSION > 8) -const char *Tcl_GetDefaultEncodingDir(void) -{ - int numDirs; - Tcl_Obj *first, *searchPath = Tcl_GetEncodingSearchPath(); - - Tcl_ListObjLength(NULL, searchPath, &numDirs); - if (numDirs == 0) { - return NULL; - } - Tcl_ListObjIndex(NULL, searchPath, 0, &first); - - return Tcl_GetString(first); -} -#endif - static int Pkgb_DemoObjCmd( ClientData dummy, /* Not used. */ @@ -112,7 +96,16 @@ Pkgb_DemoObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { +#if (TCL_MAJOR_VERSION > 8) || (TCL_MINOR_VERSION > 4) + Tcl_Obj *first; + + if (Tcl_ListObjIndex(NULL, Tcl_GetEncodingSearchPath(), 0, &first) + == TCL_OK) { + Tcl_SetObjResult(interp, first); + } +#else Tcl_SetObjResult(interp, Tcl_NewStringObj(Tcl_GetDefaultEncodingDir(), -1)); +#endif return TCL_OK; } @@ -140,7 +133,7 @@ Pkgb_Init( { int code; - if (Tcl_InitStubs(interp, "8.5-9.1", 0) == NULL) { + if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) { return TCL_ERROR; } code = Tcl_PkgProvideEx(interp, "Pkgb", "2.3", NULL); @@ -177,7 +170,7 @@ Pkgb_SafeInit( { int code; - if (Tcl_InitStubs(interp, "8.5-9.1", 0) == NULL) { + if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) { return TCL_ERROR; } code = Tcl_PkgProvideEx(interp, "Pkgb", "2.3", NULL); diff --git a/unix/tclooConfig.sh b/unix/tclooConfig.sh index 5cb4d99..721825b 100644 --- a/unix/tclooConfig.sh +++ b/unix/tclooConfig.sh @@ -16,4 +16,4 @@ TCLOO_STUB_LIB_SPEC="" TCLOO_INCLUDE_SPEC="" TCLOO_PRIVATE_INCLUDE_SPEC="" TCLOO_CFLAGS="" -TCLOO_VERSION=0.7 +TCLOO_VERSION=1.0 diff --git a/win/tclooConfig.sh b/win/tclooConfig.sh index 5cb4d99..721825b 100644 --- a/win/tclooConfig.sh +++ b/win/tclooConfig.sh @@ -16,4 +16,4 @@ TCLOO_STUB_LIB_SPEC="" TCLOO_INCLUDE_SPEC="" TCLOO_PRIVATE_INCLUDE_SPEC="" TCLOO_CFLAGS="" -TCLOO_VERSION=0.7 +TCLOO_VERSION=1.0 |