diff options
Diffstat (limited to 'x11')
-rw-r--r-- | x11/kdebase3/Makefile | 5 | ||||
-rw-r--r-- | x11/kdebase3/PLIST | 3 | ||||
-rw-r--r-- | x11/kdebase3/options.mk | 12 | ||||
-rw-r--r-- | x11/kdebase3/patches/patch-aa | 22 | ||||
-rw-r--r-- | x11/kdebase3/patches/patch-af | 61 | ||||
-rw-r--r-- | x11/kdebase3/patches/patch-ah | 184 | ||||
-rw-r--r-- | x11/kdebase3/patches/patch-bc | 25 | ||||
-rw-r--r-- | x11/kdebase3/patches/patch-er | 192 | ||||
-rw-r--r-- | x11/kdebase3/patches/patch-fh | 37 | ||||
-rw-r--r-- | x11/kdebase3/patches/patch-fi | 39 |
10 files changed, 519 insertions, 61 deletions
diff --git a/x11/kdebase3/Makefile b/x11/kdebase3/Makefile index cca9ac7c3ac..6cfc066db9e 100644 --- a/x11/kdebase3/Makefile +++ b/x11/kdebase3/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.139 2007/12/27 08:01:20 markd Exp $ +# $NetBSD: Makefile,v 1.140 2008/01/04 21:05:56 markd Exp $ DISTNAME= kdebase-${_KDE_VERSION} -PKGREVISION= 3 +PKGREVISION= 4 CATEGORIES= x11 COMMENT= Base modules for the KDE 3 integrated X11 desktop @@ -32,7 +32,6 @@ REQD_DIRS+= ${PREFIX}/share/kde/fonts/override CONFIGURE_ARGS+= --with-ssl-dir="${BUILDLINK_PREFIX.openssl}" CONFIGURE_ARGS+= --with-ldap="${BUILDLINK_PREFIX.openldap-client}" -CONFIGURE_ARGS+= --without-composite CONFIGURE_ARGS+= --without-java REPLACE_PERL+= kcontrol/keys/convertShortcuts.pl \ diff --git a/x11/kdebase3/PLIST b/x11/kdebase3/PLIST index 754ec9746c2..0ed72213c52 100644 --- a/x11/kdebase3/PLIST +++ b/x11/kdebase3/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.48 2007/05/23 13:05:34 markd Exp $ +@comment $NetBSD: PLIST,v 1.49 2008/01/04 21:05:56 markd Exp $ bin/appletproxy bin/drkonqi bin/extensionproxy @@ -53,6 +53,7 @@ bin/klipper bin/klocaldomainurifilterhelper bin/kmenuedit bin/knetattach +${HAVE_COMPOSITE}bin/kompmgr bin/konqueror bin/konsole bin/kpager diff --git a/x11/kdebase3/options.mk b/x11/kdebase3/options.mk index 003ed8d42cb..102faa7875c 100644 --- a/x11/kdebase3/options.mk +++ b/x11/kdebase3/options.mk @@ -1,11 +1,19 @@ -# $NetBSD: options.mk,v 1.2 2007/10/31 11:56:44 markd Exp $ +# $NetBSD: options.mk,v 1.3 2008/01/04 21:05:56 markd Exp $ PKG_OPTIONS_VAR= PKG_OPTIONS.kdebase -PKG_SUPPORTED_OPTIONS= inet6 sasl samba debug pam +PKG_SUPPORTED_OPTIONS= inet6 sasl samba debug pam composite PKG_SUGGESTED_OPTIONS= sasl .include "../../mk/bsd.options.mk" +.if !empty(PKG_OPTIONS:Mcomposite) +CONFIGURE_ARGS+= --with-composite +PLIST_SUBST+= HAVE_COMPOSITE="" +.else +CONFIGURE_ARGS+= --without-composite +PLIST_SUBST+= HAVE_COMPOSITE="@comment " +.endif + .if !empty(PKG_OPTIONS:Msamba) .include "../../net/samba/buildlink3.mk" LIBS+= -L${BUILDLINK_PREFIX.samba}/lib/samba ${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.samba}/lib/samba diff --git a/x11/kdebase3/patches/patch-aa b/x11/kdebase3/patches/patch-aa index c112e6321e0..180a7d5861e 100644 --- a/x11/kdebase3/patches/patch-aa +++ b/x11/kdebase3/patches/patch-aa @@ -1,8 +1,8 @@ -$NetBSD: patch-aa,v 1.17 2007/05/23 13:05:34 markd Exp $ +$NetBSD: patch-aa,v 1.18 2008/01/04 21:05:57 markd Exp $ ---- configure.orig 2007-05-14 23:57:00.000000000 +1200 +--- configure.orig 2007-10-09 03:40:32.000000000 +1300 +++ configure -@@ -34288,7 +34288,7 @@ if { (eval echo "$as_me:$LINENO: \"$kde_ +@@ -31683,7 +31683,7 @@ if { (eval echo "$as_me:$LINENO: \"$kde_ # if you're trying to debug this check and think it's incorrect, # better check your installation. The check _is_ correct - your # installation is not. @@ -11,7 +11,7 @@ $NetBSD: patch-aa,v 1.17 2007/05/23 13:05:34 markd Exp $ kde_cv_uic_plugins=yes fi fi -@@ -47113,6 +47113,23 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec +@@ -42949,6 +42949,23 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec ac_cv_have_dpms="-lXdpms" @@ -35,7 +35,7 @@ $NetBSD: patch-aa,v 1.17 2007/05/23 13:05:34 markd Exp $ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -@@ -50244,7 +50261,7 @@ fi +@@ -45685,7 +45702,7 @@ fi case "$host" in @@ -44,7 +44,7 @@ $NetBSD: patch-aa,v 1.17 2007/05/23 13:05:34 markd Exp $ FOUND_USBVIEW=yes ;; esac -@@ -51868,7 +51885,7 @@ acimake: +@@ -47101,7 +47118,7 @@ acimake: EOF if $XMKMF >&5 2>&1 && test -f Makefile; then @@ -53,7 +53,15 @@ $NetBSD: patch-aa,v 1.17 2007/05/23 13:05:34 markd Exp $ kde_cv_defines_imake_version=$imkv else { echo "$as_me:$LINENO: result: failed" >&5 -@@ -60629,6 +60647,7 @@ fi +@@ -49261,6 +49278,7 @@ fi + + + case "$host" in ++ *-*-netbsd*) LIB_KVM="-lkvm" ;; + *-*-freebsd*) LIB_KVM="-lkvm" ;; + *) LIB_KVM="" ;; + esac +@@ -54739,6 +54757,7 @@ fi case "$UNAME" in Linux) LIBHOSTS="$LIBSENSORS" ;; FreeBSD) LIBHOSTS="$LIBSENSORS -lkvm" ;; diff --git a/x11/kdebase3/patches/patch-af b/x11/kdebase3/patches/patch-af index 5e165f3231b..f5537a4398b 100644 --- a/x11/kdebase3/patches/patch-af +++ b/x11/kdebase3/patches/patch-af @@ -1,8 +1,16 @@ -$NetBSD: patch-af,v 1.8 2007/05/23 13:05:35 markd Exp $ +$NetBSD: patch-af,v 1.9 2008/01/04 21:05:57 markd Exp $ --- kcontrol/info/info_netbsd.cpp.orig 2005-09-10 20:25:05.000000000 +1200 +++ kcontrol/info/info_netbsd.cpp -@@ -123,7 +123,7 @@ static bool GetDmesgInfo(QListView *lBox +@@ -41,6 +41,7 @@ + #include <qfontmetrics.h> + #include <qstrlist.h> + #include <qtextstream.h> ++#include <qregexp.h> + + #include <kdebug.h> + #include <kio/global.h> /* for KIO::convertSize() */ +@@ -123,7 +124,7 @@ static bool GetDmesgInfo(QListView *lBox } QListViewItem *olditem = NULL; @@ -11,7 +19,36 @@ $NetBSD: patch-af,v 1.8 2007/05/23 13:05:35 markd Exp $ if (!seencpu) { if (s.contains("cpu")) seencpu = true; -@@ -265,9 +265,11 @@ bool GetInfo_SCSI (QListView *lbox) +@@ -134,9 +135,7 @@ static bool GetDmesgInfo(QListView *lBox + s.contains("WARNING: old BSD partition ID!")) + break; + +- if (!filter +- || (filter[0] == '^' && s.find(&filter[1]) == 0) +- || (filter[0] != '^' && s.contains(filter))) { ++ if (!filter || s.contains(QRegExp(filter))) { + if (func) + func(lBox, s); + else +@@ -163,7 +162,7 @@ AddIRQLine(QListView *lBox, QString s) + int pos, irqnum; + char numstr[3]; + +- pos = s.find(" irq "); ++ pos = s.find(QRegExp("[ (]irq ")); + irqnum = (pos < 0) ? 0 : atoi(&s.ascii()[pos+5]); + if (irqnum) + snprintf(numstr, 3, "%02d", irqnum); +@@ -181,7 +180,7 @@ bool GetInfo_IRQ (QListView *lBox) + lBox->addColumn(i18n("Device")); + lBox->setSorting(0); + lBox->setShowSortIndicator(FALSE); +- (void) GetDmesgInfo(lBox, " irq ", AddIRQLine); ++ (void) GetDmesgInfo(lBox, "[ (]irq ", AddIRQLine); + return true; + } + +@@ -265,9 +264,11 @@ bool GetInfo_SCSI (QListView *lbox) bool GetInfo_Partitions (QListView *lbox) { int num; // number of mounts @@ -25,7 +62,7 @@ $NetBSD: patch-af,v 1.8 2007/05/23 13:05:35 markd Exp $ // get mount info if (!(num=getmntinfo(&mnt, MNT_WAIT))) { -@@ -290,7 +292,11 @@ bool GetInfo_Partitions (QListView *lbox +@@ -290,24 +291,31 @@ bool GetInfo_Partitions (QListView *lbox unsigned long long big[2]; QString vv[5]; @@ -37,7 +74,19 @@ $NetBSD: patch-af,v 1.8 2007/05/23 13:05:35 markd Exp $ big[0] *= mnt->f_blocks; big[1] *= mnt->f_bavail; // FIXME: use f_bfree if root? -@@ -307,7 +313,11 @@ bool GetInfo_Partitions (QListView *lbox + // convert to strings + vv[0] = KIO::convertSize(big[0]); +- vv[1] = QString::fromLatin1("%1 (%2%%)") ++ vv[1] = QString("%1 (%2%)") + .arg(KIO::convertSize(big[1])) + .arg(mnt->f_blocks ? mnt->f_bavail*100/mnt->f_blocks : 0); + +- // FIXME: these two are large enough to punctuate +- vv[2] = QString::number(mnt->f_files); +- vv[3] = QString::fromLatin1("%1 (%2%%) ") ++ vv[2] = QString("%L1").arg(mnt->f_files); ++ vv[3] = QString("%L1 (%2%) ") + .arg(mnt->f_ffree) .arg(mnt->f_files ? mnt->f_ffree*100/mnt->f_files : 0); vv[4] = QString::null; @@ -49,7 +98,7 @@ $NetBSD: patch-af,v 1.8 2007/05/23 13:05:35 markd Exp $ MNTF(ASYNC) MNTF(DEFEXPORTED) MNTF(EXKERB) -@@ -316,7 +326,9 @@ bool GetInfo_Partitions (QListView *lbox +@@ -316,7 +324,9 @@ bool GetInfo_Partitions (QListView *lbox MNTF(EXPORTED) MNTF(EXPUBLIC) MNTF(EXRDONLY) diff --git a/x11/kdebase3/patches/patch-ah b/x11/kdebase3/patches/patch-ah new file mode 100644 index 00000000000..3ae6c7e1ed9 --- /dev/null +++ b/x11/kdebase3/patches/patch-ah @@ -0,0 +1,184 @@ +$NetBSD: patch-ah,v 1.11 2008/01/04 21:05:57 markd Exp $ + +--- kicker/applets/naughty/NaughtyProcessMonitor.cpp.orig 2007-12-30 16:38:02.000000000 +1300 ++++ kicker/applets/naughty/NaughtyProcessMonitor.cpp +@@ -20,7 +20,7 @@ + + /* OpenBSD support by Jean-Yves Burlett <jean-yves@burlett.org> */ + +-#ifdef __OpenBSD__ ++#if defined(__OpenBSD__) || defined(__NetBSD__) + #include <sys/param.h> + #include <sys/proc.h> + #include <sys/sysctl.h> +@@ -29,6 +29,11 @@ + #include <stdlib.h> + #endif + ++#ifdef __NetBSD__ ++#include <kvm.h> ++#include <sys/sched.h> ++#endif ++ + #include <sys/types.h> + #include <signal.h> + #include <unistd.h> +@@ -67,10 +72,13 @@ class NaughtyProcessMonitorPrivate + QTimer * timer_; + QMap<ulong, uint> loadMap_; + QMap<ulong, uint> scoreMap_; +-#ifdef __OpenBSD__ ++#if defined(__OpenBSD__) || defined(__NetBSD__) + QMap<ulong, uint> cacheLoadMap_; + QMap<ulong, uid_t> uidMap_; + #endif ++#ifdef __NetBSD__ ++ kvm_t *kd; ++#endif + uint oldLoad_; + uint triggerLevel_; + +@@ -95,11 +103,17 @@ NaughtyProcessMonitor::NaughtyProcessMon + d->interval_ = interval * 1000; + d->triggerLevel_ = triggerLevel; + d->timer_ = new QTimer(this); ++#ifdef __NetBSD__ ++ d->kd = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, "kvm_open"); ++#endif + connect(d->timer_, SIGNAL(timeout()), this, SLOT(slotTimeout())); + } + + NaughtyProcessMonitor::~NaughtyProcessMonitor() + { ++#ifdef __NetBSD__ ++ kvm_close(d->kd); ++#endif + delete d; + } + +@@ -219,7 +233,7 @@ NaughtyProcessMonitor::canKill(ulong pid + // uint d(l[4].toUInt()); + + return geteuid() == a; +-#elif defined(__OpenBSD__) ++#elif defined(__OpenBSD__) || defined(__NetBSD__) + // simply check if entry exists in the uid map and use it + if (!d->uidMap_.contains(pid)) + return false ; +@@ -234,7 +248,7 @@ NaughtyProcessMonitor::canKill(ulong pid + QString + NaughtyProcessMonitor::processName(ulong pid) const + { +-#if defined(__linux__) || defined(__OpenBSD__) ++#if defined(__linux__) || defined(__OpenBSD__) || defined(__NetBSD__) + #ifdef __linux__ + QFile f("/proc/" + QString::number(pid) + "/cmdline"); + +@@ -283,6 +297,29 @@ NaughtyProcessMonitor::processName(ulong + QString unicode(QString::fromLocal8Bit(argv[0])); + + free (argv) ; ++#elif defined(__NetBSD__) ++ struct kinfo_proc2 *p; ++ int len; ++ char **argv; ++ ++ p = kvm_getproc2(d->kd, KERN_PROC_PID, pid, ++ sizeof(struct kinfo_proc2), &len); ++ if (len < 1) { ++ return i18n("Unknown") ; ++ } ++ ++ // Now strip 'kdeinit:' prefix. ++ QString unicode(QString::fromLocal8Bit(p->p_comm)); ++ ++ if (unicode == "kdeinit") { ++ argv = kvm_getargv2(d->kd, p, 100); ++ while (argv != NULL && (*argv == "kdeinit:")) { ++ argv++; ++ } ++ if (argv != NULL) { ++ unicode = *argv; ++ } ++ } + #endif + + QStringList parts(QStringList::split(' ', unicode)); +@@ -350,6 +387,28 @@ NaughtyProcessMonitor::cpuLoad() const + d->oldLoad_ = load ; + + return (forgetThisOne ? 0 : diff); ++#elif defined(__NetBSD__) ++ int mib[2] ; ++ u_int64_t cp_time[CPUSTATES] ; ++ size_t size ; ++ uint load, diff ; ++ bool forgetThisOne = 0 == d->oldLoad_; ++ ++ // fetch CPU time statistics ++ ++ mib[0] = CTL_KERN ; ++ mib[1] = KERN_CP_TIME ; ++ ++ size = CPUSTATES * sizeof(cp_time[0]) ; ++ ++ if (-1 == sysctl (mib, 2, cp_time, &size, NULL, 0)) ++ return 0 ; ++ ++ load = cp_time[CP_USER] + cp_time[CP_SYS] ; ++ diff = load - d->oldLoad_ ; ++ d->oldLoad_ = load ; ++ ++ return (forgetThisOne ? 0 : diff); + #else + return 0; + #endif +@@ -420,6 +479,30 @@ NaughtyProcessMonitor::pidList() const + free (kp) ; + + return l ; ++#elif defined(__NetBSD__) ++ struct kinfo_proc2 *kp; ++ int nentries ; ++ int i ; ++ QValueList<ulong> l; ++ ++ kp = kvm_getproc2(d->kd, KERN_PROC_ALL, 0, ++ sizeof(struct kinfo_proc2), &nentries); ++ ++ // time statistics and euid data are fetched only for processes in ++ // the pidList, so, instead of doing one sysctl per process for ++ // getLoad and canKill calls, simply cache the data we already have. ++ ++ d->cacheLoadMap_.clear () ; ++ d->uidMap_.clear () ; ++ for (i = 0; i < nentries; i++) { ++ l << (unsigned long) kp[i].p_pid ; ++ d->cacheLoadMap_.insert (kp[i].p_pid, ++ kp[i].p_cpticks) ; ++ d->uidMap_.insert (kp[i].p_pid, ++ kp[i].p_uid) ; ++ } ++ ++ return l ; + #else + QValueList<ulong> l; + return l; +@@ -447,7 +530,7 @@ NaughtyProcessMonitor::getLoad(ulong pid + load = userTime + sysTime; + + return true; +-#elif defined(__OpenBSD__) ++#elif defined(__OpenBSD__) || defined(__NetBSD__) + // use cache + if (!d->cacheLoadMap_.contains(pid)) + return false ; +@@ -464,7 +547,7 @@ NaughtyProcessMonitor::getLoad(ulong pid + bool + NaughtyProcessMonitor::kill(ulong pid) const + { +-#if defined(__linux__) || defined(__OpenBSD__) ++#if defined(__linux__) || defined(__OpenBSD__) || defined(__NetBSD__) + return 0 == ::kill(pid, SIGKILL); + #else + Q_UNUSED( pid ); diff --git a/x11/kdebase3/patches/patch-bc b/x11/kdebase3/patches/patch-bc index 61d31300d5e..4ed8f842774 100644 --- a/x11/kdebase3/patches/patch-bc +++ b/x11/kdebase3/patches/patch-bc @@ -1,6 +1,6 @@ -$NetBSD: patch-bc,v 1.4 2005/12/11 11:01:48 markd Exp $ +$NetBSD: patch-bc,v 1.5 2008/01/04 21:05:57 markd Exp $ ---- kdeeject/kdeeject.orig 2005-09-10 20:25:38.000000000 +1200 +--- kdeeject/kdeeject.orig 2006-10-02 06:31:56.000000000 +1300 +++ kdeeject/kdeeject @@ -1,6 +1,6 @@ #!/bin/sh @@ -10,7 +10,7 @@ $NetBSD: patch-bc,v 1.4 2005/12/11 11:01:48 markd Exp $ # # Copyright GPL v2 by David Faure <david@mandrakesoft.com> # -@@ -17,7 +17,7 @@ if test $# -ge 1 -a "$1" != "--help"; th +@@ -17,10 +17,26 @@ if test $# -ge 1 -a "$1" != "--help"; th OpenBSD) cdio -f $1 eject >/dev/null 2>&1 ;; @@ -19,3 +19,22 @@ $NetBSD: patch-bc,v 1.4 2005/12/11 11:01:48 markd Exp $ dev=`echo $1 | sed -E -e 's#/dev/##' -e 's/([0-9])./\1/'` cdcontrol -f $dev eject >/dev/null 2>&1 ;; ++ NetBSD) ++ dev=$1 ++ if [ -h $1 ]; then ++ dev=$(readlink $dev 2> /dev/null) || dev=$1 ++ fi ++ case $(sysctl -n kern.rawpartition 2> /dev/null) in ++ 2) rawp=c ;; ++ 3) rawp=d ;; ++ esac ++ rdev=$(echo $dev | sed -E -e 's#(/dev/)#\1r#; s#[a-z]$#'$rawp'#') ++ if [ -e $rdev ]; then ++ eject $rdev >/dev/null 2>&1 ++ else ++ eject $dev >/dev/null 2>&1 ++ fi ++ ;; + *) + # Warning, it has to be either eject 2.0.x or >=2.1.5 + # Otherwise it doesn't work as expected (it requires a diff --git a/x11/kdebase3/patches/patch-er b/x11/kdebase3/patches/patch-er index ef8d344872c..fcc3922247c 100644 --- a/x11/kdebase3/patches/patch-er +++ b/x11/kdebase3/patches/patch-er @@ -1,8 +1,8 @@ -$NetBSD: patch-er,v 1.7 2007/12/27 08:01:20 markd Exp $ +$NetBSD: patch-er,v 1.8 2008/01/04 21:05:57 markd Exp $ --- ksysguard/ksysguardd/NetBSD/ProcessList.c.orig 2005-10-11 04:04:31.000000000 +1300 +++ ksysguard/ksysguardd/NetBSD/ProcessList.c -@@ -24,6 +24,7 @@ +@@ -24,10 +24,12 @@ #include <ctype.h> #include <dirent.h> @@ -10,18 +10,184 @@ $NetBSD: patch-er,v 1.7 2007/12/27 08:01:20 markd Exp $ #include <pwd.h> #include <stdio.h> #include <stdlib.h> -@@ -191,11 +192,13 @@ updateProcess(int pid) - ps->ppid = p.kp_eproc.e_ppid; - ps->uid = p.kp_eproc.e_ucred.cr_uid; - ps->gid = p.kp_eproc.e_pgid; -+#if __NetBSD_Version__ < 106130000 - ps->priority = p.kp_proc.p_priority; -+#endif - ps->niceLevel = p.kp_proc.p_nice; + #include <string.h> ++#include <kvm.h> + #include <sys/param.h> + #include <sys/sysctl.h> + #include <sys/time.h> +@@ -46,6 +48,8 @@ CONTAINER ProcessList = 0; + + #define BUFSIZE 1024 + ++static kvm_t *kd; ++ + typedef struct + { + /* This flag is set for all found processes at the beginning of the +@@ -157,15 +161,13 @@ findProcessInList(int pid) + } + + static int +-updateProcess(int pid) ++updateProcess(int pid, struct kinfo_proc2 *p) + { +- static char *statuses[] = { "idle","run","sleep","stop","zombie" }; ++ static char *statuses[] = { "", "idle","run","sleep","stop","zombie","dead","onproc" }; + + ProcessInfo* ps; + struct passwd* pwent; +- int mib[4]; +- struct kinfo_proc p; +- size_t len; ++ char **argv, **a; - /* this isn't usertime -- it's total time (??) */ + if ((ps = findProcessInList(pid)) == 0) + { +@@ -178,26 +180,18 @@ updateProcess(int pid) + + ps->alive = 1; + +- mib[0] = CTL_KERN; +- mib[1] = KERN_PROC; +- mib[2] = KERN_PROC_PID; +- mib[3] = pid; +- +- len = sizeof (p); +- if (sysctl(mib, 4, &p, &len, NULL, 0) == -1 || !len) +- return -1; +- +- ps->pid = p.kp_proc.p_pid; +- ps->ppid = p.kp_eproc.e_ppid; +- ps->uid = p.kp_eproc.e_ucred.cr_uid; +- ps->gid = p.kp_eproc.e_pgid; +- ps->priority = p.kp_proc.p_priority; +- ps->niceLevel = p.kp_proc.p_nice; +- +- /* this isn't usertime -- it's total time (??) */ - ps->userTime = p.kp_proc.p_rtime.tv_sec*100+p.kp_proc.p_rtime.tv_usec/100; -+ ps->userTime = 0; - ps->sysTime = 0; +- ps->sysTime = 0; ++ ps->pid = p->p_pid; ++ ps->ppid = p->p_ppid; ++ ps->uid = p->p_uid; ++ ps->gid = p->p_gid; ++ ps->priority = p->p_priority - 22; /* why 22? */ ++ ps->niceLevel = p->p_nice - NZERO; ++ ++#if 0 ++ ps->userTime = p->p_rtime_sec*100+p->p_rtime_usec/100; ++ ps->sysTime = 0; ps->sysLoad = 0; ++#endif + + /* memory, process name, process uid */ + /* find out user name with process uid */ +@@ -205,19 +199,26 @@ updateProcess(int pid) + strlcpy(ps->userName,pwent&&pwent->pw_name? pwent->pw_name:"????",sizeof(ps->userName)); + ps->userName[sizeof(ps->userName)-1]='\0'; + +- ps->userLoad = p.kp_proc.p_pctcpu / 100; +- ps->vmSize = (p.kp_eproc.e_vm.vm_tsize + +- p.kp_eproc.e_vm.vm_dsize + +- p.kp_eproc.e_vm.vm_ssize) * getpagesize(); +- ps->vmRss = p.kp_eproc.e_vm.vm_rssize * getpagesize(); +- strlcpy(ps->name,p.kp_proc.p_comm ? p.kp_proc.p_comm : "????", sizeof(ps->name)); +- strlcpy(ps->status,(p.kp_proc.p_stat>=1)&&(p.kp_proc.p_stat<=5)? statuses[p.kp_proc.p_stat-1]:"????", sizeof(ps->status)); ++ ps->userLoad = 100.0 * ((double)(p->p_pctcpu) / FSCALE); ++ ps->vmSize = (p->p_vm_tsize + ++ p->p_vm_dsize + ++ p->p_vm_ssize) * getpagesize(); ++ ps->vmRss = p->p_vm_rssize * getpagesize(); ++ strlcpy(ps->name,p->p_comm ? p->p_comm : "????", sizeof(ps->name)); ++ strlcpy(ps->status,(p->p_stat<=7)? statuses[p->p_stat]:"????", sizeof(ps->status)); + + /* process command line */ +- /* the following line causes segfaults on some FreeBSD systems... why? +- strncpy(ps->cmdline, p.kp_proc.p_args->ar_args, sizeof(ps->cmdline) - 1); +- */ +- strcpy(ps->cmdline, "????"); ++ argv = kvm_getargv2(kd, p, sizeof(ps->cmdline)); ++ ps->cmdline[0] = '\0'; ++ if ((a = argv) != NULL) { ++ while (*a) { ++ strlcat(ps->cmdline, *a, sizeof(ps->cmdline)); ++ a++; ++ strlcat(ps->cmdline, " ", sizeof(ps->cmdline)); ++ } ++ } else { ++ strcpy(ps->cmdline, "????"); ++ } + + return (0); + } +@@ -266,6 +267,8 @@ initProcessList(struct SensorModul* sm) + registerCommand("setpriority", setPriority); + } + ++ kd = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, "kvm_open"); ++ + updateProcessList(); + } + +@@ -277,27 +280,22 @@ exitProcessList(void) + + if (ProcessList) + free (ProcessList); ++ ++ kvm_close(kd); + } + + int + updateProcessList(void) + { +- int mib[3]; +- size_t len; +- size_t num; +- struct kinfo_proc *p; +- +- +- mib[0] = CTL_KERN; +- mib[1] = KERN_PROC; +- mib[2] = KERN_PROC_ALL; +- sysctl(mib, 3, NULL, &len, NULL, 0); +- p = malloc(len); +- sysctl(mib, 3, p, &len, NULL, 0); +- +- for (num = 0; num < len / sizeof(struct kinfo_proc); num++) +- updateProcess(p[num].kp_proc.p_pid); +- free(p); ++ int len; ++ int num; ++ struct kinfo_proc2 *p; ++ ++ p = kvm_getproc2(kd, KERN_PROC_ALL, 0, ++ sizeof(struct kinfo_proc2), &len); ++ ++ for (num = 0; num < len; num++) ++ updateProcess(p[num].p_pid, &p[num]); + cleanupProcessList(); + + return (0); +@@ -306,8 +304,8 @@ updateProcessList(void) + void + printProcessListInfo(const char* cmd) + { +- fprintf(CurrentClient, "Name\tPID\tPPID\tUID\tGID\tStatus\tUser%%\tSystem%%\tNice\tVmSize\tVmRss\tLogin\tCommand\n"); +- fprintf(CurrentClient, "s\td\td\td\td\tS\tf\tf\td\tD\tD\ts\ts\n"); ++ fprintf(CurrentClient, "Name\tPID\tPPID\tUID\tGID\tStatus\tCPU%%\tPrio\tNice\tVmSize\tVmRss\tLogin\tCommand\n"); ++ fprintf(CurrentClient, "s\td\td\td\td\tS\tf\td\td\tD\tD\ts\ts\n"); + } + void +@@ -318,10 +316,10 @@ printProcessList(const char* cmd) + ps = first_ctnr(ProcessList); /* skip 'kernel' entry */ + for (ps = next_ctnr(ProcessList); ps; ps = next_ctnr(ProcessList)) + { +- fprintf(CurrentClient, "%s\t%ld\t%ld\t%ld\t%ld\t%s\t%.2f\t%.2f\t%d\t%d\t%d\t%s\t%s\n", ++ fprintf(CurrentClient, "%s\t%ld\t%ld\t%ld\t%ld\t%s\t%.2f\t%d\t%d\t%d\t%d\t%s\t%s\n", + ps->name, (long)ps->pid, (long)ps->ppid, + (long)ps->uid, (long)ps->gid, ps->status, +- ps->userLoad, ps->sysLoad, ps->niceLevel, ++ ps->userLoad, ps->priority, ps->niceLevel, + ps->vmSize / 1024, ps->vmRss / 1024, ps->userName, ps->cmdline); + } + } diff --git a/x11/kdebase3/patches/patch-fh b/x11/kdebase3/patches/patch-fh index e97d0228d72..4d55824cb6b 100644 --- a/x11/kdebase3/patches/patch-fh +++ b/x11/kdebase3/patches/patch-fh @@ -1,8 +1,8 @@ -$NetBSD: patch-fh,v 1.5 2006/10/08 07:49:27 markd Exp $ +$NetBSD: patch-fh,v 1.6 2008/01/04 21:05:58 markd Exp $ --- ksysguard/ksysguardd/NetBSD/CPU.c.orig 2005-10-11 04:04:31.000000000 +1300 +++ ksysguard/ksysguardd/NetBSD/CPU.c -@@ -19,6 +19,8 @@ +@@ -19,10 +19,11 @@ */ @@ -11,20 +11,24 @@ $NetBSD: patch-fh,v 1.5 2006/10/08 07:49:27 markd Exp $ #include <sys/dkstat.h> #include <sys/sched.h> /* CPUSTATES */ #include <fcntl.h> -@@ -33,20 +35,13 @@ +-#include <kvm.h> + #include <nlist.h> + #include <stdio.h> + #include <stdlib.h> +@@ -33,20 +34,11 @@ #include "Command.h" #include "ksysguardd.h" -long percentages(int cnt, int *out, long *new, long *old, long *diffs); -- ++void percentages(int, int *, u_int64_t *, u_int64_t *, u_int64_t *); + -struct nlist my_nlist[] = { - {"_cp_time"}, - { 0 } -}; -+void percentages(int, int *, u_int64_t *, u_int64_t *, u_int64_t *); - - kvm_t *kd; - +- +-kvm_t *kd; +- -unsigned long cp_time_offset; - -long cp_time[CPUSTATES]; @@ -36,18 +40,23 @@ $NetBSD: patch-fh,v 1.5 2006/10/08 07:49:27 markd Exp $ int cpu_states[CPUSTATES]; void -@@ -61,9 +56,7 @@ initCpuInfo(struct SensorModul* sm) +@@ -61,9 +53,6 @@ initCpuInfo(struct SensorModul* sm) printCPUSysInfo, sm); registerMonitor("cpu/idle", "integer", printCPUIdle, printCPUIdleInfo, sm); - kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open"); - kvm_nlist(kd, my_nlist); - cp_time_offset = my_nlist[0].n_value; -+ kd = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, "kvm_open"); updateCpuInfo(); } -@@ -77,7 +70,13 @@ exitCpuInfo(void) +@@ -71,13 +60,18 @@ initCpuInfo(struct SensorModul* sm) + void + exitCpuInfo(void) + { +- kvm_close(kd); + } + int updateCpuInfo(void) { @@ -62,7 +71,7 @@ $NetBSD: patch-fh,v 1.5 2006/10/08 07:49:27 markd Exp $ percentages(CPUSTATES, cpu_states, cp_time, cp_old, cp_diff); return (0); } -@@ -152,20 +151,20 @@ printCPUIdleInfo(const char* cmd) +@@ -152,20 +146,20 @@ printCPUIdleInfo(const char* cmd) * useful on BSD mchines for calculating cpu state percentages. */ @@ -92,7 +101,7 @@ $NetBSD: patch-fh,v 1.5 2006/10/08 07:49:27 markd Exp $ /* initialization */ total_change = 0; -@@ -174,12 +173,11 @@ long *diffs; +@@ -174,12 +168,11 @@ long *diffs; /* calculate changes for each state and the overall change */ for (i = 0; i < cnt; i++) { @@ -110,7 +119,7 @@ $NetBSD: patch-fh,v 1.5 2006/10/08 07:49:27 markd Exp $ total_change += (*dp++ = change); *old++ = *new++; } -@@ -191,16 +189,9 @@ long *diffs; +@@ -191,16 +184,9 @@ long *diffs; } /* calculate percentages based on overall change, rounding up */ diff --git a/x11/kdebase3/patches/patch-fi b/x11/kdebase3/patches/patch-fi index 191bc560fe2..66aac6c5fa7 100644 --- a/x11/kdebase3/patches/patch-fi +++ b/x11/kdebase3/patches/patch-fi @@ -1,8 +1,16 @@ -$NetBSD: patch-fi,v 1.3 2006/10/08 07:49:27 markd Exp $ +$NetBSD: patch-fi,v 1.4 2008/01/04 21:05:58 markd Exp $ ---- ksysguard/ksysguardd/NetBSD/Memory.c.orig 2006-10-08 15:49:27.000000000 +1300 +--- ksysguard/ksysguardd/NetBSD/Memory.c.orig 2005-10-11 04:04:31.000000000 +1300 +++ ksysguard/ksysguardd/NetBSD/Memory.c -@@ -45,8 +45,11 @@ +@@ -21,7 +21,6 @@ + */ + + #include <fcntl.h> +-#include <kvm.h> + #include <limits.h> + #include <stdio.h> + #include <stdlib.h> +@@ -45,29 +44,25 @@ static size_t Total = 0; static size_t MFree = 0; static size_t Used = 0; @@ -16,7 +24,8 @@ $NetBSD: patch-fi,v 1.3 2006/10/08 07:49:27 markd Exp $ static size_t STotal = 0; static size_t SFree = 0; static size_t SUsed = 0; -@@ -55,19 +58,18 @@ static kvm_t *kd; +-static kvm_t *kd; + void initMemory(struct SensorModul* sm) { @@ -26,11 +35,9 @@ $NetBSD: patch-fi,v 1.3 2006/10/08 07:49:27 markd Exp $ - - if ((kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, buf)) == NULL) { - log_error("kvm_openfiles()"); -+ if ((kd = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, "kvm_open")) == NULL) { -+ log_error("kvm_open()"); - return; - } - +- return; +- } +- registerMonitor("mem/physical/free", "integer", printMFree, printMFreeInfo, sm); registerMonitor("mem/physical/used", "integer", printUsed, printUsedInfo, sm); - registerMonitor("mem/physical/buf", "integer", printBuffers, printBuffersInfo, sm); @@ -43,7 +50,15 @@ $NetBSD: patch-fi,v 1.3 2006/10/08 07:49:27 markd Exp $ registerMonitor("mem/swap/free", "integer", printSwapFree, printSwapFreeInfo, sm); registerMonitor("mem/swap/used", "integer", printSwapUsed, printSwapUsedInfo, sm); } -@@ -83,7 +85,6 @@ updateMemory(void) +@@ -75,7 +70,6 @@ initMemory(struct SensorModul* sm) + void + exitMemory(void) + { +- kvm_close(kd); + } + + int +@@ -83,7 +77,6 @@ updateMemory(void) { #define ARRLEN(X) (sizeof(X)/sizeof(X[0])) @@ -51,7 +66,7 @@ $NetBSD: patch-fi,v 1.3 2006/10/08 07:49:27 markd Exp $ size_t len; { -@@ -95,37 +96,26 @@ updateMemory(void) +@@ -95,37 +88,26 @@ updateMemory(void) } { @@ -101,7 +116,7 @@ $NetBSD: patch-fi,v 1.3 2006/10/08 07:49:27 markd Exp $ return 0; } -@@ -154,27 +144,63 @@ printUsedInfo(const char* cmd) +@@ -154,27 +136,63 @@ printUsedInfo(const char* cmd) } void |