From 909f4ceccdf517544ecbd4832a14072e432c760c Mon Sep 17 00:00:00 2001 From: Joe Marcus Clarke Date: Mon, 17 Nov 2003 23:15:22 +0000 Subject: [PATCH] * Fix threading and SysInfo functionality on FreeBSD [1] * Fix plist PR: 59389 Submitted by: maintainer Obtained from: Franz Klammer [1] --- deskutils/gdesklets/Makefile | 1 + .../files/patch-libdesklets::Disk.py | 50 +++++++++++++++++++ .../files/patch-libdesklets::Memory.py | 15 ++++++ .../files/patch-libdesklets::Network.py | 13 ++--- .../gdesklets/files/patch-sensor::Sensor.py | 14 ++++++ deskutils/gdesklets/pkg-plist | 4 -- 6 files changed, 87 insertions(+), 10 deletions(-) create mode 100644 deskutils/gdesklets/files/patch-libdesklets::Disk.py create mode 100644 deskutils/gdesklets/files/patch-libdesklets::Memory.py create mode 100644 deskutils/gdesklets/files/patch-sensor::Sensor.py diff --git a/deskutils/gdesklets/Makefile b/deskutils/gdesklets/Makefile index bfb3c398a78e..f1e02b915ad9 100644 --- a/deskutils/gdesklets/Makefile +++ b/deskutils/gdesklets/Makefile @@ -7,6 +7,7 @@ PORTNAME= gdesklets PORTVERSION= 0.24.1 +PORTREVISION= 1 CATEGORIES= deskutils gnome MASTER_SITES= http://www.pycage.de/download/${PORTNAME}/ DISTNAME= gDesklets-${PORTVERSION} diff --git a/deskutils/gdesklets/files/patch-libdesklets::Disk.py b/deskutils/gdesklets/files/patch-libdesklets::Disk.py new file mode 100644 index 000000000000..135285ca842e --- /dev/null +++ b/deskutils/gdesklets/files/patch-libdesklets::Disk.py @@ -0,0 +1,50 @@ +# Many thanks to Alexander Leidinger and +# Franz Klammer for help and create +# those patches. +# +# Note that, this is for now. One of us still need to fix the +# libgtop to correct read the partition so this patch can be +# remove. + +--- libdesklets/Disk.py.orig Mon Nov 17 13:59:20 2003 ++++ libdesklets/Disk.py Mon Nov 17 14:05:34 2003 +@@ -1,6 +1,6 @@ + import glibtop + import polling +- ++import os + + class Disk: + +@@ -13,18 +13,22 @@ + + def __poll_partitions(self): + +- data = glibtop.get_mountlist(0) +- partitions = [] +- for size, device, mpoint, fstype in data: +- if (fstype in ("ext2", "ext3", "msdos", "vfat", "ntfs", "hpfs" +- "jfs", "reiserfs", "xfs", "qnx4", "adfs", "ffs", +- "hfs", "befs", "bfs", "efs", "iso9660", "minix", +- "sysv", "coda", "nfs", "udf", "ufs", "xiafs")): +- partitions.append((device, mpoint)) ++ fd = os.popen("mount -p") ++ data = fd.readlines() ++ fd.close() ++ ++ partitions = [] ++ for lines in data: ++ fields = lines.strip().replace("\t", " ").split() ++ if (fields[2] in ("ext2", "ext3", "msdos", "vfat", "ntfs", "hpfs" ++ "jfs", "reiserfs", "xfs", "qnx4", "adfs", "ffs", ++ "hfs", "befs", "bfs", "efs", "iso9660", "minix", ++ "sysv", "coda", "nfs", "udf", "ufs", "xiafs")): ++ partitions.append((fields[0], fields[1])) + #end for + + return partitions +- ++ + + + def __poll_size(self, partition): diff --git a/deskutils/gdesklets/files/patch-libdesklets::Memory.py b/deskutils/gdesklets/files/patch-libdesklets::Memory.py new file mode 100644 index 000000000000..d6702e7fe74f --- /dev/null +++ b/deskutils/gdesklets/files/patch-libdesklets::Memory.py @@ -0,0 +1,15 @@ +# Many thanks to Alexander Leidinger and +# Franz Klammer for help and create +# those patches. + +--- libdesklets/Memory.py.orig Sun Nov 16 17:02:45 2003 ++++ libdesklets/Memory.py Sun Nov 16 17:03:19 2003 +@@ -49,7 +49,7 @@ + + # Swap + elif (mode == 1): +- total, used, free = glibtop.get_mem()[:3] ++ total, used, free = glibtop.get_swap()[:3] + #for l in lines: + # if (l.startswith("SwapTotal:")): + # value = l.split() diff --git a/deskutils/gdesklets/files/patch-libdesklets::Network.py b/deskutils/gdesklets/files/patch-libdesklets::Network.py index c14d5146918f..a109edb44012 100644 --- a/deskutils/gdesklets/files/patch-libdesklets::Network.py +++ b/deskutils/gdesklets/files/patch-libdesklets::Network.py @@ -1,8 +1,9 @@ -# Many thanks to Alexander Leidinger for -# help and create those patches. +# Many thanks to Alexander Leidinger and +# Franz Klammer for help and create +# those patches. ---- libdesklets/Network.py.orig Sun Nov 9 00:52:39 2003 -+++ libdesklets/Network.py Sun Nov 9 00:53:05 2003 +--- libdesklets/Network.py.orig Sun Nov 16 15:15:30 2003 ++++ libdesklets/Network.py Sun Nov 16 15:18:22 2003 @@ -1,8 +1,8 @@ import polling import glibtop @@ -43,9 +44,9 @@ - devices.append(device) + if ("FreeBSD" == platform): + for lines in data: -+ fields = lines.strip().strip(":") ++ fields = lines.strip().split(":") + -+ if (fields[0] == "lo"): ++ if (fields[0][:2] == "lo"): + continue + else: + device = fields[0] diff --git a/deskutils/gdesklets/files/patch-sensor::Sensor.py b/deskutils/gdesklets/files/patch-sensor::Sensor.py new file mode 100644 index 000000000000..21804656d3b1 --- /dev/null +++ b/deskutils/gdesklets/files/patch-sensor::Sensor.py @@ -0,0 +1,14 @@ +# Yay! Many thanks to Franz Klammer , +# the theads is now work. That make a lot of desklets work now. + +--- sensor/Sensor.py.orig Mon Nov 17 16:46:57 2003 ++++ sensor/Sensor.py Mon Nov 17 16:48:43 2003 +@@ -134,6 +134,8 @@ + # + def _add_thread(self, threadfunction, *args): + ++ gtk.threads_init() ++ + # the thread should not start before setup is complete, therefore + # we are using the GTK idle handler + def run_thread(threadfunction, args): diff --git a/deskutils/gdesklets/pkg-plist b/deskutils/gdesklets/pkg-plist index f24e5635c101..d039eae7d49f 100644 --- a/deskutils/gdesklets/pkg-plist +++ b/deskutils/gdesklets/pkg-plist @@ -1,8 +1,6 @@ bin/gdesklets bin/gdesklets-display-thumbnailer -etc/gconf/gconf.xml.defaults/desktop/gnome/thumbnailers/%gconf.xml etc/gconf/gconf.xml.defaults/desktop/gnome/thumbnailers/application@x-gdesklets-display/%gconf.xml -etc/gconf/gconf.xml.defaults/schemas/desktop/gnome/thumbnailers/%gconf.xml etc/gconf/gconf.xml.defaults/schemas/desktop/gnome/thumbnailers/application@x-gdesklets-display/%gconf.xml etc/gconf/schemas/gdesklets-display-thumbnail.schemas libdata/pkgconfig/gdesklets-core.pc @@ -152,6 +150,4 @@ share/icons/gnome/48x48/mimetypes/x-gdesklets-display.png @dirrm share/gnome/gdesklets/Displays @dirrm share/gnome/gdesklets @dirrm etc/gconf/gconf.xml.defaults/schemas/desktop/gnome/thumbnailers/application@x-gdesklets-display -@dirrm etc/gconf/gconf.xml.defaults/schemas/desktop/gnome/thumbnailers @dirrm etc/gconf/gconf.xml.defaults/desktop/gnome/thumbnailers/application@x-gdesklets-display -@dirrm etc/gconf/gconf.xml.defaults/desktop/gnome/thumbnailers