From t.d.bishop@kent.ac.uk  Tue Mar 30 09:19:32 2004
Return-Path: <t.d.bishop@kent.ac.uk>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8AF6716A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 30 Mar 2004 09:19:32 -0800 (PST)
Received: from mx5.kent.ac.uk (mx5.ukc.ac.uk [129.12.21.36])
	by mx1.FreeBSD.org (Postfix) with ESMTP id BE3E143D2D
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 30 Mar 2004 09:19:31 -0800 (PST)
	(envelope-from t.d.bishop@kent.ac.uk)
Received: from pendennis.ukc.ac.uk ([129.12.3.232])
	by mx5.kent.ac.uk with esmtp (Exim 4.24)
	id 1B8MtY-0007Ni-RG; Tue, 30 Mar 2004 18:19:24 +0100
Received: from tdb by pendennis.ukc.ac.uk with local (Exim 4.30; FreeBSD)
	id 1B8MtY-0006Or-NI; Tue, 30 Mar 2004 18:19:24 +0100
Message-Id: <E1B8MtY-0006Or-NI@pendennis.ukc.ac.uk>
Date: Tue, 30 Mar 2004 18:19:24 +0100
From: Tim Bishop <tim@bishnet.net>
Sender: "T.D.Bishop" <T.D.Bishop@kent.ac.uk>
To: FreeBSD-gnats-submit@freebsd.org
Cc: tim@bishnet.net, mezz7@cox.net
Subject: [PATCH] x11-clocks/gdesklets-clock: Fix clock when timezone "local"
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         64944
>Category:       ports
>Synopsis:       [PATCH] x11-clocks/gdesklets-clock: Fix clock when timezone "local"
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 30 09:20:12 PST 2004
>Closed-Date:    Tue Mar 30 13:52:05 PST 2004
>Last-Modified:  Tue Mar 30 13:52:05 PST 2004
>Originator:     Tim Bishop
>Release:        FreeBSD 5.2.1-RELEASE-p1 i386
>Organization:
>Environment:
System: FreeBSD pendennis.ukc.ac.uk 5.2.1-RELEASE-p1 FreeBSD 5.2.1-RELEASE-p1 #1: Thu Mar  4 00:16:43 GMT
>Description:
Fix clock when timezone is set to "local". Taken from patch to
deskutils/gdesklets-ltvariations to solve the same problem (code
is almost identical in both ports).

Added file(s):
- files/Clock::__init__.py

Port maintainer (mezz7@cox.net) is cc'd.

Generated with FreeBSD Port Tools 0.50
>How-To-Repeat:
>Fix:

--- gdesklets-clock-0.32_2.patch begins here ---
Index: Makefile
===================================================================
RCS file: /u1/freebsd/cvs/ports/x11-clocks/gdesklets-clock/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- Makefile	4 Feb 2004 05:09:54 -0000	1.3
+++ Makefile	30 Mar 2004 17:17:49 -0000
@@ -7,10 +7,10 @@
 
 PORTNAME=	clock
 PORTVERSION=	0.32
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	x11-clocks gnome
 MASTER_SITES=	http://gdesklets.gnomedesktop.org/files/
-PKGNAMEPREFIX= gdesklets-
+PKGNAMEPREFIX=	gdesklets-
 DISTNAME=	clock-desklet-${PORTVERSION}
 
 MAINTAINER=	mezz7@cox.net
@@ -28,6 +28,7 @@
 do-build:
 	@${WRKSRC}/Install_${NAME}_Sensor.bin --nomsg ${WRKSRC}
 	@${FIND} ${WRKSRC} -name '*.orig' -delete
+	@${PATCH} ${WRKSRC}/Clock/__init__.py < ${FILESDIR}/Clock::__init__.py
 
 do-install:
 	@${MKDIR} ${DATADIR}/gdesklets/Displays/${NAME}/gfx
Index: files/Clock::__init__.py
===================================================================
RCS file: files/Clock::__init__.py
diff -N files/Clock::__init__.py
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/Clock::__init__.py	30 Mar 2004 17:16:50 -0000
@@ -0,0 +1,16 @@
+--- __init__.py.bak	Tue Mar 30 18:08:39 2004
++++ __init__.py	Tue Mar 30 18:11:36 2004
+@@ -149,8 +149,11 @@
+         timezone = self._get_config("timezone")
+         if (timezone != self.__timezone):
+             self.__timezone = timezone
+-            offset = commands.getoutput("TZ=\"%(timezone)s\" date +%%z"
+-                                        % vars())
++            if timezone == "localtime":
++                offset = commands.getoutput("date +%z")
++            else:
++                offset = commands.getoutput("TZ=\"%(timezone)s\" date +%%z"
++                                            % vars())
+             sign = (offset[0] == "+") and 1 or -1
+             hours = int(offset[1:3])
+             mins = int(offset[3:5])
--- gdesklets-clock-0.32_2.patch ends here ---

>Release-Note:
>Audit-Trail:

From: Jeremy Messenger <mezz7@cox.net>
To: freebsd-gnats-submit@FreeBSD.org, tim@bishnet.net
Cc:  
Subject: Re: ports/64944: [PATCH] x11-clocks/gdesklets-clock: Fix clock when timezone "local"
Date: Tue, 30 Mar 2004 13:08:08 -0600

 Approved and thanks!
 
 Cheers,
 Mezz
 
 
 -- 
 bsdforums.org 's moderator, mezz.
State-Changed-From-To: open->closed 
State-Changed-By: pav 
State-Changed-When: Tue Mar 30 13:51:58 PST 2004 
State-Changed-Why:  
Committed, thanks! 

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