diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-10-22 14:31:26 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-10-22 14:31:26 (GMT) |
commit | 021af90722d6cf901b75e8f36f0d6cf0a62ed56e (patch) | |
tree | 210b8a5ec1f4880f7174f9fa3f59c93e14544f3b | |
parent | d970d6f3f67a50a0b71ef5d61f77c9353a09ef64 (diff) | |
parent | be83197ee590ec252235b5684a13f8d42e35c814 (diff) | |
download | tcl-021af90722d6cf901b75e8f36f0d6cf0a62ed56e.zip tcl-021af90722d6cf901b75e8f36f0d6cf0a62ed56e.tar.gz tcl-021af90722d6cf901b75e8f36f0d6cf0a62ed56e.tar.bz2 |
Merge 8.7
40 files changed, 372 insertions, 351 deletions
diff --git a/.travis.yml b/.travis.yml index e597512..ba88156 100644 --- a/.travis.yml +++ b/.travis.yml @@ -224,6 +224,8 @@ jobs: - BUILD_DIR=win - VCDIR="/C/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build" before_install: &vcpreinst + - rm -rf tests/safe-stock8*.test + - touch generic/tclStubInit.c generic/tclOOStubInit.c generic/tclOOScript.h - PATH="$PATH:$VCDIR" - cd ${BUILD_DIR} install: [] @@ -338,6 +340,8 @@ jobs: - BUILD_DIR=win - CFGOPT="--enable-64bit" before_install: &makepreinst + - rm -rf tests/safe-stock8*.test + - touch generic/tclStubInit.c generic/tclOOStubInit.c generic/tclOOScript.h - choco install -y make zip - cd ${BUILD_DIR} - name: "Windows/GCC/Shared: UTF_MAX=4" @@ -445,6 +449,7 @@ jobs: script: - make dist before_install: + - rm -rf tests/safe-stock8*.test - touch generic/tclStubInit.c generic/tclOOStubInit.c generic/tclOOScript.h - cd ${BUILD_DIR} install: diff --git a/doc/FileSystem.3 b/doc/FileSystem.3 index 6703638..4e77114 100644 --- a/doc/FileSystem.3 +++ b/doc/FileSystem.3 @@ -414,7 +414,7 @@ caller (with a reference count of 0). the encoding identified by \fIencodingName\fR and evaluates its contents as a Tcl script. It returns the same information as \fBTcl_EvalObjEx\fR. -If \fIencodingName\fR is NULL, the system encoding is used for +If \fIencodingName\fR is NULL, the utf-8 encoding is used for reading the file contents. If the file could not be read then a Tcl error is returned to describe why the file could not be read. @@ -430,7 +430,7 @@ or which will be safely substituted by the Tcl interpreter into .QW ^Z . \fBTcl_FSEvalFile\fR is a simpler version of -\fBTcl_FSEvalFileEx\fR that always uses the system encoding +\fBTcl_FSEvalFileEx\fR that always uses the utf-8 encoding when reading the file. .PP \fBTcl_FSLoadFile\fR dynamically loads a binary code file into memory and diff --git a/doc/interp.n b/doc/interp.n index 35f26d5..2943404 100644 --- a/doc/interp.n +++ b/doc/interp.n @@ -58,7 +58,7 @@ kernel call) between a child interpreter and its parent. See \fBALIAS INVOCATION\fR, below, for more details on how the alias mechanism works. .PP -A qualified interpreter name is a proper Tcl lists containing a subset of its +A qualified interpreter name is a proper Tcl list containing a subset of its ancestors in the interpreter hierarchy, terminated by the string naming the interpreter in its immediate parent. Interpreter names are relative to the interpreter in which they are used. For example, if diff --git a/doc/source.n b/doc/source.n index 353b8fb..8757cb8 100644 --- a/doc/source.n +++ b/doc/source.n @@ -47,7 +47,7 @@ A leading BOM (Byte order mark) contained in the file is ignored for unicode enc .PP The \fB\-encoding\fR option is used to specify the encoding of the data stored in \fIfileName\fR. When the \fB\-encoding\fR option -is omitted, the system encoding is assumed. +is omitted, the utf-8 encoding is assumed. .SH EXAMPLE .PP Run the script in the file \fBfoo.tcl\fR and then the script in the diff --git a/generic/tcl.h b/generic/tcl.h index e76eb58..5de113d 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -361,7 +361,7 @@ typedef long LONG; */ #if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG) -# if defined(_MSC_VER) || defined(_WIN32) +# if defined(_WIN32) && (!defined(__USE_MINGW_ANSI_STDIO) || !__USE_MINGW_ANSI_STDIO) # define TCL_WIDE_INT_TYPE __int64 # define TCL_LL_MODIFIER "I64" # if defined(_WIN64) diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index e816ad8..cf900a3 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -3514,7 +3514,7 @@ Tcl_LsearchObjCmd( if (allMatches || inlineReturn) { Tcl_ResetResult(interp); } else { - TclNewIntObj(itemPtr, -1); + TclNewIntObj(itemPtr, TCL_INDEX_NONE); Tcl_SetObjResult(interp, itemPtr); } goto done; diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 4bf4232..cf4240a 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -3893,7 +3893,7 @@ TclNRSwitchObjCmd( TclNewIntObj(rangeObjAry[0], info.matches[j].start); TclNewIntObj(rangeObjAry[1], info.matches[j].end-1); } else { - TclNewIntObj(rangeObjAry[1], -1); + TclNewIntObj(rangeObjAry[1], TCL_INDEX_NONE); rangeObjAry[0] = rangeObjAry[1]; } diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 3591431..fcce215 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -1684,7 +1684,7 @@ Tcl_FSEvalFileEx( * Tilde-substitution is performed on this * pathname. */ const char *encodingName) /* Either the name of an encoding or NULL to - use the system encoding. */ + use the utf-8 encoding. */ { int length, result = TCL_ERROR; Tcl_StatBuf statBuf; @@ -1722,16 +1722,16 @@ Tcl_FSEvalFileEx( /* * If the encoding is specified, set the channel to that encoding. - * Otherwise don't touch it, leaving things up to the system encoding. If - * the encoding is unknown report an error. + * Otherwise use utf-8. If the encoding is unknown report an error. */ - if (encodingName != NULL) { - if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName) - != TCL_OK) { - Tcl_Close(interp,chan); - return result; - } + if (encodingName == NULL) { + encodingName = "utf-8"; + } + if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName) + != TCL_OK) { + Tcl_Close(interp,chan); + return result; } TclNewObj(objPtr); @@ -1821,7 +1821,7 @@ TclNREvalFile( * evaluate. Tilde-substitution is performed on * this pathname. */ const char *encodingName) /* The name of an encoding to use, or NULL to - * use the system encoding. */ + * use the utf-8 encoding. */ { Tcl_StatBuf statBuf; Tcl_Obj *oldScriptFile, *objPtr; @@ -1858,16 +1858,16 @@ TclNREvalFile( /* * If the encoding is specified, set the channel to that encoding. - * Otherwise don't touch it, leaving things up to the system encoding. If - * the encoding is unknown report an error. + * Otherwise use utf-8. If the encoding is unknown report an error. */ - if (encodingName != NULL) { - if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName) - != TCL_OK) { - Tcl_Close(interp,chan); - return TCL_ERROR; - } + if (encodingName == NULL) { + encodingName = "utf-8"; + } + if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName) + != TCL_OK) { + Tcl_Close(interp, chan); + return TCL_ERROR; } TclNewObj(objPtr); diff --git a/generic/tclPkgConfig.c b/generic/tclPkgConfig.c index 96b6962..12df68e 100644 --- a/generic/tclPkgConfig.c +++ b/generic/tclPkgConfig.c @@ -35,6 +35,10 @@ #include "tclInt.h" +#ifndef TCL_CFGVAL_ENCODING +# define TCL_CFGVAL_ENCODING "utf-8" +#endif + /* * Use C preprocessor statements to define the various values for the embedded * configuration information. diff --git a/generic/tclScan.c b/generic/tclScan.c index ee04165..67fe6f3 100644 --- a/generic/tclScan.c +++ b/generic/tclScan.c @@ -1089,7 +1089,7 @@ Tcl_ScanObjCmd( if (code == TCL_OK) { if (underflow && (nconversions == 0)) { if (numVars) { - TclNewIntObj(objPtr, -1); + TclNewIntObj(objPtr, TCL_INDEX_NONE); } else { if (objPtr) { Tcl_SetListObj(objPtr, 0, NULL); diff --git a/generic/tclZlib.c b/generic/tclZlib.c index e14b496..ea6a1f2 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -3945,7 +3945,7 @@ TclZlibInit( cfg[0].key = "zlibVersion"; cfg[0].value = zlibVersion(); cfg[1].key = NULL; - Tcl_RegisterConfig(interp, "zlib", cfg, "iso8859-1"); + Tcl_RegisterConfig(interp, "zlib", cfg, "utf-8"); /* * Allow command type introspection to do something sensible with streams. diff --git a/library/clock.tcl b/library/clock.tcl index 2e42a98..54919f2 100644 --- a/library/clock.tcl +++ b/library/clock.tcl @@ -3314,7 +3314,7 @@ proc ::tcl::clock::LoadTimeZoneFile { fileName } { "time zone \":$fileName\" not valid" } try { - source -encoding utf-8 [file join $DataDir $fileName] + source [file join $DataDir $fileName] } on error {} { return -code error \ -errorcode [list CLOCK badTimeZone :$fileName] \ diff --git a/library/init.tcl b/library/init.tcl index 16d5d67..09dd6a4 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -112,7 +112,7 @@ if {[interp issafe]} { foreach cmd {add format scan} { proc ::tcl::clock::$cmd args { variable TclLibDir - source -encoding utf-8 [file join $TclLibDir clock.tcl] + source [file join $TclLibDir clock.tcl] return [uplevel 1 [info level 0]] } } diff --git a/library/safe.tcl b/library/safe.tcl index 1f8c3d2..4c0f3b1 100644 --- a/library/safe.tcl +++ b/library/safe.tcl @@ -937,7 +937,7 @@ proc ::safe::AliasSource {child args} { } } else { set at 0 - set encoding {} + set encoding utf-8 } if {$argc != 1} { set msg "wrong # args: should be \"source ?-encoding E? fileName\"" @@ -980,10 +980,7 @@ proc ::safe::AliasSource {child args} { set replacementMsg "script error" set code [catch { set f [open $realfile] - fconfigure $f -eofchar \032 - if {$encoding ne ""} { - fconfigure $f -encoding $encoding - } + fconfigure $f -encoding $encoding -eofchar \032 set contents [read $f] close $f ::interp eval $child [list info script $file] diff --git a/library/tm.tcl b/library/tm.tcl index c60084c..3c0ec22 100644 --- a/library/tm.tcl +++ b/library/tm.tcl @@ -267,7 +267,7 @@ proc ::tcl::tm::UnknownHandler {original name args} { # of the package file is the last element in the list. package ifneeded $pkgname $pkgversion \ - "[::list package provide $pkgname $pkgversion];[::list source -encoding utf-8 $file]" + "[::list package provide $pkgname $pkgversion];[::list source $file]" # We abort in this unknown handler only if we got a # satisfying candidate for the requested package. diff --git a/library/tzdata/Pacific/Fiji b/library/tzdata/Pacific/Fiji index e316b93..a062913 100644 --- a/library/tzdata/Pacific/Fiji +++ b/library/tzdata/Pacific/Fiji @@ -29,7 +29,7 @@ set TZData(:Pacific/Fiji) { {1547301600 43200 0 +12} {1573308000 46800 1 +12} {1578751200 43200 0 +12} - {1604757600 46800 1 +12} + {1608386400 46800 1 +12} {1610805600 43200 0 +12} {1636812000 46800 1 +12} {1642255200 43200 0 +12} diff --git a/macosx/GNUmakefile b/macosx/GNUmakefile index 9d82e42..93fd843 100644 --- a/macosx/GNUmakefile +++ b/macosx/GNUmakefile @@ -32,6 +32,18 @@ MANDIR ?= ${PREFIX}/man # set to non-empty value to install manpages in addition to html help: INSTALL_MANPAGES ?= +# Checks and overrides for subframework builds +ifeq (${SUBFRAMEWORK},1) +ifeq (${DYLIB_INSTALL_DIR},) + @echo "Cannot install subframework with empty DYLIB_INSTALL_DIR !" && false +endif +ifeq (${DESTDIR},) + @echo "Cannot install subframework with empty DESTDIR !" && false +endif +override BUILD_DIR = ${DESTDIR}/build +override INSTALL_PATH = /Frameworks +endif + #------------------------------------------------------------------------------------------------------- # meta targets @@ -76,7 +88,7 @@ space := ${empty} ${empty} objdir = $(subst ${space},\ ,${OBJ_DIR}) develop_make_args := BUILD_STYLE=Development CONFIGURE_ARGS=--enable-symbols -deploy_make_args := BUILD_STYLE=Deployment INSTALL_TARGET=install-strip \ +deploy_make_args := BUILD_STYLE=Deployment INSTALL_TARGET=install \ EXTRA_CFLAGS=-DNDEBUG embedded_make_args := EMBEDDED_BUILD=1 install_make_args := INSTALL_BUILD=1 diff --git a/macosx/README b/macosx/README index f28c055..3035bc8 100644 --- a/macosx/README +++ b/macosx/README @@ -165,3 +165,13 @@ If you only want to build and install the debug or optimized build, use the For example, to build and install only the optimized versions: make -C tcl${ver}/macosx deploy sudo make -C tcl${ver}/macosx install-deploy + +- To build a Tcl.framework for use as a subframework in another framework, use the +install-embedded target and set SUBFRAMEWORK=1. Set the DYLIB_INSTALL_DIR +variable to the path which should be the install_name path of the Tcl library, set +the DESTDIR variable to the pathname of a staging directory where the framework +will be written . For example, running this command in the Tcl source directory: + make -C macosx install-embedded SUBFRAMEWORK=1 DESTDIR=/tmp/tcl \ + DYLIB_INSTALL_DIR=/Library/Frameworks/Some.framework/Versions/X.Y/Frameworks/Tcl.framework +will produce a Tcl.framework intended for installing as a subframework of +Some.framework. The framework will be found in /tmp/tcl/Frameworks/ diff --git a/tests/cmdAH.test b/tests/cmdAH.test index e1fd920..8f01816 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -30,6 +30,7 @@ testConstraint linkDirectory [expr { ($::tcl_platform(osVersion) >= 5.0 && [lindex [file system [temporaryDirectory]] 1] eq "NTFS") }] +testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}] global env set cmdAHwd [pwd] @@ -1348,7 +1349,7 @@ test cmdAH-25.2.1 {Tcl_FileObjCmd: owned} -constraints unix -setup { test cmdAH-25.3 {Tcl_FileObjCmd: owned} {unix notRoot} { file owned / } 0 -test cmdAH-25.3.1 {Tcl_FileObjCmd: owned} -constraints win -body { +test cmdAH-25.3.1 {Tcl_FileObjCmd: owned} -constraints {win notWine} -body { if {[info exists env(SystemRoot)]} { file owned $env(SystemRoot) } else { @@ -1538,7 +1539,7 @@ test cmdAH-29.4 {Tcl_FileObjCmd: type} -constraints {unix} -setup { } -cleanup { file delete $linkfile } -result link -test cmdAH-29.4.1 {Tcl_FileObjCmd: type} -constraints {linkDirectory} -setup { +test cmdAH-29.4.1 {Tcl_FileObjCmd: type} -constraints {linkDirectory notWine} -setup { set tempdir [makeDirectory temp] } -body { set linkdir [file join [temporaryDirectory] link.dir] diff --git a/tests/env.test b/tests/env.test index bad9e66..c901148 100644 --- a/tests/env.test +++ b/tests/env.test @@ -104,7 +104,9 @@ variable keep { SHLIB_PATH SYSTEMDRIVE SYSTEMROOT DYLD_LIBRARY_PATH DYLD_FRAMEWORK_PATH DYLD_NEW_LOCAL_SHARED_REGIONS DYLD_NO_FIX_PREBINDING __CF_USER_TEXT_ENCODING SECURITYSESSIONID LANG WINDIR TERM - CommonProgramFiles ProgramFiles CommonProgramW6432 ProgramW6432 + CommonProgramFiles CommonProgramFiles(x86) ProgramFiles + ProgramFiles(x86) CommonProgramW6432 ProgramW6432 + WINECONFIGDIR WINEDATADIR WINEDLLDIR0 WINEHOMEDIR } variable printenvScript [makeFile [string map [list @keep@ [list $keep]] { diff --git a/tests/fCmd.test b/tests/fCmd.test index 53313dc..a1e0a6e 100644 --- a/tests/fCmd.test +++ b/tests/fCmd.test @@ -41,6 +41,7 @@ if {[testConstraint win]} { testConstraint reg 1 } } +testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}] set tmpspace /tmp;# default value # Find a group that exists on this Unix system, or else skip tests that @@ -416,7 +417,7 @@ test fCmd-5.4 {TclFileDeleteCmd: multiple files} -constraints notRoot -setup { } -cleanup {cleanup} -result {1 1 1 0 0 0} test fCmd-5.5 {TclFileDeleteCmd: stop at first error} -setup { cleanup -} -constraints {notRoot unixOrWin} -body { +} -constraints {notRoot unixOrWin notWine} -body { createfile tf1 createfile tf2 file mkdir td1 @@ -563,7 +564,7 @@ test fCmd-6.15 {CopyRenameOneFile: TclpRenameFile succeeds} -setup { } -result 1 test fCmd-6.16 {CopyRenameOneFile: TclpCopyRenameOneFile fails} -setup { cleanup -} -constraints {notRoot} -body { +} -constraints {notRoot notWine} -body { file mkdir [file join td1 td2] createfile [file join td1 td2 tf1] file mkdir td2 @@ -572,12 +573,12 @@ test fCmd-6.16 {CopyRenameOneFile: TclpCopyRenameOneFile fails} -setup { [subst {error renaming "td2" to "[file join td1 td2]": file *}] test fCmd-6.17 {CopyRenameOneFile: errno == EINVAL} -setup { cleanup -} -constraints {notRoot} -returnCodes error -body { +} -constraints {notRoot notWine} -returnCodes error -body { file rename -force $root tf1 } -result [subst {error renaming "$root" to "tf1": trying to rename a volume or move a directory into itself}] test fCmd-6.18 {CopyRenameOneFile: errno != EXDEV} -setup { cleanup -} -constraints {notRoot} -body { +} -constraints {notRoot notWine} -body { file mkdir [file join td1 td2] createfile [file join td1 td2 tf1] file mkdir td2 @@ -811,7 +812,7 @@ test fCmd-9.4.b {file rename: comprehensive: dir to new name} -setup { } -result {{td3 td4} 1 0} test fCmd-9.5 {file rename: comprehensive: file to self} -setup { cleanup -} -constraints {notRoot testchmod} -body { +} -constraints {notRoot testchmod notWine} -body { createfile tf1 tf1 createfile tf2 tf2 testchmod 0o444 tf2 @@ -841,7 +842,7 @@ test fCmd-9.6.b {file rename: comprehensive: dir to self} -setup { } -result {{td1 td2} 1 0} test fCmd-9.7 {file rename: comprehensive: file to existing file} -setup { cleanup -} -constraints {notRoot testchmod} -body { +} -constraints {notRoot testchmod notWine} -body { createfile tf1 createfile tf2 createfile tfs1 @@ -902,7 +903,7 @@ test fCmd-9.8 {file rename: comprehensive: dir to empty dir} -setup { # Test can hit EEXIST or EBUSY, depending on underlying filesystem test fCmd-9.9 {file rename: comprehensive: dir to non-empty dir} -setup { cleanup -} -constraints {notRoot testchmod} -body { +} -constraints {notRoot testchmod notWine} -body { file mkdir tds1 file mkdir tds2 file mkdir [file join tdd1 tds1 xxx] @@ -966,14 +967,14 @@ test fCmd-9.12 {file rename: comprehensive: target exists} -setup { # Test can hit EEXIST or EBUSY, depending on underlying filesystem test fCmd-9.13 {file rename: comprehensive: can't overwrite target} -setup { cleanup -} -constraints {notRoot} -body { +} -constraints {notRoot notWine} -body { file mkdir [file join td1 td2] [file join td2 td1 td4] file rename -force td1 td2 } -returnCodes error -match glob -result \ [subst {error renaming "td1" to "[file join td2 td1]": file *}] test fCmd-9.14 {file rename: comprehensive: dir into self} -setup { cleanup -} -constraints {notRoot} -body { +} -constraints {notRoot notWine} -body { file mkdir td1 list [glob td*] [list [catch {file rename td1 td1} msg] $msg] } -result [subst {td1 {1 {error renaming "td1" to "[file join td1 td1]": trying to rename a volume or move a directory into itself}}}] @@ -1068,7 +1069,7 @@ test fCmd-10.3.1 {file copy: comprehensive: dir to new name} -setup { } -result [list {td1 td2 td3 td4} [file join td3 tdx] [file join td4 tdy] 1 1] test fCmd-10.4 {file copy: comprehensive: file to existing file} -setup { cleanup -} -constraints {notRoot testchmod} -body { +} -constraints {notRoot testchmod notWine} -body { createfile tf1 createfile tf2 createfile tfs1 @@ -2401,7 +2402,7 @@ test fCmd-28.10.1 {file link: linking to nonexistent path} -setup { test fCmd-28.11 {file link: success with directory} -setup { cd [temporaryDirectory] file delete -force abc.link -} -constraints {linkDirectory} -body { +} -constraints {linkDirectory notWine} -body { file link abc.link abc.dir } -cleanup { cd [workingDirectory] @@ -2409,7 +2410,7 @@ test fCmd-28.11 {file link: success with directory} -setup { test fCmd-28.12 {file link: cd into a link} -setup { cd [temporaryDirectory] file delete -force abc.link -} -constraints {linkDirectory} -body { +} -constraints {linkDirectory notWine} -body { file link abc.link abc.dir set orig [pwd] cd abc.link @@ -2435,7 +2436,7 @@ test fCmd-28.12 {file link: cd into a link} -setup { file delete -force abc.link cd [workingDirectory] } -result ok -test fCmd-28.13 {file link} -constraints {linkDirectory} -setup { +test fCmd-28.13 {file link} -constraints {linkDirectory notWine} -setup { cd [temporaryDirectory] file link abc.link abc.dir } -body { @@ -2469,7 +2470,7 @@ test fCmd-28.15.1 {file link: copies link not dir} -setup { test fCmd-28.15.2 {file link: copies link not dir} -setup { cd [temporaryDirectory] file delete -force abc.link -} -constraints {linkDirectory} -body { +} -constraints {linkDirectory notWine} -body { file link abc.link abc.dir file copy abc.link abc2.link list [file type abc2.link] [file tail [file link abc2.link]] @@ -2490,7 +2491,7 @@ cd [workingDirectory] test fCmd-28.16 {file link: glob inside link} -setup { cd [temporaryDirectory] file delete -force abc.link -} -constraints {linkDirectory} -body { +} -constraints {linkDirectory notWine} -body { file link abc.link abc.dir lsort [glob -dir abc.link -tails *] } -cleanup { @@ -2500,13 +2501,13 @@ test fCmd-28.16 {file link: glob inside link} -setup { test fCmd-28.17 {file link: glob -type l} -setup { cd [temporaryDirectory] file link abc.link abc.dir -} -constraints {linkDirectory} -body { +} -constraints {linkDirectory notWine} -body { glob -dir [pwd] -type l -tails abc* } -cleanup { file delete -force abc.link cd [workingDirectory] } -result {abc.link} -test fCmd-28.18 {file link: glob -type d} -constraints linkDirectory -setup { +test fCmd-28.18 {file link: glob -type d} -constraints {linkDirectory notWine} -setup { cd [temporaryDirectory] file link abc.link abc.dir } -body { @@ -2517,7 +2518,7 @@ test fCmd-28.18 {file link: glob -type d} -constraints linkDirectory -setup { } -result [lsort [list abc.link abc.dir abc2.dir]] test fCmd-28.19 {file link: relative paths} -setup { cd [temporaryDirectory] -} -constraints {win linkDirectory} -body { +} -constraints {win linkDirectory notWine} -body { file mkdir d1/d2/d3 file link d1/l2 d1/d2 } -cleanup { @@ -2575,12 +2576,12 @@ test fCmd-30.1 {file writable on 'My Documents'} -setup { } -constraints {win reg} -body { file writable $mydocsname } -result 1 -test fCmd-30.2 {file readable on 'NTUSER.DAT'} -constraints {win} -body { +test fCmd-30.2 {file readable on 'NTUSER.DAT'} -constraints {win notWine} -body { expr {[info exists env(USERPROFILE)] && [file exists $env(USERPROFILE)/NTUSER.DAT] && [file readable $env(USERPROFILE)/NTUSER.DAT]} } -result {1} -test fCmd-30.3 {file readable on 'pagefile.sys'} -constraints {win} -body { +test fCmd-30.3 {file readable on 'pagefile.sys'} -constraints {win notWine} -body { set r {} if {[info exists env(SystemDrive)]} { set path $env(SystemDrive)/pagefile.sys diff --git a/tests/fileName.test b/tests/fileName.test index c73efac..ac93383 100644 --- a/tests/fileName.test +++ b/tests/fileName.test @@ -31,6 +31,7 @@ if {[testConstraint win]} { testConstraint symbolicLinkFile 0 testConstraint sharedCdrive [expr {![catch {cd //[info hostname]/c}]}] } +testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}] # This match compares the first two words of the result. If the wanted result # is "equal", then this is successful if the words are equal. If the wanted # result is "not equal", then this is successful if the words are different. @@ -789,7 +790,7 @@ test filename-11.17 {Tcl_GlobCmd} {unix} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] -test filename-11.17.1 {Tcl_GlobCmd} {win} { +test filename-11.17.1 {Tcl_GlobCmd} {win notWine} { lsort [glob -directory $globname *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -800,7 +801,7 @@ test filename-11.17.1 {Tcl_GlobCmd} {win} { [file join $globname y1.c] [file join $globname z1.c]]] test filename-11.17.2 {Tcl_GlobCmd} -setup { set dir [pwd] -} -constraints {notRoot linkDirectory} -body { +} -constraints {notRoot linkDirectory notWine} -body { cd $globname file link -symbolic link a1 cd $dir @@ -813,7 +814,7 @@ test filename-11.17.2 {Tcl_GlobCmd} -setup { # Simpler version of the above test to illustrate a given bug. test filename-11.17.3 {Tcl_GlobCmd} -setup { set dir [pwd] -} -constraints {notRoot linkDirectory} -body { +} -constraints {notRoot linkDirectory notWine} -body { cd $globname file link -symbolic link a1 cd $dir @@ -828,7 +829,7 @@ test filename-11.17.3 {Tcl_GlobCmd} -setup { # Make sure the bugfix isn't too simple. We don't want to break 'glob -type l' test filename-11.17.4 {Tcl_GlobCmd} -setup { set dir [pwd] -} -constraints {notRoot linkDirectory} -body { +} -constraints {notRoot linkDirectory notWine} -body { cd $globname file link -symbolic link a1 cd $dir @@ -846,7 +847,7 @@ test filename-11.17.6 {Tcl_GlobCmd} { [list "weird name.c" x,z1.c x1.c y1.c z1.c]]] test filename-11.17.7 {Tcl_GlobCmd: broken link and glob -l} -setup { set dir [pwd] -} -constraints {linkDirectory} -body { +} -constraints {linkDirectory notWine} -body { cd $globname file mkdir nonexistent file link -symbolic link nonexistent @@ -878,7 +879,7 @@ test filename-11.18 {Tcl_GlobCmd} {unix} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] -test filename-11.18.1 {Tcl_GlobCmd} {win} { +test filename-11.18.1 {Tcl_GlobCmd} {win notWine} { lsort [glob -path $globname/ *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -895,7 +896,7 @@ test filename-11.19 {Tcl_GlobCmd} {unix} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] -test filename-11.19.1 {Tcl_GlobCmd} {win} { +test filename-11.19.1 {Tcl_GlobCmd} {win notWine} { lsort [glob -join -path [string range $globname 0 5] * *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -904,7 +905,7 @@ test filename-11.19.1 {Tcl_GlobCmd} {win} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] -test filename-11.20 {Tcl_GlobCmd} { +test filename-11.20 {Tcl_GlobCmd} notWine { lsort [glob -type d -dir $globname *] } [lsort [list [file join $globname a1]\ [file join $globname a2]\ @@ -934,7 +935,7 @@ test filename-11.22 {Tcl_GlobCmd} {unix} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] -test filename-11.22.1 {Tcl_GlobCmd} {win} { +test filename-11.22.1 {Tcl_GlobCmd} {win notWine} { lsort [glob -dir $globname *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -951,7 +952,7 @@ test filename-11.23 {Tcl_GlobCmd} {unix} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] -test filename-11.23.1 {Tcl_GlobCmd} {win} { +test filename-11.23.1 {Tcl_GlobCmd} {win notWine} { lsort [glob -path $globname/ *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -968,7 +969,7 @@ test filename-11.24 {Tcl_GlobCmd} {unix} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] -test filename-11.24.1 {Tcl_GlobCmd} {win} { +test filename-11.24.1 {Tcl_GlobCmd} {win notWine} { lsort [glob -join -path [string range $globname 0 5] * *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -977,17 +978,17 @@ test filename-11.24.1 {Tcl_GlobCmd} {win} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] -test filename-11.25 {Tcl_GlobCmd} { +test filename-11.25 {Tcl_GlobCmd} notWine { lsort [glob -type d -dir $globname *] } [lsort [list [file join $globname a1]\ [file join $globname a2]\ [file join $globname a3]]] -test filename-11.25.1 {Tcl_GlobCmd} { +test filename-11.25.1 {Tcl_GlobCmd} notWine { lsort [glob -type {d r} -dir $globname *] } [lsort [list [file join $globname a1]\ [file join $globname a2]\ [file join $globname a3]]] -test filename-11.25.2 {Tcl_GlobCmd} { +test filename-11.25.2 {Tcl_GlobCmd} notWine { lsort [glob -type {d r w} -dir $globname *] } [lsort [list [file join $globname a1]\ [file join $globname a2]\ @@ -1231,10 +1232,10 @@ test filename-14.5 {asterisks, question marks, and brackets} -setup { test filename-14.7 {asterisks, question marks, and brackets} {unix} { lsort [glob globTest/*] } {globTest/a1 globTest/a2 globTest/a3 {globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} -test filename-14.7.1 {asterisks, question marks, and brackets} {win} { +test filename-14.7.1 {asterisks, question marks, and brackets} {win notWine} { lsort [glob globTest/*] } {globTest/.1 globTest/a1 globTest/a2 globTest/a3 {globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} -test filename-14.9 {asterisks, question marks, and brackets} {unixOrWin} { +test filename-14.9 {asterisks, question marks, and brackets} {unixOrWin notWine} { lsort [glob globTest/.*] } {globTest/. globTest/.. globTest/.1} test filename-14.11 {asterisks, question marks, and brackets} {unixOrWin} { @@ -1243,7 +1244,7 @@ test filename-14.11 {asterisks, question marks, and brackets} {unixOrWin} { test filename-14.13 {asterisks, question marks, and brackets} {unixOrWin} { lsort [glob {globTest/[xyab]1.*}] } {globTest/x1.c globTest/y1.c} -test filename-14.15 {asterisks, question marks, and brackets} {unixOrWin} { +test filename-14.15 {asterisks, question marks, and brackets} {unixOrWin notWine} { lsort [glob globTest/*/] } {globTest/a1/ globTest/a2/ globTest/a3/} test filename-14.17 {asterisks, question marks, and brackets} -setup { @@ -1283,7 +1284,7 @@ test filename-14.25 {type specific globbing} {unix} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] -test filename-14.25.1 {type specific globbing} {win} { +test filename-14.25.1 {type specific globbing} {win notWine} { lsort [glob -dir globTest -types f *] } [lsort [list \ [file join $globname .1]\ diff --git a/tests/registry.test b/tests/registry.test index 53e48fe..dbf4575 100644 --- a/tests/registry.test +++ b/tests/registry.test @@ -24,6 +24,7 @@ if {[testConstraint win]} { testConstraint reg 1 } } +testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}] # determine the current locale testConstraint english [expr { @@ -673,10 +674,10 @@ test registry-12.2 {BroadcastValue} -constraints {win reg} -body { test registry-12.3 {BroadcastValue} -constraints {win reg} -body { registry broadcast "" - 500 } -returnCodes error -result "wrong # args: should be \"registry broadcast keyName ?-timeout milliseconds?\"" -test registry-12.4 {BroadcastValue} -constraints {win reg} -body { +test registry-12.4 {BroadcastValue} -constraints {win reg notWine} -body { registry broadcast {Environment} } -result {1 0} -test registry-12.5 {BroadcastValue} -constraints {win reg} -body { +test registry-12.5 {BroadcastValue} -constraints {win reg notWine} -body { registry b {} } -result {1 0} diff --git a/tests/safe.test b/tests/safe.test index ebaedabe..1177e19 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -12,7 +12,7 @@ # - Tests 5.* test the example packages themselves before they # are used to test Safe Base interpreters. # - Alternative tests using stock packages of Tcl 8.7 are in file -# safe-stock87.test. +# safe-stock.test. # # Copyright (c) 1995-1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. @@ -169,7 +169,7 @@ test safe-4.6 {safe::interpDelete, indirectly} -setup { a eval exit } -result "" -# The old test "safe-5.1" has been moved to "safe-stock87-9.8". +# The old test "safe-5.1" has been moved to "safe-stock-9.8". # A replacement test using example files is "safe-9.8". # Tests 5.* test the example files before using them to test safe interpreters. diff --git a/tests/socket.test b/tests/socket.test index 868c17a..6a045b1 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -72,6 +72,7 @@ catch [list package require -exact Tcltest [info patchlevel]] if {[expr {[info exists ::env(TRAVIS_OSX_IMAGE)] && [string match xcode* $::env(TRAVIS_OSX_IMAGE)]}]} { return } +testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}] # Some tests require the Thread package or exec command testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}] @@ -734,7 +735,7 @@ test socket_$af-2.12 {} [list socket stdio supported_$af] { close $f set ::done } 0 -test socket_$af-2.13 {Bug 1758a0b603} {socket stdio} { +test socket_$af-2.13 {Bug 1758a0b603} {socket stdio notWine} { file delete $path(script) set f [open $path(script) w] puts $f { @@ -1543,7 +1544,7 @@ test socket_$af-11.11 {testing spurious events} -setup { after cancel $timer sendCommand {close $server} } -result {0 2690 1} -test socket_$af-11.12 {testing EOF stickyness} -constraints [list socket supported_$af doTestsWithRemoteServer] -setup { +test socket_$af-11.12 {testing EOF stickyness} -constraints [list socket supported_$af doTestsWithRemoteServer notWine] -setup { set counter 0 set done 0 set port [sendCommand { @@ -2101,7 +2102,7 @@ test socket-14.4 {[socket -async] and both, readdable and writable fileevents} \ } -result {{} bye} # FIXME: we should also have an IPv6 counterpart of this test socket-14.5 {[socket -async] which fails before any connect() can be made} \ - -constraints {socket supported_inet} \ + -constraints {socket supported_inet notWine} \ -body { # address from rfc5737 socket -async -myaddr 192.0.2.42 127.0.0.1 [randport] @@ -2436,7 +2437,7 @@ test socket-14.12 {[socket -async] background progress triggered by [fconfigure } -result {connection refused} test socket-14.13 {testing writable event when quick failure} \ - -constraints {socket win supported_inet} \ + -constraints {socket win supported_inet notWine} \ -body { # Test for bug 336441ed59 where a quick background fail was ignored @@ -2520,7 +2521,7 @@ test socket-14.18 {bug c6ed4acfd8: running async socket connect made other conne } -result {} test socket-14.19 {tip 456 -- introduce the -reuseport option} \ - -constraints {socket} \ + -constraints {socket notWine} \ -body { proc accept {channel address port} {} set port [randport] diff --git a/tests/winDde.test b/tests/winDde.test index 99ac8af..78a36f8 100644 --- a/tests/winDde.test +++ b/tests/winDde.test @@ -24,6 +24,7 @@ if {[testConstraint win]} { testConstraint dde 1 } } +testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}] # ------------------------------------------------------------------------- @@ -161,7 +162,7 @@ test winDde-3.6 {DDE request utf-8} -constraints dde -body { } -result 196 # Set variable a to A with diaeresis (unicode C4) using binary execute # and compose utf-8 (e.g. "c3 84" ) manualy -test winDde-3.7 {DDE request binary} -constraints dde -body { +test winDde-3.7 {DDE request binary} -constraints {dde notWine} -body { set \xe1 "not set" dde execute -binary TclEval self [list set \xc3\xa1 \xc3\x84\x00] scan [set \xe1] %c diff --git a/tests/winFCmd.test b/tests/winFCmd.test index ef62cec..70db379 100644 --- a/tests/winFCmd.test +++ b/tests/winFCmd.test @@ -29,6 +29,7 @@ testConstraint cdrom 0 testConstraint exdev 0 testConstraint longFileNames 0 testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}] +testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}] proc createfile {file {string a}} { set f [open $file w] @@ -132,25 +133,25 @@ test winFCmd-1.1 {TclpRenameFile: errno: EACCES} -body { } -constraints {win cdrom testfile} -returnCodes error -result EACCES test winFCmd-1.2 {TclpRenameFile: errno: EEXIST} -setup { cleanup -} -constraints {win testfile} -body { +} -constraints {win testfile notWine} -body { file mkdir td1/td2/td3 file mkdir td2 testfile mv td2 td1/td2 } -returnCodes error -result EEXIST test winFCmd-1.3 {TclpRenameFile: errno: EINVAL} -setup { cleanup -} -constraints {win testfile} -body { +} -constraints {win testfile notWine} -body { testfile mv / td1 } -returnCodes error -result EINVAL test winFCmd-1.4 {TclpRenameFile: errno: EINVAL} -setup { cleanup -} -constraints {win testfile} -body { +} -constraints {win testfile notWine} -body { file mkdir td1 testfile mv td1 td1/td2 } -returnCodes error -result EINVAL test winFCmd-1.5 {TclpRenameFile: errno: EISDIR} -setup { cleanup -} -constraints {win testfile} -body { +} -constraints {win testfile notWine} -body { file mkdir td1 createfile tf1 testfile mv tf1 td1 @@ -255,7 +256,7 @@ test winFCmd-1.22 {TclpRenameFile: long dst} -setup { } -returnCodes error -result ENAMETOOLONG test winFCmd-1.23 {TclpRenameFile: move dir into self} -setup { cleanup -} -constraints {win testfile} -body { +} -constraints {win testfile notWine} -body { file mkdir td1 testfile mv [pwd]/td1 td1/td2 } -returnCodes error -result EINVAL @@ -300,21 +301,21 @@ test winFCmd-1.29 {TclpRenameFile: src is dir} -setup { } -returnCodes error -result ENOTDIR test winFCmd-1.30 {TclpRenameFile: dst is dir} -setup { cleanup -} -constraints {win testfile} -body { +} -constraints {win testfile notWine} -body { file mkdir td1 file mkdir td2/td2 testfile mv td1 td2 } -returnCodes error -result EEXIST test winFCmd-1.31 {TclpRenameFile: TclpRemoveDirectory fails} -setup { cleanup -} -constraints {win testfile} -body { +} -constraints {win testfile notWine} -body { file mkdir td1 file mkdir td2/td2 testfile mv td1 td2 } -returnCodes error -result EEXIST test winFCmd-1.32 {TclpRenameFile: TclpRemoveDirectory succeeds} -setup { cleanup -} -constraints {win testfile} -body { +} -constraints {win testfile notWine} -body { file mkdir td1/td2 file mkdir td2 testfile mv td1 td2 @@ -343,7 +344,7 @@ test winFCmd-1.34 {TclpRenameFile: src is dir, dst is not} -setup { } -returnCodes error -result ENOTDIR test winFCmd-1.35 {TclpRenameFile: src is not dir, dst is} -setup { cleanup -} -constraints {win testfile} -body { +} -constraints {win testfile notWine} -body { file mkdir td1 createfile tf1 testfile mv tf1 td1 @@ -394,7 +395,7 @@ proc MakeFiles {dirname} { test winFCmd-1.38 {TclpRenameFile: check rename of conflicting inodes} -setup { cleanup -} -constraints {win winNonZeroInodes knownMsvcBug} -body { +} -constraints {win winNonZeroInodes knownMsvcBug notWine} -body { file mkdir td1 foreach {a b} [MakeFiles td1] break file rename -force $a $b @@ -639,7 +640,7 @@ test winFCmd-5.1 {TclpCopyDirectory: calls TraverseWinTree} -setup { test winFCmd-6.1 {TclpRemoveDirectory: errno: EACCES} -setup { cleanup -} -constraints {winVista testfile testchmod knownMsvcBug} -body { +} -constraints {winVista testfile testchmod knownMsvcBug notWine} -body { file mkdir td1 testchmod 0 td1 testfile rmdir td1 @@ -693,7 +694,7 @@ test winFCmd-6.8 {TclpRemoveDirectory: RemoveDirectory fails} -setup { } -result {1 {tf1 ENOTDIR}} test winFCmd-6.9 {TclpRemoveDirectory: errno == EACCES} -setup { cleanup -} -constraints {winVista testfile testchmod knownMsvcBug} -body { +} -constraints {winVista testfile testchmod knownMsvcBug notWine} -body { file mkdir td1 testchmod 0 td1 testfile rmdir td1 @@ -704,14 +705,14 @@ test winFCmd-6.9 {TclpRemoveDirectory: errno == EACCES} -setup { } -result {td1 EACCES} test winFCmd-6.11 {TclpRemoveDirectory: attr == -1} -setup { cleanup -} -constraints {win testfile} -body { +} -constraints {win testfile notWine} -body { testfile rmdir / # WinXP returns EEXIST, WinNT seems to return EACCES. No policy # decision has been made as to which is correct. } -returnCodes error -match regexp -result {^/ E(ACCES|EXIST)$} test winFCmd-6.13 {TclpRemoveDirectory: write-protected} -setup { cleanup -} -constraints {winVista testfile testchmod knownMsvcBug} -body { +} -constraints {winVista testfile testchmod knownMsvcBug notWine} -body { file mkdir td1 testchmod 0 td1 testfile rmdir td1 @@ -940,7 +941,7 @@ test winFCmd-9.1 {TraversalDelete: DOTREE_F} -setup { } -result {} test winFCmd-9.3 {TraversalDelete: DOTREE_PRED} -setup { cleanup -} -constraints {winVista testfile testchmod knownMsvcBug} -body { +} -constraints {winVista testfile testchmod knownMsvcBug notWine} -body { file mkdir td1/td2 testchmod 0 td1 testfile rmdir -force td1 @@ -1129,7 +1130,7 @@ test winFCmd-15.2 {SetWinFileAttributes - archive} -constraints {win} -setup { } -cleanup { cleanup } -result {{} 1} -test winFCmd-15.3 {SetWinFileAttributes - archive} -constraints {win} -setup { +test winFCmd-15.3 {SetWinFileAttributes - archive} -constraints {win notWine} -setup { cleanup } -body { createfile td1 {} @@ -1137,7 +1138,7 @@ test winFCmd-15.3 {SetWinFileAttributes - archive} -constraints {win} -setup { } -cleanup { cleanup } -result {{} 0} -test winFCmd-15.4 {SetWinFileAttributes - hidden} -constraints {win} -setup { +test winFCmd-15.4 {SetWinFileAttributes - hidden} -constraints {win notWine} -setup { cleanup } -body { createfile td1 {} @@ -1170,7 +1171,7 @@ test winFCmd-15.7 {SetWinFileAttributes - readonly} -setup { } -cleanup { cleanup } -result {{} 0} -test winFCmd-15.8 {SetWinFileAttributes - system} -constraints {win} -setup { +test winFCmd-15.8 {SetWinFileAttributes - system} -constraints {win notWine} -setup { cleanup } -body { createfile td1 {} diff --git a/tests/winFile.test b/tests/winFile.test index d8d1b7c..2c0988a 100644 --- a/tests/winFile.test +++ b/tests/winFile.test @@ -24,6 +24,7 @@ testConstraint notNTFS 0 if {[testConstraint testvolumetype]} { testConstraint notNTFS [expr {[testvolumetype] eq "NTFS"}] } +testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}] test winFile-1.1 {TclpGetUserHome} -constraints {win} -body { glob ~nosuchuser @@ -150,7 +151,7 @@ if {[testConstraint win]} { test winFile-4.0 { Enhanced NTFS user/group permissions: test no acccess } -constraints { - win notNTFS + win notNTFS notWine } -setup { set owner [getuser $fname] set user $::env(USERDOMAIN)\\$::env(USERNAME) @@ -165,7 +166,7 @@ test winFile-4.0 { test winFile-4.1 { Enhanced NTFS user/group permissions: test readable only } -constraints { - win notNTFS + win notNTFS notWine } -setup { set user $::env(USERDOMAIN)\\$::env(USERNAME) } -body { @@ -176,7 +177,7 @@ test winFile-4.1 { test winFile-4.2 { Enhanced NTFS user/group permissions: test writable only } -constraints { - win notNTFS + win notNTFS notWine } -setup { set user $::env(USERDOMAIN)\\$::env(USERNAME) } -body { diff --git a/tests/winPipe.test b/tests/winPipe.test index 0263823..919e336 100644 --- a/tests/winPipe.test +++ b/tests/winPipe.test @@ -28,6 +28,9 @@ set org_pwd [pwd] set bindir [file join $org_pwd [file dirname [info nameofexecutable]]] set cat32 [file join $bindir cat32.exe] +testConstraint notWine [expr {$::tcl_platform(platform) ne "windows" || ![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}] + + # several test-cases here expect current directory == [temporaryDirectory]: cd [temporaryDirectory] @@ -197,7 +200,7 @@ test winpipe-4.1 {Tcl_WaitPid} {win exec cat32} { vwait x list $result $x [contents $path(stderr)] } "{$big} 1 stderr32" -test winpipe-4.2 {Tcl_WaitPid: return of exception codes, SIGFPE} {win exec testexcept} { +test winpipe-4.2 {Tcl_WaitPid: return of exception codes, SIGFPE} {win exec testexcept notWine} { set f [open "|[list [interpreter]]" w+] set pid [pid $f] puts $f "load $::tcltestlib Tcltest" @@ -205,7 +208,7 @@ test winpipe-4.2 {Tcl_WaitPid: return of exception codes, SIGFPE} {win exec test set status [catch {close $f}] list $status [expr {$pid == [lindex $::errorCode 1]}] [lindex $::errorCode 2] } {1 1 SIGFPE} -test winpipe-4.3 {Tcl_WaitPid: return of exception codes, SIGSEGV} {win exec testexcept} { +test winpipe-4.3 {Tcl_WaitPid: return of exception codes, SIGSEGV} {win exec testexcept notWine} { set f [open "|[list [interpreter]]" w+] set pid [pid $f] puts $f "load $::tcltestlib Tcltest" @@ -213,7 +216,7 @@ test winpipe-4.3 {Tcl_WaitPid: return of exception codes, SIGSEGV} {win exec tes set status [catch {close $f}] list $status [expr {$pid == [lindex $::errorCode 1]}] [lindex $::errorCode 2] } {1 1 SIGSEGV} -test winpipe-4.4 {Tcl_WaitPid: return of exception codes, SIGILL} {win exec testexcept} { +test winpipe-4.4 {Tcl_WaitPid: return of exception codes, SIGILL} {win exec testexcept notWine} { set f [open "|[list [interpreter]]" w+] set pid [pid $f] puts $f "load $::tcltestlib Tcltest" @@ -221,7 +224,7 @@ test winpipe-4.4 {Tcl_WaitPid: return of exception codes, SIGILL} {win exec test set status [catch {close $f}] list $status [expr {$pid == [lindex $::errorCode 1]}] [lindex $::errorCode 2] } {1 1 SIGILL} -test winpipe-4.5 {Tcl_WaitPid: return of exception codes, SIGINT} {win exec testexcept} { +test winpipe-4.5 {Tcl_WaitPid: return of exception codes, SIGINT} {win exec testexcept notWine} { set f [open "|[list [interpreter]]" w+] set pid [pid $f] puts $f "load $::tcltestlib Tcltest" @@ -519,7 +522,7 @@ test winpipe-8.2 {BuildCommandLine/parse_cmdline pass-thru: check injection on s } -result {} test winpipe-8.3 {BuildCommandLine/parse_cmdline pass-thru: check injection on special meta-chars (jointly)} \ --constraints {win exec} -body { +-constraints {win exec notWine} -body { _testExecArgs 0 \ [list START {*}$injectList END] \ [list "START\"" {*}$injectList END] \ @@ -528,7 +531,7 @@ test winpipe-8.3 {BuildCommandLine/parse_cmdline pass-thru: check injection on s } -result {} test winpipe-8.4 {BuildCommandLine/parse_cmdline pass-thru: check injection on special meta-chars (command/jointly args)} \ --constraints {win exec} -body { +-constraints {win exec notWine} -body { _testExecArgs 2 \ [list START {*}$injectList END] \ [list "START\"" {*}$injectList END] \ @@ -537,7 +540,7 @@ test winpipe-8.4 {BuildCommandLine/parse_cmdline pass-thru: check injection on s } -result {} test winpipe-8.5 {BuildCommandLine/parse_cmdline pass-thru: check injection on special meta-chars (random mix)} \ --constraints {win exec} -body { +-constraints {win exec notWine} -body { set lst {} set maps { {\&|^<>!()%} diff --git a/unix/Makefile.in b/unix/Makefile.in index 9df3a5f..96ace8c 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -866,7 +866,6 @@ SHELL_ENV = @LD_LIBRARY_PATH_VAR@=`pwd`:${@LD_LIBRARY_PATH_VAR@} \ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}" ${TCLTEST_EXE}: ${TCLTEST_OBJS} ${TCL_LIB_FILE} ${TCL_STUB_LIB_FILE} ${BUILD_DLTEST} - rm -rf $(TOP_DIR)/tests/safe-stock86.test $(MAKE) tcltest-real LIB_RUNTIME_DIR="`pwd`" tcltest-real: @@ -962,7 +961,8 @@ install: $(INSTALL_TARGETS) install-strip: $(MAKE) $(INSTALL_TARGETS) \ - INSTALL_PROGRAM="$(INSTALL_PROGRAM) ${INSTALL_STRIP_PROGRAM}" + INSTALL_PROGRAM="$(INSTALL_PROGRAM) ${INSTALL_STRIP_PROGRAM}" \ + INSTALL_LIBRARY="$(INSTALL_LIBRARY) ${INSTALL_STRIP_LIBRARY}" install-binaries: binaries @for i in "$(LIB_INSTALL_DIR)" "$(BIN_INSTALL_DIR)" \ diff --git a/unix/README b/unix/README index 3340dc6..3c1a207 100644 --- a/unix/README +++ b/unix/README @@ -91,7 +91,7 @@ How To Compile And Install Tcl: for descriptions of the probes made available, see http://wiki.tcl.tk/DTrace for more details --with-encoding=ENCODING Specifies the encoding for compile-time - configuration values. Defaults to iso8859-1, + configuration values. Defaults to utf-8, which is also sufficient for ASCII. --with-tzdata=FLAG Specifies whether to install timezone data. By default, the configure script tries to detect diff --git a/unix/configure b/unix/configure index 60d60cb..62b1257 100755 --- a/unix/configure +++ b/unix/configure @@ -1430,7 +1430,7 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-encoding encoding for configuration values (default: - iso8859-1) + utf-8) --with-system-libtommath use external libtommath (default: true if available, false otherwise) @@ -3982,7 +3982,7 @@ _ACEOF else -$as_echo "#define TCL_CFGVAL_ENCODING \"iso8859-1\"" >>confdefs.h +$as_echo "#define TCL_CFGVAL_ENCODING \"utf-8\"" >>confdefs.h fi diff --git a/unix/install-sh b/unix/install-sh index 7c34c3f..21b733a 100755 --- a/unix/install-sh +++ b/unix/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-04-20.01; # UTC +scriptversion=2020-07-26.22; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -35,25 +35,21 @@ scriptversion=2011-04-20.01; # UTC # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it +# 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. +tab=' ' nl=' ' -IFS=" "" $nl" +IFS=" $tab$nl" -# set DOITPROG to echo to test this script +# Set DOITPROG to "echo" to test this script. -# Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi +doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. @@ -68,22 +64,15 @@ mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - posix_mkdir= # Desired mode of installed file. mode=0755 +# Create dirs (including intermediate dirs) using mode 755. +# This is like GNU 'install' as of coreutils 8.32 (2020). +mkdir_umask=22 + chgrpcmd= chmodcmd=$chmodprog chowncmd= @@ -97,7 +86,7 @@ dir_arg= dst_arg= copy_on_change=false -no_target_directory= +is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE @@ -120,7 +109,7 @@ Options: -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. - -S $stripprog installed files. + -S OPTION $stripprog installed files using OPTION. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. @@ -138,45 +127,60 @@ while test $# -ne 0; do -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift;; + shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift;; + shift;; -s) stripcmd=$stripprog;; -S) stripcmd="$stripprog $2" - shift;; + shift;; - -t) dst_arg=$2 - shift;; + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; - -T) no_target_directory=true;; + -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; - --) shift - break;; + --) shift + break;; - -*) echo "$0: invalid option: $1" >&2 - exit 1;; + -*) echo "$0: invalid option: $1" >&2 + exit 1;; *) break;; esac shift done +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. @@ -190,6 +194,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then fi shift # arg dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac done fi @@ -198,12 +206,21 @@ if test $# -eq 0; then echo "$0: no input file specified." >&2 exit 1 fi - # It's OK to call `install-sh -d' without argument. + # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 @@ -219,16 +236,16 @@ if test -z "$dir_arg"; then *[0-7]) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw='% 200' + u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw=,u+rw + u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac @@ -236,9 +253,9 @@ fi for src do - # Protect names starting with `-'. + # Protect names problematic for 'test' and other utilities. case $src in - -*) src=./$src;; + -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then @@ -260,185 +277,150 @@ do echo "$0: no destination specified." >&2 exit 1 fi - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. + # If destination is a directory, append the input filename. if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 fi dstdir=$dst - dst=$dstdir/`basename "$src"` + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac dstdir_status=0 else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - + dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + # The $RANDOM variable is not portable (e.g., dash). Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap ' + ret=$? + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null + exit $ret + ' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p'. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else - mkdir_mode= + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; + trap '' 0;; esac if $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else - # The umask is ridiculous, or mkdir does not conform to POSIX, + # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in - /*) prefix='/';; - -*) prefix='./';; - *) prefix='';; + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; esac - eval "$initialize_posix_glob" - oIFS=$IFS IFS=/ - $posix_glob set -f + set -f set fnord $dstdir shift - $posix_glob set +f + set +f IFS=$oIFS prefixes= for d do - test -z "$d" && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ done if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true fi fi fi @@ -451,14 +433,25 @@ do else # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + (umask $cp_umask && + { test -z "$stripcmd" || { + # Create $dsttmp read-write so that cp doesn't create it read-only, + # which would cause strip to fail. + if test -z "$doit"; then + : >"$dsttmp" # No need to fork-exec 'touch'. + else + $doit touch "$dsttmp" + fi + } + } && + $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # @@ -473,15 +466,12 @@ do # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - + set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then @@ -494,24 +484,24 @@ do # to itself, or perhaps because mv is so ancient that it does not # support -f. { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 @@ -520,9 +510,9 @@ do done # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" -# End: +# End:
\ No newline at end of file diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 8ee17e1..9f68967 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -2445,14 +2445,14 @@ AC_DEFUN([SC_TCL_64BIT_FLAGS], [ AC_DEFUN([SC_TCL_CFG_ENCODING], [ AC_ARG_WITH(encoding, AC_HELP_STRING([--with-encoding], - [encoding for configuration values (default: iso8859-1)]), + [encoding for configuration values (default: utf-8)]), with_tcencoding=${withval}) if test x"${with_tcencoding}" != x ; then AC_DEFINE_UNQUOTED(TCL_CFGVAL_ENCODING,"${with_tcencoding}", [What encoding should be used for embedded configuration info?]) else - AC_DEFINE(TCL_CFGVAL_ENCODING,"iso8859-1", + AC_DEFINE(TCL_CFGVAL_ENCODING,"utf-8", [What encoding should be used for embedded configuration info?]) fi ]) diff --git a/win/Makefile.in b/win/Makefile.in index f1b72e1..9757c2e 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -596,7 +596,6 @@ ${TEST_DLL_FILE}: ${TCL_STUB_LIB_FILE} ${TCLTEST_OBJS} ${TEST_EXE_FILE}: ${TCL_STUB_LIB_FILE} ${TCLTEST_OBJS} tclTestMain.${OBJEXT} @$(RM) ${TEST_EXE_FILE} - @$(RM) $(ROOT_DIR_NATIVE)/tests/safe-stock86.test $(CC) $(CFLAGS) $(TCLTEST_OBJS) tclTestMain.$(OBJEXT) $(TCL_LIB_FILE) $(TCL_STUB_LIB_FILE) $(LIBS) \ tclsh.$(RES) $(CC_EXENAME) $(LDFLAGS_CONSOLE) $(COPY) tclsh.exe.manifest ${TEST_EXE_FILE}.manifest diff --git a/win/configure b/win/configure index d824244..5888332 100755 --- a/win/configure +++ b/win/configure @@ -3749,8 +3749,7 @@ fi _ACEOF else - # Default encoding on windows is not "iso8859-1" - $as_echo "#define TCL_CFGVAL_ENCODING \"cp1252\"" >>confdefs.h + $as_echo "#define TCL_CFGVAL_ENCODING \"utf-8\"" >>confdefs.h fi diff --git a/win/makefile.vc b/win/makefile.vc index e3de98e..a28d6bf 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -114,10 +114,6 @@ # TESTPAT=<file>
# Reads the tests requested to be run from this file.
#
-# CFG_ENCODING=encoding
-# name of encoding for configuration information. Defaults
-# to cp1252
-#
# Examples:
# c:\tcl_src\win\>nmake -f makefile.vc release
# c:\tcl_src\win\>nmake -f makefile.vc test
diff --git a/win/rules.vc b/win/rules.vc index 61df910..f3e5439 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -415,9 +415,6 @@ _INSTALLDIR=$(_INSTALLDIR)\lib # NATIVE_ARCH - set to IX86 or AMD64 for the host machine
# MACHINE - same as $(ARCH) - legacy
# _VC_MANIFEST_EMBED_{DLL,EXE} - commands for embedding a manifest if needed
-# CFG_ENCODING - set to an character encoding.
-# TBD - this is passed to compiler as TCL_CFGVAL_ENCODING but can't
-# see where it is used
cc32 = $(CC) # built-in default.
link32 = link
@@ -503,10 +500,6 @@ _VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -ou _VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2
!endif
-!ifndef CFG_ENCODING
-CFG_ENCODING = \"cp1252\"
-!endif
-
################################################################
# 4. Build the nmakehlp program
# This is a helper app we need to overcome nmake's limiting
@@ -1292,7 +1285,7 @@ INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\..\include # baselibs - minimum Windows libraries required. Parent makefile can
# define PRJ_LIBS before including rules.rc if additional libs are needed
-OPTDEFINES = /DTCL_CFGVAL_ENCODING=$(CFG_ENCODING) /DSTDC_HEADERS
+OPTDEFINES = /DSTDC_HEADERS
!if $(VCVERSION) >= 1600
OPTDEFINES = $(OPTDEFINES) /DHAVE_STDINT_H=1
!else
@@ -1085,8 +1085,7 @@ AC_DEFUN([SC_TCL_CFG_ENCODING], [ if test x"${with_tcencoding}" != x ; then AC_DEFINE_UNQUOTED(TCL_CFGVAL_ENCODING,"${with_tcencoding}") else - # Default encoding on windows is not "iso8859-1" - AC_DEFINE(TCL_CFGVAL_ENCODING,"cp1252") + AC_DEFINE(TCL_CFGVAL_ENCODING,"utf-8") fi ]) diff --git a/win/tclWinPort.h b/win/tclWinPort.h index 94c8e87..d0b689f 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -18,6 +18,10 @@ /* See [Bug 3354324]: file mtime sets wrong time */ # define __MINGW_USE_VC2005_COMPAT #endif +#if !defined(__USE_MINGW_ANSI_STDIO) +/* See [Bug c975939973]: Usage of gnu_printf in latest mingw-w64 */ +# define __USE_MINGW_ANSI_STDIO 0 +#endif #if defined(_MSC_VER) && defined(_WIN64) && !defined(STATIC_BUILD) \ && !defined(MP_32BIT) && !defined(MP_64BIT) # define MP_64BIT |