summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-09-07 13:40:07 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-09-07 13:40:07 (GMT)
commit7981bfb58d1a23411bf9cc16e75b4631cb5c005c (patch)
tree3f6ee7e240ba8b7ffa38ff0c7f614b03c04f4635
parentdb234eeee9bc569615b0e5969fe0c39a9eda5875 (diff)
parent4f36ce71ddc612a8e496c2832a9d0d2633cb03f1 (diff)
downloadtcl-7981bfb58d1a23411bf9cc16e75b4631cb5c005c.zip
tcl-7981bfb58d1a23411bf9cc16e75b4631cb5c005c.tar.gz
tcl-7981bfb58d1a23411bf9cc16e75b4631cb5c005c.tar.bz2
Merge 8.7. Exchange "zipfs mount"/TclZipfs_Mount arguments: archive <-> mountpoint
-rw-r--r--doc/FindExec.34
-rw-r--r--doc/InitSubSyst.34
-rw-r--r--doc/Panic.34
-rw-r--r--doc/zipfs.36
-rw-r--r--doc/zipfs.n8
-rw-r--r--generic/tcl.decls4
-rw-r--r--generic/tclDecls.h4
-rw-r--r--generic/tclZipfs.c22
-rw-r--r--library/auto.tcl4
-rw-r--r--tests/safe-zipfs.test2
-rw-r--r--tests/zipfs.test18
11 files changed, 40 insertions, 40 deletions
diff --git a/doc/FindExec.3 b/doc/FindExec.3
index 7f8c8a4..6156382 100644
--- a/doc/FindExec.3
+++ b/doc/FindExec.3
@@ -35,8 +35,8 @@ Tcl. For example, it is needed on some platforms in the
implementation of the \fBload\fR command.
It is also returned by the \fBinfo nameofexecutable\fR command.
.PP
-The result of \fBTcl_FindExecutable\fR is the full Tcl version (e.g.,
-\fB8.7.0+abcdef...abcdef.gcc-1002.utf16\fR).
+The result of \fBTcl_FindExecutable\fR is the full Tcl version with build
+information (e.g., \fB8.7.0+abcdef...abcdef.gcc-1002\fR).
.PP
On UNIX platforms this procedure is typically invoked as the very
first thing in the application's main program; it must be passed
diff --git a/doc/InitSubSyst.3 b/doc/InitSubSyst.3
index 89f2b88..0d09a41 100644
--- a/doc/InitSubSyst.3
+++ b/doc/InitSubSyst.3
@@ -21,8 +21,8 @@ The \fBTcl_InitSubsystems\fR procedure initializes the Tcl
library. This procedure is typically invoked as the very
first thing in the application's main program.
.PP
-The result of \fBTcl_InitSubsystems\fR is the full Tcl version (e.g.,
-\fB8.7.0+abcdef...abcdef.gcc-1002.utf16\fR).
+The result of \fBTcl_InitSubsystems\fR is the full Tcl version with build
+information (e.g., \fB8.7.0+abcdef...abcdef.gcc-1002\fR).
.PP
\fBTcl_InitSubsystems\fR is very similar in use to
\fBTcl_FindExecutable\fR. It can be used when Tcl is
diff --git a/doc/Panic.3 b/doc/Panic.3
index bd019db..5abe1dd 100644
--- a/doc/Panic.3
+++ b/doc/Panic.3
@@ -82,8 +82,8 @@ making calls into the Tcl library, or into other libraries that may
call the Tcl library, since the original call to \fBTcl_Panic\fR
indicates the Tcl library is not in a state of reliable operation.
.PP
-The result of \fBTcl_SetPanicProc\fR is the full Tcl version (e.g.,
-\fB8.7.0+abcdef...abcdef.gcc-1002.utf16\fR).
+The result of \fBTcl_SetPanicProc\fR is the full Tcl version with build
+information (e.g., \fB8.7.0+abcdef...abcdef.gcc-1002\fR).
.PP
The typical use of \fBTcl_SetPanicProc\fR arranges for the error message
to be displayed or reported in a manner more suitable for the
diff --git a/doc/zipfs.3 b/doc/zipfs.3
index 7ff7ee2..a4bb486 100644
--- a/doc/zipfs.3
+++ b/doc/zipfs.3
@@ -17,7 +17,7 @@ const char *
\fBTclZipfs_AppHook(\fIargcPtr, argvPtr\fR)
.sp
int
-\fBTclZipfs_Mount\fR(\fIinterp, mountpoint, zipname, password\fR)
+\fBTclZipfs_Mount\fR(\fIinterp, zipname, mountpoint, password\fR)
.sp
int
\fBTclZipfs_MountBuffer\fR(\fIinterp, mountpoint, data, dataLen, copy\fR)
@@ -85,8 +85,8 @@ it uses WCHAR instead of char. As a result, it requires your application to
be compiled with the UNICODE preprocessor symbol defined (e.g., via the
\fB-DUNICODE\fR compiler flag).
.PP
-The result of \fBTclZipfs_AppHook\fR is the full Tcl version (e.g.,
-\fB8.7.0+abcdef...abcdef.gcc-1002.utf16\fR).
+The result of \fBTclZipfs_AppHook\fR is the full Tcl version with build
+information (e.g., \fB8.7.0+abcdef...abcdef.gcc-1002\fR).
The function \fImay\fR modify the variables pointed to by \fIargcPtr\fR and
\fIargvPtr\fR to remove arguments; the current implementation does not do so,
but callers \fIshould not\fR assume that this will be true in the future.
diff --git a/doc/zipfs.n b/doc/zipfs.n
index 577be7b..b04eeb5 100644
--- a/doc/zipfs.n
+++ b/doc/zipfs.n
@@ -26,7 +26,7 @@ zipfs \- Mount and work with ZIP files within Tcl
\fBzipfs mkimg\fR \fIoutfile indir\fR ?\fIstrip\fR? ?\fIpassword\fR? ?\fIinfile\fR?
\fBzipfs mkkey\fR \fIpassword\fR
\fBzipfs mkzip\fR \fIoutfile indir\fR ?\fIstrip\fR? ?\fIpassword\fR?
-\fBzipfs mount\fR ?\fImountpoint\fR? ?\fIzipfile\fR? ?\fIpassword\fR?
+\fBzipfs mount\fR ?\fIzipfile\fR? ?\fImountpoint\fR? ?\fIpassword\fR?
\fBzipfs root\fR
\fBzipfs unmount\fR \fImountpoint\fR
.fi
@@ -84,7 +84,7 @@ Return a list of all files in the mounted zipfs, or just those matching
\fIpattern\fR (optionally controlled by the option parameters). The order of
the names in the list is arbitrary.
.TP
-\fBzipfs mount\fR ?\fImountpoint\fR? ?\fIzipfile\fR? ?\fIpassword\fR?
+\fBzipfs mount\fR ?\fIzipfile\fR? ?\fImountpoint\fR? ?\fIpassword\fR?
.
The \fBzipfs mount\fR command mounts a ZIP archive file as a Tcl virtual
filesystem at \fImountpoint\fR. After this command executes, files contained
@@ -186,7 +186,7 @@ before unmounting it again:
set zip myApp.zip
set base [file join [\fBzipfs root\fR] myApp]
-\fBzipfs mount\fR $base $zip
+\fBzipfs mount\fR $zip $base
# $base now has the contents of myApp.zip
source [file join $base app.tcl]
@@ -219,7 +219,7 @@ set base [file join [\fBzipfs root\fR] myApp]
\fBzipfs mkzip\fR $targetZip $sourceDir $sourceDir $password
# Mount with password
-\fBzipfs mount\fR $base $zip $password
+\fBzipfs mount\fR $zip $base $password
.CE
.PP
When creating an executable image with a password, the password is placed
diff --git a/generic/tcl.decls b/generic/tcl.decls
index b5146fa..301e22f 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -2336,8 +2336,8 @@ declare 631 {
# TIP #430
declare 632 {
- int TclZipfs_Mount(Tcl_Interp *interp, const char *mountPoint,
- const char *zipname, const char *passwd)
+ int TclZipfs_Mount(Tcl_Interp *interp, const char *zipname,
+ const char *mountPoint, const char *passwd)
}
declare 633 {
int TclZipfs_Unmount(Tcl_Interp *interp, const char *mountPoint)
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index c19b2c0..44f2149 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -1884,7 +1884,7 @@ EXTERN Tcl_Channel Tcl_OpenTcpServerEx(Tcl_Interp *interp,
void *callbackData);
/* 632 */
EXTERN int TclZipfs_Mount(Tcl_Interp *interp,
- const char *mountPoint, const char *zipname,
+ const char *zipname, const char *mountPoint,
const char *passwd);
/* 633 */
EXTERN int TclZipfs_Unmount(Tcl_Interp *interp,
@@ -2718,7 +2718,7 @@ typedef struct TclStubs {
int (*tcl_FSUnloadFile) (Tcl_Interp *interp, Tcl_LoadHandle handlePtr); /* 629 */
void (*tcl_ZlibStreamSetCompressionDictionary) (Tcl_ZlibStream zhandle, Tcl_Obj *compressionDictionaryObj); /* 630 */
Tcl_Channel (*tcl_OpenTcpServerEx) (Tcl_Interp *interp, const char *service, const char *host, unsigned int flags, int backlog, Tcl_TcpAcceptProc *acceptProc, void *callbackData); /* 631 */
- int (*tclZipfs_Mount) (Tcl_Interp *interp, const char *mountPoint, const char *zipname, const char *passwd); /* 632 */
+ int (*tclZipfs_Mount) (Tcl_Interp *interp, const char *zipname, const char *mountPoint, const char *passwd); /* 632 */
int (*tclZipfs_Unmount) (Tcl_Interp *interp, const char *mountPoint); /* 633 */
Tcl_Obj * (*tclZipfs_TclLibrary) (void); /* 634 */
int (*tclZipfs_MountBuffer) (Tcl_Interp *interp, const char *mountPoint, unsigned char *data, size_t datalen, int copy); /* 635 */
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c
index 56a25e3..faa7afa 100644
--- a/generic/tclZipfs.c
+++ b/generic/tclZipfs.c
@@ -1980,9 +1980,9 @@ DescribeMounted(
int
TclZipfs_Mount(
Tcl_Interp *interp, /* Current interpreter. NULLable. */
- const char *mountPoint, /* Mount point path. */
const char *zipname, /* Path to ZIP file to mount; should be
* normalized. */
+ const char *mountPoint, /* Mount point path. */
const char *passwd) /* Password for opening the ZIP, or NULL if
* the ZIP is unprotected. */
{
@@ -2236,14 +2236,11 @@ ZipFSMountObjCmd(
if (objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv,
- "?mountpoint? ?zipfile? ?password?");
+ "?zipfile? ?mountpoint? ?password?");
return TCL_ERROR;
}
if (objc > 1) {
- mountPoint = Tcl_GetString(objv[1]);
- }
- if (objc > 2) {
- zipFileObj = Tcl_FSGetNormalizedPath(interp, objv[2]);
+ zipFileObj = Tcl_FSGetNormalizedPath(interp, objv[1]);
if (!zipFileObj) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"could not normalize zip filename", -1));
@@ -2253,11 +2250,14 @@ ZipFSMountObjCmd(
Tcl_IncrRefCount(zipFileObj);
zipFile = Tcl_GetString(zipFileObj);
}
+ if (objc > 2) {
+ mountPoint = Tcl_GetString(objv[2]);
+ }
if (objc > 3) {
password = Tcl_GetString(objv[3]);
}
- result = TclZipfs_Mount(interp, mountPoint, zipFile, password);
+ result = TclZipfs_Mount(interp, zipFile, mountPoint, password);
if (zipFileObj != NULL) {
Tcl_DecrRefCount(zipFileObj);
}
@@ -5722,7 +5722,7 @@ ZipfsAppHookFindTclInit(
if (zipfs_literal_tcl_library) {
return TCL_ERROR;
}
- if (TclZipfs_Mount(NULL, ZIPFS_ZIP_MOUNT, archive, NULL)) {
+ if (TclZipfs_Mount(NULL, archive, ZIPFS_ZIP_MOUNT, NULL)) {
/* Either the file doesn't exist or it is not a zip archive */
return TCL_ERROR;
}
@@ -5836,7 +5836,7 @@ TclZipfs_AppHook(
* function.
*/
- if (!TclZipfs_Mount(NULL, ZIPFS_APP_MOUNT, archive, NULL)) {
+ if (!TclZipfs_Mount(NULL, archive, ZIPFS_APP_MOUNT, NULL)) {
int found;
Tcl_Obj *vfsInitScript;
@@ -5898,7 +5898,7 @@ TclZipfs_AppHook(
Tcl_SetStartupScript(vfsInitScript, NULL);
}
return version;
- } else if (!TclZipfs_Mount(NULL, ZIPFS_APP_MOUNT, archive, NULL)) {
+ } else if (!TclZipfs_Mount(NULL, archive, ZIPFS_APP_MOUNT, NULL)) {
int found;
Tcl_Obj *vfsInitScript;
@@ -5947,8 +5947,8 @@ TclZipfs_AppHook(
int
TclZipfs_Mount(
Tcl_Interp *interp, /* Current interpreter. */
- TCL_UNUSED(const char *), /* Mount point path. */
TCL_UNUSED(const char *), /* Path to ZIP file to mount. */
+ TCL_UNUSED(const char *), /* Mount point path. */
TCL_UNUSED(const char *)) /* Password for opening the ZIP, or NULL if
* the ZIP is unprotected. */
{
diff --git a/library/auto.tcl b/library/auto.tcl
index e7c954d..a4f8d41 100644
--- a/library/auto.tcl
+++ b/library/auto.tcl
@@ -92,7 +92,7 @@ proc tcl_findLibrary {basename version patch initScript enVarName varName} {
break
}
set found 1
- zipfs mount $mountpoint $dllfile
+ zipfs mount $dllfile $mountpoint
break
}
if {!$found} {
@@ -118,7 +118,7 @@ proc tcl_findLibrary {basename version patch initScript enVarName varName} {
if {![file exists $archive]} {
continue
}
- zipfs mount $mountpoint $archive
+ zipfs mount $archive $mountpoint
if {[zipfs exists [file join $mountpoint ${basename}_library $initScript]]} {
lappend dirs [file join $mountpoint ${basename}_library]
set found 1
diff --git a/tests/safe-zipfs.test b/tests/safe-zipfs.test
index 41c4b78..52ec6c4 100644
--- a/tests/safe-zipfs.test
+++ b/tests/safe-zipfs.test
@@ -31,7 +31,7 @@ apply [list {} {
set TestsDir [file normalize [file dirname [info script]]]
set ZipMountPoint [zipfs root]auto-files
- zipfs mount $ZipMountPoint [file join $TestsDir auto-files.zip]
+ zipfs mount [file join $TestsDir auto-files.zip] $ZipMountPoint
set PathMapp {}
lappend PathMapp $tcl_library TCLLIB $TestsDir TESTSDIR $ZipMountPoint ZIPDIR
diff --git a/tests/zipfs.test b/tests/zipfs.test
index 6e8b8ba..55f430c 100644
--- a/tests/zipfs.test
+++ b/tests/zipfs.test
@@ -42,7 +42,7 @@ if {![string match ${ziproot}* $tcl_library]} {
set tclzip [file join $CWD libtcl[info patchlevel].zip]
testConstraint zipfslib [file isfile $tclzip]
if {[testConstraint zipfslib]} {
- zipfs mount /lib/tcl $tclzip
+ zipfs mount $tclzip /lib/tcl
set ::tcl_library ${ziproot}lib/tcl/tcl_library
}
}
@@ -93,7 +93,7 @@ test zipfs-0.12 {zipfs basics: join} -constraints {zipfs zipfslib} -body {
test zipfs-1.3 {zipfs errors} -constraints zipfs -returnCodes error -body {
zipfs mount a b c d e f
-} -result {wrong # args: should be "zipfs mount ?mountpoint? ?zipfile? ?password?"}
+} -result {wrong # args: should be "zipfs mount ?zipfile? ?mountpoint? ?password?"}
test zipfs-1.4 {zipfs errors} -constraints zipfs -returnCodes error -body {
zipfs unmount a b c d e f
} -result {wrong # args: should be "zipfs unmount zipfile"}
@@ -131,7 +131,7 @@ if {[file exists $zipfile]} {
test zipfs-2.2 {zipfs mkzip} -constraints zipfs -body {
cd $tcl_library/encoding
zipfs mkzip $zipfile .
- zipfs mount ${ziproot}abc $zipfile
+ zipfs mount $zipfile ${ziproot}abc
zipfs list -glob ${ziproot}abc/cp850.*
} -cleanup {
cd $CWD
@@ -278,7 +278,7 @@ test zipfs-4.1 {zipfs lmkimg} -constraints zipfs -setup {
file delete $targetImage
} -body {
zipfs lmkimg $targetImage [list $addFile test/add.tcl] {} $baseImage
- zipfs mount ziptest $targetImage
+ zipfs mount $targetImage ziptest
try {
list [source $targetImage] [source /zipfs:/ziptest/test/add.tcl]
} finally {
@@ -298,7 +298,7 @@ test zipfs-4.2 {zipfs lmkimg: making an image from an image} -constraints zipfs
} -body {
zipfs lmkimg $midImage [list $addFile test/ko.tcl] {} $baseImage
zipfs lmkimg $targetImage [list $addFile test/ok.tcl] {} $midImage
- zipfs mount ziptest $targetImage
+ zipfs mount $targetImage ziptest
try {
list [glob -tails -directory /zipfs://ziptest/test *.tcl] \
[if {[file size $midImage] == [file size $targetImage]} {
@@ -325,7 +325,7 @@ test zipfs-4.3 {zipfs lmkimg: stripping password} -constraints zipfs -setup {
set pass gorp
zipfs lmkimg $midImage [list $addFile test/add.tcl] $pass $baseImage
zipfs lmkimg $targetImage [list $addFile test/ok.tcl] {} $midImage
- zipfs mount ziptest $targetImage
+ zipfs mount $targetImage ziptest
try {
glob -tails -directory /zipfs://ziptest/test *.tcl
} finally {
@@ -347,7 +347,7 @@ test zipfs-4.4 {zipfs lmkimg: final password} -constraints zipfs -setup {
set pass gorp
zipfs lmkimg $midImage [list $addFile test/add.tcl] {} $baseImage
zipfs lmkimg $targetImage [list $addFile test/ok.tcl] $pass $midImage
- zipfs mount ziptest $targetImage
+ zipfs mount $targetImage ziptest
try {
glob -tails -directory /zipfs://ziptest/test *.tcl
} finally {
@@ -367,11 +367,11 @@ test zipfs-4.5 {zipfs lmkimg: making image from mounted} -constraints zipfs -set
file delete $midImage $targetImage
} -body {
zipfs lmkimg $midImage [list $addFile test/add.tcl] {} $baseImage
- zipfs mount ziptest $midImage
+ zipfs mount $midImage ziptest
set f [glob -directory /zipfs://ziptest/test *.tcl]
zipfs lmkimg $targetImage [list $f test/ok.tcl] {} $midImage
zipfs unmount ziptest
- zipfs mount ziptest $targetImage
+ zipfs mount $targetImage ziptest
list $f [glob -directory /zipfs://ziptest/test *.tcl]
} -cleanup {
zipfs unmount ziptest