- Version 8.6.14rc0:

* [...]
- Obsoleted patches:
  * tcl-interp-limit-time.patch
  * tcl-refchan-mode-needed.patch
  * tcl-string-compare.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:tcl/tcl?expand=0&rev=157
This commit is contained in:
Reinhard Max 2024-02-08 16:46:23 +00:00 committed by Git OBS Bridge
parent 01dac539be
commit db8e361c31
6 changed files with 18 additions and 281 deletions

View File

@ -1,53 +0,0 @@
Index: generic/tclInterp.c
==================================================================
--- generic/tclInterp.c
+++ generic/tclInterp.c
@@ -4684,11 +4684,11 @@
case OPT_SEC:
if (Tcl_LimitTypeEnabled(childInterp, TCL_LIMIT_TIME)) {
Tcl_Time limitMoment;
Tcl_LimitGetTime(childInterp, &limitMoment);
- Tcl_SetObjResult(interp, Tcl_NewLongObj(limitMoment.sec));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(limitMoment.sec));
}
break;
}
return TCL_OK;
} else if ((objc-consumedObjc) & 1 /* isOdd(objc-consumedObjc) */) {
@@ -4742,28 +4742,30 @@
"BADVALUE", NULL);
return TCL_ERROR;
}
limitMoment.usec = ((long) tmp)*1000;
break;
- case OPT_SEC:
+ case OPT_SEC: {
+ Tcl_WideInt sec;
secObj = objv[i+1];
(void) Tcl_GetStringFromObj(objv[i+1], &secLen);
if (secLen == 0) {
break;
}
- if (TclGetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK) {
+ if (TclGetWideIntFromObj(interp, objv[i+1], &sec) != TCL_OK) {
return TCL_ERROR;
}
- if (tmp < 0) {
+ if (sec < 0) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"seconds must be at least 0", -1));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP",
"BADVALUE", NULL);
return TCL_ERROR;
}
- limitMoment.sec = tmp;
+ limitMoment.sec = sec;
break;
+ }
}
}
if (milliObj != NULL || secObj != NULL) {
if (milliObj != NULL) {
/*

View File

@ -1,84 +0,0 @@
--- doc/refchan.n.orig
+++ doc/refchan.n
@@ -53,8 +53,8 @@ here, then the \fBfinalize\fR subcommand
.PP
The \fImode\fR argument tells the handler whether the channel was
opened for reading, writing, or both. It is a list containing any of
-the strings \fBread\fR or \fBwrite\fR. The list will always
-contain at least one element.
+the strings \fBread\fR or \fBwrite\fR. The list may be empty, but
+will usually contain at least one element.
.PP
The subcommand must throw an error if the chosen mode is not
supported by the \fIcmdPrefix\fR.
--- generic/tclIORChan.c.orig
+++ generic/tclIORChan.c
@@ -532,7 +532,7 @@ TclChanCreateObjCmd(
/*
* First argument is a list of modes. Allowed entries are "read", "write".
- * Expect at least one list element. Abbreviations are ok.
+ * Empty list is uncommon, but allowed. Abbreviations are ok.
*/
modeObj = objv[MODE];
@@ -905,6 +905,11 @@ TclChanPostEventObjCmd(
if (EncodeEventMask(interp, "event", objv[EVENT], &events) != TCL_OK) {
return TCL_ERROR;
}
+ if (events == 0) {
+ Tcl_SetObjResult(interp,
+ Tcl_NewStringObj("bad event list: is empty", -1));
+ return TCL_ERROR;
+ }
/*
* Check that the channel is actually interested in the provided events.
@@ -2007,10 +2012,10 @@ ReflectGetOption(
* EncodeEventMask --
*
* This function takes a list of event items and constructs the
- * equivalent internal bitmask. The list must contain at least one
- * element. Elements are "read", "write", or any unique abbreviation of
- * them. Note that the bitmask is not changed if problems are
- * encountered.
+ * equivalent internal bitmask. The list may be empty but will usually
+ * contain at least one element. Valid elements are "read", "write", or
+ * any unique abbreviation of them. Note that the bitmask is not changed
+ * if problems are encountered.
*
* Results:
* A standard Tcl error code. A bitmask where TCL_READABLE and/or
@@ -2040,12 +2045,6 @@ EncodeEventMask(
return TCL_ERROR;
}
- if (listc < 1) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "bad %s list: is empty", objName));
- return TCL_ERROR;
- }
-
events = 0;
while (listc > 0) {
if (Tcl_GetIndexFromObj(interp, listv[listc-1], eventOptions,
--- tests/ioCmd.test.orig
+++ tests/ioCmd.test
@@ -670,12 +670,12 @@ test iocmd-21.1 {chan create, wrong#args
catch {chan create a b c} msg
set msg
} {wrong # args: should be "chan create mode cmdprefix"}
-test iocmd-21.2 {chan create, invalid r/w mode, empty} {
- proc foo {} {}
- catch {chan create {} foo} msg
+test iocmd-21.2 {chan create, r/w mode empty} {
+ proc foo {cmd args} { return {initialize finalize watch} }
+ set chan [chan create {} foo]
+ close $chan
rename foo {}
- set msg
-} {bad mode list: is empty}
+} {}
test iocmd-21.3 {chan create, invalid r/w mode, bad string} {
proc foo {} {}
catch {chan create {c} foo} msg

View File

@ -1,133 +0,0 @@
--- generic/tclCmdMZ.c.orig
+++ generic/tclCmdMZ.c
@@ -2629,7 +2629,7 @@ StringEqualCmd(
*/
objv += objc-2;
- match = TclStringCmp(objv[0], objv[1], 0, nocase, reqlength);
+ match = TclStringCmp(objv[0], objv[1], 1, nocase, reqlength);
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(match ? 0 : 1));
return TCL_OK;
}
@@ -2702,8 +2702,8 @@ TclStringCmp(
Tcl_Obj *value2Ptr,
int checkEq, /* comparison is only for equality */
int nocase, /* comparison is not case sensitive */
- int reqlength) /* requested length; -1 to compare whole
- * strings */
+ int reqlength) /* requested length in characters; -1 to
+ * compare whole strings */
{
const char *s1, *s2;
int empty, length, match, s1len, s2len;
@@ -2731,10 +2731,10 @@ TclStringCmp(
} else if ((value1Ptr->typePtr == &tclStringType)
&& (value2Ptr->typePtr == &tclStringType)) {
/*
- * Do a unicode-specific comparison if both of the args are of String
+ * Do a Unicode-specific comparison if both of the args are of String
* type. If the char length == byte length, we can do a memcmp. In
* benchmark testing this proved the most efficient check between the
- * unicode and string comparison operations.
+ * Unicode and string comparison operations.
*/
if (nocase) {
@@ -2748,6 +2748,9 @@ TclStringCmp(
&& (value1Ptr->bytes != NULL)
&& (s2len == value2Ptr->length)
&& (value2Ptr->bytes != NULL)) {
+ /* each byte represents one character so s1l3n, s2l3n, and
+ * reqlength are in both bytes and characters
+ */
s1 = value1Ptr->bytes;
s2 = value2Ptr->bytes;
memCmpFn = memcmp;
@@ -2756,14 +2759,17 @@ TclStringCmp(
s2 = (char *) Tcl_GetUnicode(value2Ptr);
if (
#if defined(WORDS_BIGENDIAN) && (TCL_UTF_MAX != 4)
- 1
+ 1
#else
- checkEq
+ checkEq
#endif /* WORDS_BIGENDIAN */
- ) {
+ ) {
memCmpFn = memcmp;
s1len *= sizeof(Tcl_UniChar);
s2len *= sizeof(Tcl_UniChar);
+ if (reqlength > 0) {
+ reqlength *= sizeof(Tcl_UniChar);
+ }
} else {
memCmpFn = (memCmpFn_t) Tcl_UniCharNcmp;
}
@@ -2805,7 +2811,7 @@ TclStringCmp(
s2 = TclGetStringFromObj(value2Ptr, &s2len);
}
- if (!nocase && checkEq) {
+ if (!nocase && checkEq && reqlength < 0) {
/*
* When we have equal-length we can check only for (in)equality.
* We can use memcmp() in all (n)eq cases because we don't need to
@@ -2826,24 +2832,28 @@ TclStringCmp(
s1len = Tcl_NumUtfChars(s1, s1len);
s2len = Tcl_NumUtfChars(s2, s2len);
memCmpFn = (memCmpFn_t)
- (nocase ? Tcl_UtfNcasecmp : Tcl_UtfNcmp);
+ (nocase ? Tcl_UtfNcasecmp : Tcl_UtfNcmp);
}
}
}
+ /* At this point s1len, s2len, and reqlength should by now have been
+ * adjusted so that they are all in the units expected by the selected
+ * comparison function.
+ */
+
length = (s1len < s2len) ? s1len : s2len;
if (reqlength > 0 && reqlength < length) {
length = reqlength;
} else if (reqlength < 0) {
/*
- * The requested length is negative, so we ignore it by setting it to
- * length + 1 so we correct the match var.
+ * The requested length is negative, so ignore it by setting it to
+ * length + 1 to correct the match var.
*/
-
reqlength = length + 1;
}
- if (checkEq && (s1len != s2len)) {
+ if (checkEq && reqlength < 0 && (s1len != s2len)) {
match = 1; /* This will be reversed below. */
} else {
/*
--- tests/stringComp.test.orig
+++ tests/stringComp.test
@@ -100,7 +100,7 @@ foreach {tname tbody tresult tcode} {
{unicode} {string compare \334 \u00fc} -1 {}
{unicode} {string compare \334\334\334\374\374 \334\334\334\334\334} 1 {}
{high bit} {
- # This test will fail if the underlying comparison
+ # This test fails if the underlying comparison
# is using signed chars instead of unsigned chars.
# (like SunOS's default memcmp thus the compat/memcmp.c)
string compare "\x80" "@"
@@ -156,10 +156,10 @@ foreach {tname tbody tresult tcode} {
{-nocase null strings} {
string compare -nocase foo ""
} 1 {}
- {with length, unequal strings} {
+ {with length, unequal strings, partial first string} {
string compare -length 2 abc abde
} 0 {}
- {with length, unequal strings} {
+ {with length, unequal strings 2, full first string} {
string compare -length 2 ab abde
} 0 {}
{with NUL character vs. other ASCII} {

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Thu Feb 8 16:34:38 UTC 2024 - Reinhard Max <max@suse.com>
- Version 8.6.14rc0:
* [...]
- Obsoleted patches:
* tcl-interp-limit-time.patch
* tcl-refchan-mode-needed.patch
* tcl-string-compare.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Mar 30 09:30:57 UTC 2023 - Reinhard Max <max@suse.com> Thu Mar 30 09:30:57 UTC 2023 - Reinhard Max <max@suse.com>

View File

@ -1,7 +1,7 @@
# #
# spec file for package tcl # spec file for package tcl
# #
# Copyright (c) 2023 SUSE LLC # Copyright (c) 2024 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -22,11 +22,11 @@
Name: tcl Name: tcl
URL: http://www.tcl.tk URL: http://www.tcl.tk
Version: 8.6.13 Version: 8.6.14
Release: 0 Release: 0
%define rrc %{nil} %define rrc %{nil}rc0
%define TCL_MINOR %(echo %version | cut -c1-3) %define TCL_MINOR %(echo %version | cut -c1-3)
%define itclver 4.2.3 %define itclver 4.2.4
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
Summary: The Tcl Programming Language Summary: The Tcl Programming Language
License: TCL License: TCL
@ -48,9 +48,6 @@ Source0: http://prdownloads.sourceforge.net/tcl/%{name}%{version}%{rrc}-s
Source1: tcl-rpmlintrc Source1: tcl-rpmlintrc
Source2: baselibs.conf Source2: baselibs.conf
Source3: macros.tcl Source3: macros.tcl
Patch0: tcl-refchan-mode-needed.patch
Patch1: tcl-string-compare.patch
Patch2: tcl-interp-limit-time.patch
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: pkg-config BuildRequires: pkg-config
BuildRequires: zlib-devel BuildRequires: zlib-devel
@ -91,12 +88,9 @@ the Tcl language itself.
%prep %prep
%setup -q -n %name%version %setup -q -n %name%version
if ! test -d pkgs/itcl%itclver; then if ! test -d pkgs/itcl%itclver; then
: Version mismatch in itcl, please chek the %%itclver macro! : New itcl version: pkgs/itcl* . Please update the %%itclver macro acordingly.
exit 1 exit 1
fi fi
%patch0
%patch1
%patch2
# The SQLite extension is provided by the sqlite3 package, # The SQLite extension is provided by the sqlite3 package,
# so don't build it here. # so don't build it here.

3
tcl8.6.14rc0-src.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1141202667d3a42fccc273b22653ec3130ce09a94c015db9ce98780494487bb9
size 11623237