1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-20 20:09:11 +00:00

- Fix Clock sensor with timezone set to local

PR:		ports/64847
Submitted by:	Tim Bishop <tim@bishnet.net> (maintainer)
This commit is contained in:
Pav Lucistnik 2004-03-28 15:42:06 +00:00
parent 09408032e6
commit cd11d93170
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=105514
2 changed files with 16 additions and 1 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= ltvariations
PORTVERSION= 0.26
PORTREVISION= 3
PORTREVISION= 4
CATEGORIES= deskutils gnome
MASTER_SITES= http://gdesklets.gnomedesktop.org/files/
PKGNAMEPREFIX= gdesklets-
@ -35,6 +35,7 @@ do-build:
@${WRKSRC}/Sensors/Install_${ii}_Sensor.bin --nomsg ${WRKSRC}
.endfor
@${PATCH} ${WRKSRC}/LTVUptime/__init__.py < ${FILESDIR}/LTVUptime::__init__.py
@${PATCH} ${WRKSRC}/LTVClock/__init__.py < ${FILESDIR}/LTVClock::__init__.py
@${CAT} pkg-message | ${SED} -e 's|%%PREFIX%%|${PREFIX}|g ; s|%%DISPLAY%%|${DISPLAY}|g' > ${PKGMESSAGE}
do-install:

View File

@ -0,0 +1,14 @@
--- __init__.py.bak Sun Mar 28 15:47:22 2004
+++ __init__.py Sun Mar 28 15:47:55 2004
@@ -126,7 +126,10 @@
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])