summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-12-03 14:39:19 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-12-03 14:39:19 (GMT)
commitc30f3e95690c1fa32296fb55213cb7f03ac14345 (patch)
treec0408e038d57d98337a74e64296d142d190b8dd9
parentf23698ae342e74bcedb17f24cde0f80106e14ea7 (diff)
parentc99f35416608c70d8e277b38405429a50b64bd84 (diff)
downloadtcl-c30f3e95690c1fa32296fb55213cb7f03ac14345.zip
tcl-c30f3e95690c1fa32296fb55213cb7f03ac14345.tar.gz
tcl-c30f3e95690c1fa32296fb55213cb7f03ac14345.tar.bz2
Merge 8.6
-rw-r--r--library/install.tcl10
-rw-r--r--tests/chanio.test6
-rw-r--r--tests/cmdAH.test14
-rw-r--r--tests/cmdMZ.test2
-rw-r--r--tests/fCmd.test48
-rw-r--r--tests/fileName.test4
-rw-r--r--tests/fileSystem.test2
-rw-r--r--tests/io.test4
-rw-r--r--tests/tcltest.test4
-rw-r--r--tests/unixFCmd.test12
-rw-r--r--tools/installData.tcl4
-rw-r--r--tools/mkVfs.tcl4
12 files changed, 57 insertions, 57 deletions
diff --git a/library/install.tcl b/library/install.tcl
index 26e5e68..2c5afa7 100644
--- a/library/install.tcl
+++ b/library/install.tcl
@@ -35,7 +35,7 @@ proc ::practcl::_pkgindex_directory {path} {
# Read the file, and override assumptions as needed
###
set fin [open $file r]
- fconfigure $fin -eofchar \032
+ fconfigure $fin -encoding utf-8 -eofchar \032
set dat [read $fin]
close $fin
# Look for a teapot style Package statement
@@ -59,7 +59,7 @@ proc ::practcl::_pkgindex_directory {path} {
foreach file [glob -nocomplain $path/*.tcl] {
if { [file tail $file] == "version_info.tcl" } continue
set fin [open $file r]
- fconfigure $fin -eofchar \032
+ fconfigure $fin -encoding utf-8 -eofchar \032
set dat [read $fin]
close $fin
if {![regexp "package provide" $dat]} continue
@@ -79,7 +79,7 @@ proc ::practcl::_pkgindex_directory {path} {
return $buffer
}
set fin [open $pkgidxfile r]
- fconfigure $fin -eofchar \032
+ fconfigure $fin -encoding utf-8 -eofchar \032
set dat [read $fin]
close $fin
set trace 0
@@ -202,7 +202,7 @@ proc ::practcl::installDir {d1 d2} {
} elseif {[file isfile $f]} {
file copy -force $f [file join $d2 $ftail]
if {$::tcl_platform(platform) eq {unix}} {
- file attributes [file join $d2 $ftail] -permissions 0644
+ file attributes [file join $d2 $ftail] -permissions 0o644
} else {
file attributes [file join $d2 $ftail] -readonly 1
}
@@ -210,7 +210,7 @@ proc ::practcl::installDir {d1 d2} {
}
if {$::tcl_platform(platform) eq {unix}} {
- file attributes $d2 -permissions 0755
+ file attributes $d2 -permissions 0o755
} else {
file attributes $d2 -readonly 1
}
diff --git a/tests/chanio.test b/tests/chanio.test
index dd45381..9d8498f 100644
--- a/tests/chanio.test
+++ b/tests/chanio.test
@@ -5341,7 +5341,7 @@ test chan-io-40.2 {POSIX open access modes: CREAT} -setup {
} -constraints {unix} -body {
set f [open $path(test3) {WRONLY CREAT} 0600]
file stat $path(test3) stats
- set x [format "%#o" [expr {$stats(mode) & 0o777}]]
+ set x [format 0o%03o [expr {$stats(mode) & 0o777}]]
chan puts $f "line 1"
chan close $f
set f [open $path(test3) r]
@@ -5355,8 +5355,8 @@ test chan-io-40.3 {POSIX open access modes: CREAT} -setup {
# This test only works if your umask is 2, like ouster's.
chan close [open $path(test3) {WRONLY CREAT}]
file stat $path(test3) stats
- format "%#o" [expr {$stats(mode) & 0o777}]
-} -result [format %#5o [expr {0o666 & ~ $umaskValue}]]
+ format 0o%03o [expr {$stats(mode) & 0o777}]
+} -result [format 0o%03o [expr {0o666 & ~ $umaskValue}]]
test chan-io-40.4 {POSIX open access modes: CREAT} -setup {
file delete $path(test3)
} -body {
diff --git a/tests/cmdAH.test b/tests/cmdAH.test
index 9e07b2a..22298b2 100644
--- a/tests/cmdAH.test
+++ b/tests/cmdAH.test
@@ -966,10 +966,10 @@ test cmdAH-19.11 {Tcl_FileObjCmd: exists} -constraints {unix notRoot} -setup {
} -body {
makeDirectory /tmp/tcl.foo.dir
makeFile 12345 /tmp/tcl.foo.dir/file
- file attributes /tmp/tcl.foo.dir -permissions 0000
+ file attributes /tmp/tcl.foo.dir -permissions 0
file exists /tmp/tcl.foo.dir/file
} -cleanup {
- file attributes /tmp/tcl.foo.dir -permissions 0775
+ file attributes /tmp/tcl.foo.dir -permissions 0o775
removeFile /tmp/tcl.foo.dir/file
removeDirectory /tmp/tcl.foo.dir
} -result 0
@@ -992,7 +992,7 @@ test cmdAH-19.12 {Bug 3608360: [file exists] mustn't do globbing} -setup {
catch {testsetplatform $platform}
removeFile $gorpfile
set gorpfile [makeFile "Test string" gorp.file]
-catch {file attributes $gorpfile -permissions 0765}
+catch {file attributes $gorpfile -permissions 0o765}
# avoid problems with non-local filesystems
if {[testConstraint unix] && [file exists /tmp]} {
@@ -1408,7 +1408,7 @@ test cmdAH-27.4.1 {
catch {testsetplatform $platform}
removeFile $gorpfile
set gorpfile [makeFile "Test string" gorp.file]
-catch {file attributes $gorpfile -permissions 0765}
+catch {file attributes $gorpfile -permissions 0o765}
# stat
test cmdAH-28.1 {Tcl_FileObjCmd: stat} -returnCodes error -body {
@@ -1435,8 +1435,8 @@ test cmdAH-28.5 {Tcl_FileObjCmd: stat} -constraints {unix} -setup {
unset -nocomplain stat
} -body {
file stat $gorpfile stat
- expr {$stat(mode) & 0o777}
-} -result {501}
+ format 0o%03o [expr {$stat(mode) & 0o777}]
+} -result 0o765
test cmdAH-28.6 {Tcl_FileObjCmd: stat} {
list [catch {file stat _bogus_ stat} msg] [string tolower $msg] $errorCode
} {1 {could not read "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}}
@@ -1772,7 +1772,7 @@ unset -nocomplain platform
# Tcl_ForObjCmd is tested in for.test
-catch {file attributes $dirfile -permissions 0777}
+catch {file attributes $dirfile -permissions 0o777}
removeDirectory $dirfile
removeFile $gorpfile
# No idea how well [removeFile] copes with links...
diff --git a/tests/cmdMZ.test b/tests/cmdMZ.test
index 8977cbf..ef9790f 100644
--- a/tests/cmdMZ.test
+++ b/tests/cmdMZ.test
@@ -59,7 +59,7 @@ test cmdMZ-1.4 {Tcl_PwdObjCmd: failure} -setup {
# This test fails on various unix platforms (eg Linux) where permissions
# caching causes this to fail. The caching is strictly incorrect, but we
# have no control over that.
- file attr . -permissions 000
+ file attr . -permissions 0
pwd
} -returnCodes error -cleanup {
cd $cwd
diff --git a/tests/fCmd.test b/tests/fCmd.test
index 8f21d1a..e77cd90 100644
--- a/tests/fCmd.test
+++ b/tests/fCmd.test
@@ -623,10 +623,10 @@ test fCmd-6.23 {CopyRenameOneFile: TclpCopyDirectory failed} -setup {
cleanup $tmpspace
} -constraints {xdev notRoot} -body {
file mkdir td1/td2/td3
- file attributes td1 -permissions 0000
+ file attributes td1 -permissions 0
file rename td1 $tmpspace
} -returnCodes error -cleanup {
- file attributes td1 -permissions 0755
+ file attributes td1 -permissions 0o755
cleanup
} -match regexp -result {^error renaming "td1"( to "/tmp/tcl\d+/td1")?: permission denied$}
test fCmd-6.24 {CopyRenameOneFile: error uses original name} -setup {
@@ -634,10 +634,10 @@ test fCmd-6.24 {CopyRenameOneFile: error uses original name} -setup {
} -constraints {unix notRoot} -body {
file mkdir ~/td1/td2
set td1name [file join [file dirname ~] [file tail ~] td1]
- file attributes $td1name -permissions 0000
+ file attributes $td1name -permissions 0
file copy ~/td1 td1
} -returnCodes error -cleanup {
- file attributes $td1name -permissions 0755
+ file attributes $td1name -permissions 0o755
file delete -force ~/td1
} -result {error copying "~/td1": permission denied}
test fCmd-6.25 {CopyRenameOneFile: error uses original name} -setup {
@@ -646,10 +646,10 @@ test fCmd-6.25 {CopyRenameOneFile: error uses original name} -setup {
file mkdir td2
file mkdir ~/td1
set td1name [file join [file dirname ~] [file tail ~] td1]
- file attributes $td1name -permissions 0000
+ file attributes $td1name -permissions 0
file copy td2 ~/td1
} -returnCodes error -cleanup {
- file attributes $td1name -permissions 0755
+ file attributes $td1name -permissions 0o755
file delete -force ~/td1
} -result {error copying "td2" to "~/td1/td2": permission denied}
test fCmd-6.26 {CopyRenameOneFile: doesn't use original name} -setup {
@@ -657,10 +657,10 @@ test fCmd-6.26 {CopyRenameOneFile: doesn't use original name} -setup {
} -constraints {unix notRoot} -body {
file mkdir ~/td1/td2
set td2name [file join [file dirname ~] [file tail ~] td1 td2]
- file attributes $td2name -permissions 0000
+ file attributes $td2name -permissions 0
file copy ~/td1 td1
} -returnCodes error -cleanup {
- file attributes $td2name -permissions 0755
+ file attributes $td2name -permissions 0o755
file delete -force ~/td1
} -result "error copying \"~/td1\" to \"td1\": \"[file join $::env(HOME) td1 td2]\": permission denied"
test fCmd-6.27 {CopyRenameOneFile: TclpCopyDirectory failed} -setup {
@@ -675,10 +675,10 @@ test fCmd-6.28 {CopyRenameOneFile: TclpCopyDirectory failed} -setup {
cleanup $tmpspace
} -constraints {notRoot xdev} -body {
file mkdir td1/td2/td3
- file attributes td1/td2/td3 -permissions 0000
+ file attributes td1/td2/td3 -permissions 0
file rename td1 $tmpspace
} -returnCodes error -cleanup {
- file attributes td1/td2/td3 -permissions 0755
+ file attributes td1/td2/td3 -permissions 0o755
cleanup $tmpspace
} -match glob -result {error renaming "td1" to "/tmp/tcl*/td1": "td1/td2/td3": permission denied}
test fCmd-6.29 {CopyRenameOneFile: TclpCopyDirectory passed} -setup {
@@ -1342,10 +1342,10 @@ test fCmd-12.8 {renamefile: generic error} -setup {
} -constraints {unix notRoot} -body {
file mkdir tfa
file mkdir tfa/dir
- file attributes tfa -permissions 0555
+ file attributes tfa -permissions 0o555
catch {file rename tfa/dir tfa2}
} -cleanup {
- catch {file attributes tfa -permissions 0777}
+ catch {file attributes tfa -permissions 0o777}
file delete -force tfa
} -result {1}
test fCmd-12.9 {renamefile: moving a file across volumes} -setup {
@@ -1528,10 +1528,10 @@ test fCmd-14.8 {copyfile: copy directory failing} -setup {
catch {file delete -force -- tfa}
} -constraints {unix notRoot} -body {
file mkdir tfa/dir/a/b/c
- file attributes tfa/dir -permissions 0000
+ file attributes tfa/dir -permissions 0
catch {file copy tfa tfa2}
} -cleanup {
- file attributes tfa/dir -permissions 0777
+ file attributes tfa/dir -permissions 0o777
file delete -force tfa tfa2
} -result {1}
@@ -1571,10 +1571,10 @@ test fCmd-15.4 {TclMakeDirsCmd - stat failing} -setup {
} -constraints {unix notRoot} -body {
file mkdir tfa
createfile tfa/file
- file attributes tfa -permissions 0000
+ file attributes tfa -permissions 0
catch {file mkdir tfa/file}
} -cleanup {
- file attributes tfa -permissions 0777
+ file attributes tfa -permissions 0o777
file delete -force tfa
} -result {1}
test fCmd-15.5 {TclMakeDirsCmd: - making a directory several levels deep} -setup {
@@ -1671,7 +1671,7 @@ test fCmd-16.9 {error while deleting file} -setup {
} -constraints {unix notRoot} -body {
file mkdir tfa
createfile tfa/a
- file attributes tfa -permissions 0555
+ file attributes tfa -permissions 0o555
catch {file delete tfa/a}
#######
####### If any directory in a tree that is being removed does not have
@@ -1679,7 +1679,7 @@ test fCmd-16.9 {error while deleting file} -setup {
####### with "rm -rf"
#######
} -cleanup {
- file attributes tfa -permissions 0777
+ file attributes tfa -permissions 0o777
file delete -force tfa
} -result {1}
test fCmd-16.10 {deleting multiple files} -constraints {notRoot} -setup {
@@ -1701,10 +1701,10 @@ test fCmd-17.1 {mkdir stat failing on target but not ENOENT} -setup {
catch {file delete -force -- tfa1}
} -constraints {unix notRoot} -body {
file mkdir tfa1
- file attributes tfa1 -permissions 0555
+ file attributes tfa1 -permissions 0o555
catch {file mkdir tfa1/tfa2}
} -cleanup {
- file attributes tfa1 -permissions 0777
+ file attributes tfa1 -permissions 0o777
file delete -force tfa1
} -result {1}
test fCmd-17.2 {mkdir several levels deep - relative} -setup {
@@ -1912,10 +1912,10 @@ test fCmd-19.2 {rmdir error besides EEXIST} -setup {
} -constraints {unix notRoot} -body {
file mkdir tfa
file mkdir tfa/a
- file attributes tfa -permissions 0555
+ file attributes tfa -permissions 0o555
catch {file delete tfa/a}
} -cleanup {
- file attributes tfa -permissions 0777
+ file attributes tfa -permissions 0o777
file delete -force tfa
} -result {1}
test fCmd-19.3 {recursive remove} -constraints {notRoot} -setup {
@@ -1940,10 +1940,10 @@ test fCmd-20.1 {TraverseUnixTree : failure opening a subdirectory directory} -se
} -constraints {unix notRoot} -body {
file mkdir tfa
file mkdir tfa/a
- file attributes tfa/a -permissions 0000
+ file attributes tfa/a -permissions 00000
catch {file delete -force tfa}
} -cleanup {
- file attributes tfa/a -permissions 0777
+ file attributes tfa/a -permissions 0o777
file delete -force tfa
} -result {1}
test fCmd-20.2 {TraverseUnixTree : recursive delete of large directory: Bug 1034337} -setup {
diff --git a/tests/fileName.test b/tests/fileName.test
index 14d7a3b..0f34f2b 100644
--- a/tests/fileName.test
+++ b/tests/fileName.test
@@ -1329,7 +1329,7 @@ unset globname
# AFS, "000" protection doesn't prevent access by owner, so the following test
# is not portable.
-catch {file attributes globTest/a1 -permissions 0000}
+catch {file attributes globTest/a1 -permissions 0}
test filename-15.1 {unix specific globbing} {unix nonPortable} {
string tolower [list [catch {glob globTest/a1/*} msg] $msg $errorCode]
} {1 {couldn't read directory "globtest/a1": permission denied} {posix eacces {permission denied}}}
@@ -1341,7 +1341,7 @@ test filename-15.3 {unix specific no complain: no errors, good result} \
# test fails because if an error occurs, the interp's result is reset...
glob -nocomplain globTest/a2 globTest/a1/* globTest/a3
} {globTest/a2 globTest/a3}
-catch {file attributes globTest/a1 -permissions 0755}
+catch {file attributes globTest/a1 -permissions 0o755}
test filename-15.4 {unix specific no complain: no errors, good result} \
{unix nonPortable} {
# test fails because if an error occurs, the interp's result is reset...
diff --git a/tests/fileSystem.test b/tests/fileSystem.test
index a546564..77c4c7a 100644
--- a/tests/fileSystem.test
+++ b/tests/fileSystem.test
@@ -694,7 +694,7 @@ test filesystem-7.5 {cross-filesystem file copy with -force} -setup {
# First copy should succeed
set res [catch {file copy simplefs:/simplefile file2} err]
lappend res $err
- file attributes file2 -permissions 0000
+ file attributes file2 -permissions 0
# Second copy should fail (no -force)
lappend res [catch {file copy simplefs:/simplefile file2} err]
lappend res $err
diff --git a/tests/io.test b/tests/io.test
index 4db1d33..e0c682c 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -5655,8 +5655,8 @@ test io-40.3 {POSIX open access modes: CREAT} {unix umask} {
set f [open $path(test3) {WRONLY CREAT}]
close $f
file stat $path(test3) stats
- format "%#o" [expr $stats(mode)&0o777]
-} [format %#5o [expr {0o666 & ~ $umaskValue}]]
+ format 0o%03o [expr $stats(mode)&0o777]
+} [format 0o%03o [expr {0o666 & ~ $umaskValue}]]
test io-40.4 {POSIX open access modes: CREAT} {
file delete $path(test3)
set f [open $path(test3) w]
diff --git a/tests/tcltest.test b/tests/tcltest.test
index 93bad33..3177580 100644
--- a/tests/tcltest.test
+++ b/tests/tcltest.test
@@ -546,8 +546,8 @@ makeDirectory notreadable
makeDirectory notwriteable
switch -- $::tcl_platform(platform) {
unix {
- file attributes $notReadableDir -permissions 00333
- file attributes $notWriteableDir -permissions 00555
+ file attributes $notReadableDir -permissions 0o333
+ file attributes $notWriteableDir -permissions 0o555
}
default {
# note in FAT/NTFS we won't be able to protect directory with read-only attribute...
diff --git a/tests/unixFCmd.test b/tests/unixFCmd.test
index a46868a..6c6807b 100644
--- a/tests/unixFCmd.test
+++ b/tests/unixFCmd.test
@@ -96,10 +96,10 @@ test unixFCmd-1.1 {TclpRenameFile: EACCES} -setup {
cleanup
} -constraints {unix notRoot} -body {
file mkdir td1/td2/td3
- file attributes td1/td2 -permissions 0000
+ file attributes td1/td2 -permissions 0
file rename td1/td2/td3 td2
} -returnCodes error -cleanup {
- file attributes td1/td2 -permissions 0755
+ file attributes td1/td2 -permissions 0o755
cleanup
} -result {error renaming "td1/td2/td3": permission denied}
test unixFCmd-1.2 {TclpRenameFile: EEXIST} -setup {
@@ -336,7 +336,7 @@ test unixFCmd-17.1 {SetPermissionsAttribute} -setup {
catch {file delete -force -- foo.test}
} -constraints {unix notRoot} -body {
close [open foo.test w]
- list [file attributes foo.test -permissions 0000] \
+ list [file attributes foo.test -permissions 0] \
[file attributes foo.test -permissions]
} -cleanup {
file delete -force -- foo.test
@@ -344,7 +344,7 @@ test unixFCmd-17.1 {SetPermissionsAttribute} -setup {
test unixFCmd-17.2 {SetPermissionsAttribute} -setup {
catch {file delete -force -- foo.test}
} -constraints {unix notRoot} -returnCodes error -body {
- file attributes foo.test -permissions 0000
+ file attributes foo.test -permissions 0
} -result {could not set permissions for file "foo.test": no such file or directory}
test unixFCmd-17.3 {SetPermissionsAttribute} -setup {
catch {file delete -force -- foo.test}
@@ -390,11 +390,11 @@ test unixFCmd-18.1 {Unix pwd} -constraints {unix notRoot nonPortable} -setup {
set nd $cd/tstdir
file mkdir $nd
cd $nd
- file attributes $nd -permissions 0000
+ file attributes $nd -permissions 0
pwd
} -returnCodes error -cleanup {
cd $cd
- file attributes $nd -permissions 0755
+ file attributes $nd -permissions 0o755
file delete $nd
} -match glob -result {error getting working directory name:*}
diff --git a/tools/installData.tcl b/tools/installData.tcl
index dd7976b..4a3b1ee 100644
--- a/tools/installData.tcl
+++ b/tools/installData.tcl
@@ -32,7 +32,7 @@ proc copyDir {d1 d2} {
} elseif {[file isfile $f]} {
file copy -force $f [file join $d2 $ftail]
if {$::tcl_platform(platform) eq {unix}} {
- file attributes [file join $d2 $ftail] -permissions 0644
+ file attributes [file join $d2 $ftail] -permissions 0o644
} else {
file attributes [file join $d2 $ftail] -readonly 1
}
@@ -40,7 +40,7 @@ proc copyDir {d1 d2} {
}
if {$::tcl_platform(platform) eq {unix}} {
- file attributes $d2 -permissions 0755
+ file attributes $d2 -permissions 0o755
} else {
file attributes $d2 -readonly 1
}
diff --git a/tools/mkVfs.tcl b/tools/mkVfs.tcl
index cbfb81e..c4021f6 100644
--- a/tools/mkVfs.tcl
+++ b/tools/mkVfs.tcl
@@ -39,7 +39,7 @@ proc copyDir {d1 d2} {
} elseif {[file isfile $f]} {
file copy -force $f [file join $d2 $ftail]
if {$::tcl_platform(platform) eq {unix}} {
- file attributes [file join $d2 $ftail] -permissions 0644
+ file attributes [file join $d2 $ftail] -permissions 0o644
} else {
file attributes [file join $d2 $ftail] -readonly 1
}
@@ -47,7 +47,7 @@ proc copyDir {d1 d2} {
}
if {$::tcl_platform(platform) eq {unix}} {
- file attributes $d2 -permissions 0755
+ file attributes $d2 -permissions 0o755
} else {
file attributes $d2 -readonly 1
}