Date: Thursday, March 27, 2014 @ 01:41:31 Author: seblu Revision: 108342
archrelease: copy trunk to community-any Added: glances/repos/community-any/PKGBUILD (from rev 108341, glances/trunk/PKGBUILD) Deleted: glances/repos/community-any/01-adapt-to-psutil-2.0.0-api.patch glances/repos/community-any/PKGBUILD ------------------------------------+ 01-adapt-to-psutil-2.0.0-api.patch | 260 ----------------------------------- PKGBUILD | 63 ++++---- 2 files changed, 30 insertions(+), 293 deletions(-) Deleted: 01-adapt-to-psutil-2.0.0-api.patch =================================================================== --- 01-adapt-to-psutil-2.0.0-api.patch 2014-03-27 00:41:11 UTC (rev 108341) +++ 01-adapt-to-psutil-2.0.0-api.patch 2014-03-27 00:41:31 UTC (rev 108342) @@ -1,260 +0,0 @@ -From 49ba692154ffe2d4e55fcc62b53d95d209d071fd Mon Sep 17 00:00:00 2001 -From: Markus Roth <m...@rothmark.us> -Date: Sun, 16 Mar 2014 05:17:57 +0100 -Subject: [PATCH 1/3] Adapt to psutil 2.0.0 API. - -API changed. -https://psutil.googlecode.com/hg/HISTORY - -Tested with 0.5.1, 1.2.1, 2.0.0 ---- - glances/glances.py | 59 ++++++++++++++++++++++++++++++++++++++---------------- - requirements.txt | 2 +- - setup.py | 4 ++-- - 3 files changed, 45 insertions(+), 20 deletions(-) - -diff --git a/glances/glances.py b/glances/glances.py -index ea64b34..13991c1 100644 ---- a/glances/glances.py -+++ b/glances/glances.py -@@ -1202,16 +1202,24 @@ def __get_process_stats(self, proc): - procstat['pid'] = proc.pid - - # Process name (cached by PSUtil) -- procstat['name'] = proc.name -+ try: -+ procstat['name'] = proc.name() -+ except AttributeError: -+ procstat['name'] = proc.name -+ - - # Process username (cached with internal cache) - try: - self.username_cache[procstat['pid']] - except: - try: -+ self.username_cache[procstat['pid']] = proc.username() -+ except AttributeError: - self.username_cache[procstat['pid']] = proc.username - except KeyError: - try: -+ self.username_cache[procstat['pid']] = proc.uids().real -+ except AttributeError: - self.username_cache[procstat['pid']] = proc.uids.real - except KeyError: - self.username_cache[procstat['pid']] = "?" -@@ -1221,28 +1229,39 @@ def __get_process_stats(self, proc): - try: - self.cmdline_cache[procstat['pid']] - except: -- self.cmdline_cache[procstat['pid']] = ' '.join(proc.cmdline) -+ try: -+ self.cmdline_cache[procstat['pid']] = ' '.join(proc.cmdline()) -+ except TypeError: -+ self.cmdline_cache[procstat['pid']] = ' '.join(proc.cmdline) - procstat['cmdline'] = self.cmdline_cache[procstat['pid']] - - # Process status -- procstat['status'] = str(proc.status)[:1].upper() -+ try: -+ procstat['status'] = str(proc.status())[:1].upper() -+ except AttributeError: -+ procstat['status'] = str(proc.status)[:1].upper() - - # Process nice -- procstat['nice'] = proc.get_nice() -+ procstat['nice'] = getattr(proc, 'get_nice', -+ getattr(proc, 'nice'))() - - # Process memory -- procstat['memory_info'] = proc.get_memory_info() -- procstat['memory_percent'] = proc.get_memory_percent() -+ procstat['memory_info'] = getattr(proc, 'get_memory_info', -+ getattr(proc, 'memory_info'))() -+ procstat['memory_percent'] = getattr(proc, 'get_memory_percent', -+ getattr(proc, 'memory_percent'))() - - # Process CPU -- procstat['cpu_times'] = proc.get_cpu_times() -- procstat['cpu_percent'] = proc.get_cpu_percent(interval=0) -+ procstat['cpu_times'] = getattr(proc, 'get_cpu_times', -+ getattr(proc, 'cpu_times'))() -+ procstat['cpu_percent'] = getattr(proc, 'get_cpu_percent', -+ getattr(proc, 'cpu_percent'))(interval=0) - - # Process network connections (TCP and UDP) (Experimental) - # !!! High CPU consumption - # try: -- # procstat['tcp'] = len(proc.get_connections(kind="tcp")) -- # procstat['udp'] = len(proc.get_connections(kind="udp")) -+ # procstat['tcp'] = len(proc.connections(kind="tcp")) -+ # procstat['udp'] = len(proc.connections(kind="udp")) - # except: - # procstat['tcp'] = 0 - # procstat['udp'] = 0 -@@ -1255,7 +1274,8 @@ def __get_process_stats(self, proc): - if psutil_get_io_counter_tag: - try: - # Get the process IO counters -- proc_io = proc.get_io_counters() -+ proc_io = getattr(proc, 'get_io_counters', -+ getattr(proc, 'io_counters'))() - io_new = [proc_io.read_bytes, proc_io.write_bytes] - except psutil.AccessDenied: - # Access denied to process IO (no root account) -@@ -1309,7 +1329,8 @@ def update(self): - self.processcount['total'] += 1 - # Update thread number (global statistics) - try: -- self.processcount['thread'] += proc.get_num_threads() -+ self.processcount['thread'] += getattr(proc, 'get_num_threads', -+ getattr(proc, 'num_threads'))() - except: - pass - except (psutil.NoSuchProcess, psutil.AccessDenied): -@@ -1769,10 +1790,11 @@ def __update__(self, input_stats): - - # Uptime - try: -- # For PsUtil >= 0.7.0 -- self.uptime = datetime.now() - datetime.fromtimestamp(psutil.get_boot_time()) -- except: -- self.uptime = datetime.now() - datetime.fromtimestamp(psutil.BOOT_TIME) -+ boot_time = getattr(psutil, 'get_boot_time', -+ getattr(psutil, 'boot_time'))() -+ except AttributeError: -+ boot_time = psutil.BOOT_TIME -+ self.uptime = datetime.now() - datetime.fromtimestamp(boot_time) - # Convert uptime to string (because datetime is not JSONifi) - self.uptime = str(self.uptime).split('.')[0] - -@@ -1780,7 +1802,10 @@ def __update__(self, input_stats): - self.now = datetime.now() - - # Get the number of core (CPU) (Used to display load alerts) -- self.core_number = psutil.NUM_CPUS -+ try: -+ self.core_number = psutil.cpu_count() -+ except AttributeError: -+ self.core_number = psutil.NUM_CPUS - - # get psutil version - self.psutil_version = psutil.__version__ -diff --git a/requirements.txt b/requirements.txt -index eba5852..fd5aedf 100644 ---- a/requirements.txt -+++ b/requirements.txt -@@ -1 +1 @@ --psutil==1.2.1 -+psutil==2.0.0 -diff --git a/setup.py b/setup.py -index cf6c25b..695fcb9 100755 ---- a/setup.py -+++ b/setup.py -@@ -27,9 +27,9 @@ - data_files.append((os.path.dirname(mo).replace('i18n/', 'share/locale/'), [mo])) - - if sys.platform.startswith('win'): -- requires = ['psutil>=0.5.1,<=1.2.1', 'colorconsole==0.6'] -+ requires = ['psutil>=0.5.1,<=2.0.0', 'colorconsole==0.6'] - else: -- requires = ['psutil>=0.5.1,<=1.2.1'] -+ requires = ['psutil>=0.5.1,<=2.0.0'] - - setup( - name='Glances', --- -1.8.5.5 - - -From 209b48025ab88705dce91fc3b8ee8b99c9fe2288 Mon Sep 17 00:00:00 2001 -From: Markus Roth <m...@rothmark.us> -Date: Mon, 17 Mar 2014 21:57:22 +0100 -Subject: [PATCH 2/3] Fix python trying to use default getattr using psutil - 0.5.1. - -Don't know why adding "None" as second default helps. ---- - glances/glances.py | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/glances/glances.py b/glances/glances.py -index 13991c1..96a00d6 100644 ---- a/glances/glances.py -+++ b/glances/glances.py -@@ -1247,15 +1247,15 @@ def __get_process_stats(self, proc): - - # Process memory - procstat['memory_info'] = getattr(proc, 'get_memory_info', -- getattr(proc, 'memory_info'))() -+ getattr(proc, 'memory_info', None))() - procstat['memory_percent'] = getattr(proc, 'get_memory_percent', -- getattr(proc, 'memory_percent'))() -+ getattr(proc, 'memory_percent', None))() - - # Process CPU - procstat['cpu_times'] = getattr(proc, 'get_cpu_times', -- getattr(proc, 'cpu_times'))() -+ getattr(proc, 'cpu_times', None))() - procstat['cpu_percent'] = getattr(proc, 'get_cpu_percent', -- getattr(proc, 'cpu_percent'))(interval=0) -+ getattr(proc, 'cpu_percent', None))(interval=0) - - # Process network connections (TCP and UDP) (Experimental) - # !!! High CPU consumption -@@ -1275,7 +1275,7 @@ def __get_process_stats(self, proc): - try: - # Get the process IO counters - proc_io = getattr(proc, 'get_io_counters', -- getattr(proc, 'io_counters'))() -+ getattr(proc, 'io_counters', None))() - io_new = [proc_io.read_bytes, proc_io.write_bytes] - except psutil.AccessDenied: - # Access denied to process IO (no root account) --- -1.8.5.5 - - -From de0bbe0ac09988cfe84442855183577315a0d80a Mon Sep 17 00:00:00 2001 -From: Markus Roth <m...@rothmark.us> -Date: Mon, 17 Mar 2014 21:57:44 +0100 -Subject: [PATCH 3/3] Fix error types. - ---- - glances/glances.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/glances/glances.py b/glances/glances.py -index 96a00d6..7f8a3ca 100644 ---- a/glances/glances.py -+++ b/glances/glances.py -@@ -1204,7 +1204,7 @@ def __get_process_stats(self, proc): - # Process name (cached by PSUtil) - try: - procstat['name'] = proc.name() -- except AttributeError: -+ except TypeError: - procstat['name'] = proc.name - - -@@ -1214,7 +1214,7 @@ def __get_process_stats(self, proc): - except: - try: - self.username_cache[procstat['pid']] = proc.username() -- except AttributeError: -+ except TypeError: - self.username_cache[procstat['pid']] = proc.username - except KeyError: - try: -@@ -1238,7 +1238,7 @@ def __get_process_stats(self, proc): - # Process status - try: - procstat['status'] = str(proc.status())[:1].upper() -- except AttributeError: -+ except TypeError: - procstat['status'] = str(proc.status)[:1].upper() - - # Process nice --- -1.8.5.5 - Deleted: PKGBUILD =================================================================== --- PKGBUILD 2014-03-27 00:41:11 UTC (rev 108341) +++ PKGBUILD 2014-03-27 00:41:31 UTC (rev 108342) @@ -1,33 +0,0 @@ -# $Id$ -# Maintainer: Sébastien Luttringer <se...@archlinux.org> -# Contributor: Bartłomiej Piotrowski <bpiotrow...@archlinux.org> -# Contributor: Francois Boulogne <fboulogne at april dot org> - -pkgname=glances -pkgver=1.7.5 -pkgrel=2 -pkgdesc='CLI curses-based monitoring tool' -arch=('any') -url='https://github.com/nicolargo/glances' -license=('LGPL') -depends=('python2' 'python2-psutil' 'python2-setuptools') -optdepends=('python2-jinja: HTML export' - 'python2-sensors: temperature sensors support' - 'hddtemp: HDD temperature monitoring support') -source=("$url/archive/v$pkgver.tar.gz" - '01-adapt-to-psutil-2.0.0-api.patch') -sha256sums=('1598d1c10f1d2b59ea8d90d5be899fd151b4af28640c6daae23258dc76f659fe' - '5b92ad4532d40cc1d08afb0390a79b3cabf9ab7f9ca184139cbc72e5b7d6c7f5') - -prepare() { - cd $pkgname-$pkgver - sed 's|^#!/usr/bin/env python$|&2|' -i glances/glances.py - patch -p1 -i "$srcdir/01-adapt-to-psutil-2.0.0-api.patch" -} - -package() { - cd $pkgname-$pkgver - python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 -} - -# vim:set ts=2 sw=2 et: Copied: glances/repos/community-any/PKGBUILD (from rev 108341, glances/trunk/PKGBUILD) =================================================================== --- PKGBUILD (rev 0) +++ PKGBUILD 2014-03-27 00:41:31 UTC (rev 108342) @@ -0,0 +1,30 @@ +# $Id$ +# Maintainer: Sébastien Luttringer <se...@archlinux.org> +# Contributor: Bartłomiej Piotrowski <bpiotrow...@archlinux.org> +# Contributor: Francois Boulogne <fboulogne at april dot org> + +pkgname=glances +pkgver=1.7.6 +pkgrel=1 +pkgdesc='CLI curses-based monitoring tool' +arch=('any') +url='https://github.com/nicolargo/glances' +license=('LGPL') +depends=('python2' 'python2-psutil' 'python2-setuptools') +optdepends=('python2-jinja: HTML export' + 'python2-sensors: temperature sensors support' + 'hddtemp: HDD temperature monitoring support') +source=("$url/archive/v$pkgver.tar.gz") +sha256sums=('7d026bd6f0289e88a9acd3be813eb5288a2af2216bab7086a58bf560dc781279') + +prepare() { + cd $pkgname-$pkgver + sed 's|^#!/usr/bin/env python$|&2|' -i glances/glances.py +} + +package() { + cd $pkgname-$pkgver + python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 +} + +# vim:set ts=2 sw=2 et: