pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/libgtop Add "model name" to the sysinfo hash ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5058921a9ae7
branches:  trunk
changeset: 398271:5058921a9ae7
user:      ahoka <ahoka%pkgsrc.org@localhost>
date:      Thu Aug 27 20:03:17 2009 +0000

description:
Add "model name" to the sysinfo hash table.
Fixes "Unknown CPU model" bug in gnome-system-monitor.

diffstat:

 sysutils/libgtop/Makefile         |   4 ++--
 sysutils/libgtop/distinfo         |   3 ++-
 sysutils/libgtop/patches/patch-ad |  36 ++++++++++++++++++++++++++++++++++++
 3 files changed, 40 insertions(+), 3 deletions(-)

diffs (70 lines):

diff -r 05b211052e4f -r 5058921a9ae7 sysutils/libgtop/Makefile
--- a/sysutils/libgtop/Makefile Thu Aug 27 19:44:49 2009 +0000
+++ b/sysutils/libgtop/Makefile Thu Aug 27 20:03:17 2009 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.27 2009/07/11 13:14:13 hasso Exp $
+# $NetBSD: Makefile,v 1.28 2009/08/27 20:03:17 ahoka Exp $
 
 DISTNAME=              libgtop-2.26.1
-PKGREVISION=           1
+PKGREVISION=           2
 CATEGORIES=            sysutils gnome
 MASTER_SITES=          ${MASTER_SITE_GNOME:=sources/libgtop/2.26/}
 EXTRACT_SUFX=          .tar.bz2
diff -r 05b211052e4f -r 5058921a9ae7 sysutils/libgtop/distinfo
--- a/sysutils/libgtop/distinfo Thu Aug 27 19:44:49 2009 +0000
+++ b/sysutils/libgtop/distinfo Thu Aug 27 20:03:17 2009 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.15 2009/07/11 13:14:13 hasso Exp $
+$NetBSD: distinfo,v 1.16 2009/08/27 20:03:17 ahoka Exp $
 
 SHA1 (libgtop-2.26.1.tar.bz2) = 758bbf69009c6bcfe2765de97e7027124c5a147e
 RMD160 (libgtop-2.26.1.tar.bz2) = 5177aad953508b20d794d2390204b5b07bc364f5
@@ -6,6 +6,7 @@
 SHA1 (patch-aa) = b056c00edebf3578364de50bcd1345bff67b45bc
 SHA1 (patch-ab) = cd11ad54870ab54fb940f922c1cc55d1c7ec2161
 SHA1 (patch-ac) = 3dd59355e36657df4c8575c35ef11c28d4192d77
+SHA1 (patch-ad) = 304b91c38fa9b39ffcfd2d39d9c382ecdc23469e
 SHA1 (patch-ag) = 8ed7b66b4250dbc6f6321cef24941f58106fcbaf
 SHA1 (patch-ai) = 856c457b14e384b2c991bf51274f97a3a9c853f1
 SHA1 (patch-aj) = 94e41923f13732118e8e809a09ec4162bf2ca422
diff -r 05b211052e4f -r 5058921a9ae7 sysutils/libgtop/patches/patch-ad
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/libgtop/patches/patch-ad Thu Aug 27 20:03:17 2009 +0000
@@ -0,0 +1,36 @@
+$NetBSD: patch-ad,v 1.9 2009/08/27 20:03:17 ahoka Exp $
+
+--- sysdeps/bsd/sysinfo.c.orig 2009-08-27 14:29:56.000000000 +0200
++++ sysdeps/bsd/sysinfo.c
+@@ -36,6 +36,7 @@ static void
+ init_sysinfo (glibtop *server)
+ {
+       char *model;
++      char *brand;
+       guint64 ncpus = 1;
+       int mhz = 0;
+       size_t len;
+@@ -51,6 +52,12 @@ init_sysinfo (glibtop *server)
+       sysctlbyname ("hw.model", NULL, &len, NULL, 0);
+       model = g_malloc (len);
+       sysctlbyname ("hw.model", model, &len, NULL, 0);
++      if (sysctlbyname ("machdep.cpu_brand", NULL, &len, NULL, 0) != -1) {
++              brand = g_malloc (len);
++              sysctlbyname ("machdep.cpu_brand", brand, &len, NULL, 0);
++      } else {
++              brand = model;
++      }
+       len = sizeof (mhz);
+       sysctlbyname ("hw.clockrate", &mhz, &len, NULL, 0);
+ 
+@@ -73,6 +80,10 @@ init_sysinfo (glibtop *server)
+               g_hash_table_insert (cpuinfo->values, "vendor_id",
+                                    g_strdup(model));
+ 
++              g_ptr_array_add (cpuinfo->labels, "model name");
++              g_hash_table_insert (cpuinfo->values, "model name",
++                                   g_strdup(brand));
++
+               g_ptr_array_add (cpuinfo->labels, "cpu MHz");
+               g_hash_table_insert (cpuinfo->values, "cpu MHz",
+                                    g_strdup_printf("%d", mhz));



Home | Main Index | Thread Index | Old Index