From sime@logos.hr  Thu Apr 21 13:20:27 2005
Return-Path: <sime@logos.hr>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id DDE8D16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 21 Apr 2005 13:20:27 +0000 (GMT)
Received: from mail.logos.hr (gates.logos.hr [213.149.47.2])
	by mx1.FreeBSD.org (Postfix) with ESMTP id A0E8343D48
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 21 Apr 2005 13:20:26 +0000 (GMT)
	(envelope-from sime@logos.hr)
Received: from localhost (localhost.logos.hr [127.0.0.1])
	by mail.logos.hr (Postfix) with ESMTP id AFDCF26D0A2;
	Thu, 21 Apr 2005 15:22:42 +0200 (CEST)
Received: from mail.logos.hr ([127.0.0.1])
 by localhost (mail.logos.hr [127.0.0.1]) (amavisd-new, port 10024) with LMTP
 id 44975-04; Thu, 21 Apr 2005 15:22:23 +0200 (CEST)
Received: by mail.logos.hr (Postfix, from userid 34062)
	id F104926D049; Thu, 21 Apr 2005 15:22:22 +0200 (CEST)
Message-Id: <20050421132222.F104926D049@mail.logos.hr>
Date: Thu, 21 Apr 2005 15:22:22 +0200 (CEST)
From: Simun Mikecin <sime@logos.hr>
Reply-To: Simun Mikecin <sime@logos.hr>
To: FreeBSD-gnats-submit@freebsd.org
Cc: leonard@users.sourceforge.net
Subject: Maintainer update: lang/see fix local timezone methods
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         80198
>Category:       ports
>Synopsis:       Maintainer update: lang/see fix local timezone methods
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    jylefort
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 21 13:30:17 GMT 2005
>Closed-Date:    Thu Apr 21 19:11:30 GMT 2005
>Last-Modified:  Thu Apr 21 19:11:30 GMT 2005
>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:
Responsible-Changed-From-To: freebsd-ports-bugs->jylefort 
Responsible-Changed-By: jylefort 
Responsible-Changed-When: Thu Apr 21 14:06:28 GMT 2005 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=80198 
State-Changed-From-To: open->closed 
State-Changed-By: jylefort 
State-Changed-When: Thu Apr 21 19:11:16 GMT 2005 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=80198 
>Unformatted:
