Date: Thu, 21 Apr 2005 15:22:22 +0200 (CEST) From: Simun Mikecin <sime@logos.hr> To: FreeBSD-gnats-submit@FreeBSD.org Cc: leonard@users.sourceforge.net Subject: ports/80198: Maintainer update: lang/see fix local timezone methods Message-ID: <20050421132222.F104926D049@mail.logos.hr> Resent-Message-ID: <200504211330.j3LDUIkf002536@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 80198 >Category: ports >Synopsis: Maintainer update: lang/see fix local timezone methods >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Thu Apr 21 13:30:17 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Simun Mikecin >Release: FreeBSD 5.2.1-RELEASE-p9 i386 >Organization: Logos >Environment: System: FreeBSD mail.logos.hr 5.2.1-RELEASE-p9 FreeBSD 5.2.1-RELEASE-p9 #1: Mon Jul 26 14:07:00 CEST 2004 root@mail.logos.hr:/usr/obj/usr/src.5.2.1-R/sys/MAIL i386 >Description: Local timezone methods like 'getHours()' return UTC time instead of local timezone time (just like 'getHoursUTC()'). >How-To-Repeat: Try to use method getHours() in your script and run it using SEE. >Fix: diff -urN see.old/Makefile see/Makefile --- see.old/Makefile Mon Apr 18 17:59:06 2005 +++ see/Makefile Thu Apr 21 15:02:52 2005 @@ -7,7 +7,7 @@ PORTNAME= see PORTVERSION= 1.2 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= lang MASTER_SITES= http://www.netsw.org/softeng/lang/js/ \ http://www.adaptive-enterprises.com.au/~d/software/see/ diff -urN see.old/files/patch-libsee_obj_Date.c see/files/patch-libsee_obj_Date.c --- see.old/files/patch-libsee_obj_Date.c Thu Jan 1 01:00:00 1970 +++ see/files/patch-libsee_obj_Date.c Thu Apr 21 14:59:07 2005 @@ -0,0 +1,26 @@ +--- libsee/obj_Date.c.orig 2004-10-17 15:50:50.000000000 +0200 ++++ libsee/obj_Date.c 2005-04-21 14:51:24.086576359 +0200 +@@ -113,13 +113,16 @@ + static SEE_number_t DateFromTime(SEE_number_t); /* 15.9.1.5 */ + #define WeekDay(t) modulo(Day(t)+4,7) /* 15.9.1.6 */ + +-/* +- * XXX TODO: timezone conversion functions. Currently we assume local == UTC +- */ +-#define LocalTZA 0 /* 15.9.1.7 */ +-#define DaylightSavingTA(t) 0 /* 15.9.1.8 */ +-#define LocalTime(t) ((t) + LocalTZA + DaylightSavingTA(t)) /* 15.9.1.9 */ +-#define UTC(t) ((t) - LocalTZA - DaylightSavingTA(t - LocalTZA)) ++#define UTC(t) (t) ++SEE_number_t LocalTime(SEE_number_t t) { ++ SEE_number_t ret; ++ const time_t tt=time(NULL); ++ ret=timegm(localtime(&tt)); ++ ret-=tt; ++ ret*=1000; ++ ret+=t; ++ return ret; ++} + + /* 15.9.1.10 */ + #define HourFromTime(t) modulo(floor((t) / msPerHour), HoursPerDay) >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050421132222.F104926D049>