Date: Tue, 30 Mar 2004 18:19:24 +0100 From: Tim Bishop <tim@bishnet.net> To: FreeBSD-gnats-submit@FreeBSD.org Cc: mezz7@cox.net Subject: ports/64944: [PATCH] x11-clocks/gdesklets-clock: Fix clock when timezone "local" Message-ID: <E1B8MtY-0006Or-NI@pendennis.ukc.ac.uk> Resent-Message-ID: <200403301720.i2UHKCx8035988@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Mar 30 09:20:12 PST 2004 >Closed-Date: >Last-Modified: >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: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1B8MtY-0006Or-NI>