Patchwork [2/2] tcl: fix unit test boundary year issue

login
register
mail settings
Submitter Kang Kai
Date June 20, 2013, 1:38 p.m.
Message ID <2146d8ba9021eb536acc28011fde7825eaecb9e7.1371735435.git.kai.kang@windriver.com>
Download mbox | patch
Permalink /patch/52129/
State Accepted
Commit d3027b3e9b8cd78e0f310206b34bfdd457f63d84
Headers show

Comments

Kang Kai - June 20, 2013, 1:38 p.m.
Unit test clock.test check the boundary year 2099 which is not
inclusive. Include 2099 to be a valide year number.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 .../tcltk/tcl/let-DST-include-year-2099.patch      |   35 ++++++++++++++++++++
 meta/recipes-devtools/tcltk/tcl_8.6.0.bb           |    3 +-
 2 files changed, 37 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-devtools/tcltk/tcl/let-DST-include-year-2099.patch

Patch

diff --git a/meta/recipes-devtools/tcltk/tcl/let-DST-include-year-2099.patch b/meta/recipes-devtools/tcltk/tcl/let-DST-include-year-2099.patch
new file mode 100644
index 0000000..eef1812
--- /dev/null
+++ b/meta/recipes-devtools/tcltk/tcl/let-DST-include-year-2099.patch
@@ -0,0 +1,35 @@ 
+From f10135df3f4751d7c83a66561c988ae799b6372f Mon Sep 17 00:00:00 2001
+From: "Song.Li" <Song.Li@windriver.com>
+Date: Fri, 10 Aug 2012 13:07:20 +0800
+Subject: [PATCH] let DST include year 2099
+
+tcl puts Daylight Saving Time in deffect from 1916 to 2099,
+it should include the year 2099,becuase tcl
+self-contained testing have a DST testcase on 2099.
+so the condition statement "<2099" should be "<=2099"
+
+Upstream-Status: Submitted
+
+Signed-off-by: Song.Li <Song.Li@windriver.com>
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+---
+ library/clock.tcl |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/library/clock.tcl b/library/clock.tcl
+index 2e9cae7..e8efe4a 100644
+--- a/library/clock.tcl
++++ b/library/clock.tcl
+@@ -3945,7 +3945,7 @@ proc ::tcl::clock::ProcessPosixTimeZone { z } {
+ 
+     # Put DST in effect in all years from 1916 to 2099.
+ 
+-    for { set y 1916 } { $y < 2099 } { incr y } {
++    for { set y 1916 } { $y <= 2099 } { incr y } {
+ 	set startTime [DeterminePosixDSTTime $z start $y]
+ 	incr startTime [expr { - wide($stdOffset) }]
+ 	set endTime [DeterminePosixDSTTime $z end $y]
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/tcltk/tcl_8.6.0.bb b/meta/recipes-devtools/tcltk/tcl_8.6.0.bb
index 95556e2..7273182 100644
--- a/meta/recipes-devtools/tcltk/tcl_8.6.0.bb
+++ b/meta/recipes-devtools/tcltk/tcl_8.6.0.bb
@@ -18,7 +18,8 @@  SRC_URI = "${BASE_SRC_URI} \
 	   file://fix_non_native_build_issue.patch \
 	   file://fix_issue_with_old_distro_glibc.patch \
 	   file://no_packages.patch \
-	   file://tcl-remove-hardcoded-install-path.patch"
+	   file://tcl-remove-hardcoded-install-path.patch \
+	   file://let-DST-include-year-2099.patch;patchdir=.. "
 
 SRC_URI[md5sum] = "573aa5fe678e9185ef2b3c56b24658d3"
 SRC_URI[sha256sum] = "354422b9c4791685499123b2dfe01faa98b555c08906c010cb4449ddc75dcade"