diff options
author | Pav Lucistnik <pav@FreeBSD.org> | 2004-03-27 14:17:38 +0000 |
---|---|---|
committer | Pav Lucistnik <pav@FreeBSD.org> | 2004-03-27 14:17:38 +0000 |
commit | cb43e33b03dfaffd7715e8e288bc3b6f5f24b35f (patch) | |
tree | 3050d5a96e4af2e303ec72c8bb5f5a8fac78da64 | |
parent | - Fix security issues (and remove forbidden): (diff) |
- Replace Linuxism with FreeBSDism in uptime sensor (clock display).
- Raise PORTREVISION.
PR: ports/64787
Submitted by: Tim Bishop <tim@bishnet.net> (maintainer)
-rw-r--r-- | deskutils/gdesklets-ltvariations/Makefile | 2 | ||||
-rw-r--r-- | deskutils/gdesklets-ltvariations/files/LTVUptime::__init__.py | 13 |
2 files changed, 12 insertions, 3 deletions
diff --git a/deskutils/gdesklets-ltvariations/Makefile b/deskutils/gdesklets-ltvariations/Makefile index 18a0c30d4f84..5a5dc56737df 100644 --- a/deskutils/gdesklets-ltvariations/Makefile +++ b/deskutils/gdesklets-ltvariations/Makefile @@ -7,7 +7,7 @@ PORTNAME= ltvariations PORTVERSION= 0.26 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= deskutils gnome MASTER_SITES= http://gdesklets.gnomedesktop.org/files/ PKGNAMEPREFIX= gdesklets- diff --git a/deskutils/gdesklets-ltvariations/files/LTVUptime::__init__.py b/deskutils/gdesklets-ltvariations/files/LTVUptime::__init__.py index b1e1ae1f030d..4b415071cd56 100644 --- a/deskutils/gdesklets-ltvariations/files/LTVUptime::__init__.py +++ b/deskutils/gdesklets-ltvariations/files/LTVUptime::__init__.py @@ -1,5 +1,5 @@ ---- __init__.py.bak Sun Mar 21 17:40:07 2004 -+++ __init__.py Sun Mar 21 17:41:40 2004 +--- __init__.py.bak Fri Mar 26 22:08:26 2004 ++++ __init__.py Fri Mar 26 22:08:49 2004 @@ -21,7 +21,7 @@ self._set_config_type("update", TYPE_INT, int(interval)) self._set_config_type("format", TYPE_STRING, format) @@ -9,3 +9,12 @@ self._set_config_type("kernel", TYPE_STRING, commands.getoutput("uname -s")) self._set_config_type("version", TYPE_STRING, commands.getoutput("uname -r")) self._set_config_type("processor", TYPE_STRING, commands.getoutput("uname -p")) +@@ -63,7 +63,7 @@ + + def draw_uptime(self, data): + if self.__enable[ 0 ] != "0" : +- uptime = float( commands.getoutput("cat /proc/uptime").split()[0] ) ++ uptime = time.time() - float(commands.getoutput("sysctl kern.boottime").split()[4][:-1]) + d = int( uptime / 60 / 60 / 24 ) + uptime = uptime - d * 60 * 60 * 24 + h = int( uptime / 60 / 60 ) |