pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/sysutils/xosview Allow xosview to be installed by unpr...
details: https://anonhg.NetBSD.org/pkgsrc/rev/c347382a349c
branches: trunk
changeset: 535960:c347382a349c
user: rillig <rillig%pkgsrc.org@localhost>
date: Fri Nov 30 19:32:55 2007 +0000
description:
Allow xosview to be installed by unprivileged users, especially on BSD
systems.
diffstat:
sysutils/xosview/Makefile | 9 +++++++-
sysutils/xosview/distinfo | 4 +-
sysutils/xosview/patches/patch-aa | 44 +++++++++++++++++++++++++++++++-------
3 files changed, 45 insertions(+), 12 deletions(-)
diffs (140 lines):
diff -r 543bf93ea23d -r c347382a349c sysutils/xosview/Makefile
--- a/sysutils/xosview/Makefile Fri Nov 30 19:22:18 2007 +0000
+++ b/sysutils/xosview/Makefile Fri Nov 30 19:32:55 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.64 2007/09/29 12:04:39 obache Exp $
+# $NetBSD: Makefile,v 1.65 2007/11/30 19:32:55 rillig Exp $
DISTNAME= xosview-1.8.3
PKGREVISION= 1
@@ -38,6 +38,13 @@
USE_TOOLS+= gmake
.endif
+.if ${UNPRIVILEGED:M[Yy][Ee][Ss]} != ""
+SUBST_CLASSES+= unpriv
+SUBST_STAGE.unpriv= pre-configure
+SUBST_FILES.unpriv= config/Makefile.top.in
+SUBST_SED.unpriv= -e s,@INSTALL_ARGS@,,
+.endif
+
SUBST_CLASSES+= paths
SUBST_STAGE.paths= post-configure
SUBST_MESSAGE.paths= Fixing manpage path.
diff -r 543bf93ea23d -r c347382a349c sysutils/xosview/distinfo
--- a/sysutils/xosview/distinfo Fri Nov 30 19:22:18 2007 +0000
+++ b/sysutils/xosview/distinfo Fri Nov 30 19:32:55 2007 +0000
@@ -1,9 +1,9 @@
-$NetBSD: distinfo,v 1.21 2007/04/15 08:13:50 veego Exp $
+$NetBSD: distinfo,v 1.22 2007/11/30 19:32:55 rillig Exp $
SHA1 (xosview-1.8.3.tar.gz) = 420fd0620ff9fb9ba83fc833eeb8b872414e377e
RMD160 (xosview-1.8.3.tar.gz) = 595e812dee686ccaa5d95eb537782679d752271b
Size (xosview-1.8.3.tar.gz) = 259793 bytes
-SHA1 (patch-aa) = 48445a5e52cbcaec4147f25d3d758af207350d61
+SHA1 (patch-aa) = 85d392004017e7dfe79262b3e7fcacfd8499b8a2
SHA1 (patch-ab) = 274b83fd3488af8e0c4ce0184b8c78f4f6ef87df
SHA1 (patch-ac) = 3e9073c4ccd7e08d29a76b08f2ed0c7f9f9d9ede
SHA1 (patch-ad) = 02ae8395e200e5cbf8d6339eced33fe5aa421d38
diff -r 543bf93ea23d -r c347382a349c sysutils/xosview/patches/patch-aa
--- a/sysutils/xosview/patches/patch-aa Fri Nov 30 19:22:18 2007 +0000
+++ b/sysutils/xosview/patches/patch-aa Fri Nov 30 19:32:55 2007 +0000
@@ -1,7 +1,7 @@
-$NetBSD: patch-aa,v 1.17 2007/04/15 08:12:36 veego Exp $
+$NetBSD: patch-aa,v 1.18 2007/11/30 19:32:56 rillig Exp $
--- bsd/kernel.cc.orig 2006-02-18 08:36:06.000000000 +0100
-+++ bsd/kernel.cc 2007-04-14 21:34:03.000000000 +0200
++++ bsd/kernel.cc 2007-10-11 01:53:02.000000000 +0200
@@ -115,8 +115,16 @@
// in __NetBSD_Version__ for us if needed.
#if defined(XOSVIEW_NETBSD) && defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106010000)
@@ -19,7 +19,33 @@
#include "general.h"
#include "kernel.h" /* To grab CVSID stuff. */
-@@ -400,6 +408,8 @@
+@@ -303,9 +311,11 @@
+
+ void
+ OpenKDIfNeeded() {
++ static int initialized = 0;
+ char unusederrorstring[_POSIX2_LINE_MAX];
+
+- if (kd) return; // kd is non-NULL, so it has been initialized. BCG
++ if (initialized) return;
++ initialized = 1;
+
+ /* Open it read-only, for a little added safety. */
+ /* If the first character of kernelFileName is not '\0', then use
+@@ -313,8 +323,10 @@
+ specifying NULL. */
+ if ((kd = kvm_openfiles ((kernelFileName[0]) ? kernelFileName : NULL,
+ NULL, NULL, O_RDONLY, unusederrorstring))
+- == NULL)
+- err (-1, "OpenKDIfNeeded():kvm-open()");
++ == NULL) {
++ warn ("OpenKDIfNeeded():kvm-open()");
++ return;
++ }
+ // Parenthetical note: FreeBSD kvm_openfiles() uses getbootfile() to get
+ // the correct kernel file if the 1st arg is NULL. As far as I can see,
+ // one should always use NULL in FreeBSD, but I suppose control is never a
+@@ -400,6 +412,8 @@
static int mib[] = { CTL_KERN, KERN_CPUSTATS };
#endif
#if defined(XOSVIEW_NETBSD) && (__NetBSD_Version__ >= 104260000)
@@ -28,7 +54,7 @@
static int mib[] = { CTL_KERN, KERN_CP_TIME };
#endif
-@@ -407,14 +417,11 @@
+@@ -407,14 +421,11 @@
if (CPUSTATES != 5)
errx (-1, "Error: xosview for *BSD expects 5 cpu states!\n");
#if defined(__NetBSD_Version__) && __NetBSD_Version__ > 104260000 /* > 1.4Z */
@@ -47,7 +73,7 @@
#else
#ifdef XOSVIEW_BSDI
if (sysctl(mib, 2, &cpu, &size, NULL, 0) < 0) {
-@@ -441,7 +448,7 @@
+@@ -441,7 +452,7 @@
}
void
@@ -56,7 +82,7 @@
struct ifnet * ifnetp;
-@@ -466,7 +473,8 @@
+@@ -466,7 +477,8 @@
while (ifnetp) {
// Now, dereference the pointer to get the ifnet struct.
safe_kvm_read ((u_long) ifnetp, &ifnet, sizeof(ifnet));
@@ -66,7 +92,7 @@
char ifname[256];
#ifdef NETBSD_OLD_IFACE
// In pre-1.2A, getting the interface name was more complicated.
-@@ -476,15 +484,21 @@
+@@ -476,15 +488,21 @@
safe_kvm_read ((u_long) (((char*)ifnetp) + (&ifnet.if_xname[0] - (char*)&ifnet)), ifname, 256);
snprintf (ifname, 256, "%s", ifname);
#endif
@@ -89,7 +115,7 @@
// Linked-list step taken from if.c in netstat source, line 120.
#ifdef XOSVIEW_FREEBSD
#if (__FreeBSD_version >= 300000)
-@@ -773,13 +787,12 @@
+@@ -773,13 +791,12 @@
#ifdef NETBSD_1_6A
// Do a sysctl with a NULL data pointer to get the size that would
// have been returned, and use that to figure out # drives.
@@ -105,7 +131,7 @@
return 1;
#endif
return ValidSymbol(DISKLIST_SYM_INDEX);
-@@ -816,19 +829,29 @@
+@@ -816,19 +833,29 @@
#else
#if defined(NETBSD_1_6A)
// Use the new sysctl to do this for us.
Home |
Main Index |
Thread Index |
Old Index