From 6071b9d3c14e201db7d84108b2a77f703996e403 Mon Sep 17 00:00:00 2001 From: joerg Date: Wed, 21 Jun 2006 20:41:27 +0000 Subject: Add DragonFly support. --- sysutils/xps/Makefile | 5 ++- sysutils/xps/distinfo | 4 ++- sysutils/xps/patches/patch-aa | 13 +++++++ sysutils/xps/patches/patch-ab | 83 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 sysutils/xps/patches/patch-aa create mode 100644 sysutils/xps/patches/patch-ab diff --git a/sysutils/xps/Makefile b/sysutils/xps/Makefile index 65fa38b260c..ab0ad3e8524 100644 --- a/sysutils/xps/Makefile +++ b/sysutils/xps/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.33 2006/03/04 21:30:44 jlam Exp $ +# $NetBSD: Makefile,v 1.34 2006/06/21 20:41:27 joerg Exp $ DISTNAME= xps-4.2 PKGREVISION= 2 @@ -12,5 +12,8 @@ COMMENT= Displays the Unix process list as a hierarchical tree USE_TOOLS+= gmake perl GNU_CONFIGURE= yes +post-extract: + ${LN} -s FreeBSD ${WRKSRC}/src/DragonFly + .include "../../mk/motif.buildlink3.mk" .include "../../mk/bsd.pkg.mk" diff --git a/sysutils/xps/distinfo b/sysutils/xps/distinfo index a0229d03b3a..f8b80245269 100644 --- a/sysutils/xps/distinfo +++ b/sysutils/xps/distinfo @@ -1,6 +1,8 @@ -$NetBSD: distinfo,v 1.6 2005/02/24 13:41:00 agc Exp $ +$NetBSD: distinfo,v 1.7 2006/06/21 20:41:27 joerg Exp $ SHA1 (xps-4.2.tar.gz) = 55c9176086e019a58d632580a31d70618235e149 RMD160 (xps-4.2.tar.gz) = c20594526f3870c049e2ee185533487c51bc1aed Size (xps-4.2.tar.gz) = 279690 bytes +SHA1 (patch-aa) = 6e1b162b46fa7a35d64a787c49abdfbc66cea431 +SHA1 (patch-ab) = 6a0b0aa8d34010da75573d3084fc4989af2c635c SHA1 (patch-ac) = 6a94bd17251f440c2af8302b0c842191420e4efc diff --git a/sysutils/xps/patches/patch-aa b/sysutils/xps/patches/patch-aa new file mode 100644 index 00000000000..14b456a0a41 --- /dev/null +++ b/sysutils/xps/patches/patch-aa @@ -0,0 +1,13 @@ +$NetBSD: patch-aa,v 1.7 2006/06/21 20:41:27 joerg Exp $ + +--- src/postconf.pl.orig 2006-06-21 19:55:33.000000000 +0000 ++++ src/postconf.pl +@@ -15,7 +15,7 @@ + print "Checking operating system and version...\n"; + #$TARGET=`./config.guess`; + $os=`uname -s`; chop $os; +-if ($os !~ /^AIX|^Linux|^SunOS|^NetBSD|^OpenBSD|^FreeBSD|^BSD/) { ++if ($os !~ /^AIX|^Linux|^SunOS|^NetBSD|^OpenBSD|^FreeBSD|^DragonFly|^BSD/) { + die "Sorry -- we only do AIX, Linux, Solaris, NetBSD, OpenBSD, FreeBSD or BSDI right now."; + } + $release=`uname -r`; chop $release; diff --git a/sysutils/xps/patches/patch-ab b/sysutils/xps/patches/patch-ab new file mode 100644 index 00000000000..6d2495f4627 --- /dev/null +++ b/sysutils/xps/patches/patch-ab @@ -0,0 +1,83 @@ +$NetBSD: patch-ab,v 1.3 2006/06/21 20:41:27 joerg Exp $ + +--- src/FreeBSD/os.c.orig 2006-06-21 20:12:56.000000000 +0000 ++++ src/FreeBSD/os.c +@@ -125,16 +125,27 @@ GetStatus(ProcInfo *p) + if (!active.allprocs) { + #ifdef HAVE_REGEX + if (active.match_regexp) { ++#if defined(__DragonFly__) ++ int regmatch = regexec(&active.re_pat, ++ IDtouser(proc->kp_eproc.e_ucred.cr_ruid), ++ (size_t) NULL, (regmatch_t *) NULL, ++ REG_NOTBOL|REG_NOTEOL); ++#else + int regmatch = regexec(&active.re_pat, + IDtouser(proc->kp_eproc.e_pcred.p_ruid), + (size_t) NULL, (regmatch_t *) NULL, + REG_NOTBOL|REG_NOTEOL); ++#endif + if (regmatch == REG_NOMATCH) { + return False; + } + } else { + #endif ++#if defined(__DragonFly__) ++ if (active.uid_displayed != proc->kp_eproc.e_ucred.cr_ruid) ++#else + if (active.uid_displayed != proc->kp_eproc.e_pcred.p_ruid) ++#endif + return False; + #ifdef HAVE_REGEX + } +@@ -166,8 +177,10 @@ GetStatus(ProcInfo *p) + + if (proc->kp_proc.p_pid == MyPid && !cmd_options.me_too) + pstat = SSLEEP; ++#if !defined(__DragonFly__) + else if ((proc->kp_proc.p_flag & P_INMEM) == 0) + pstat = SSWAP; ++#endif + else + pstat = proc->kp_proc.p_stat; + +@@ -179,7 +192,11 @@ void + GetProcName(ProcInfo *p, TREENODE *node) + { + ProcInfo proc = *p; ++#if defined(__DragonFly__) ++ node->uid = proc->kp_eproc.e_ucred.cr_ruid; ++#else + node->uid = proc->kp_eproc.e_pcred.p_ruid; ++#endif + + if (proc->kp_proc.p_stat == SZOMB) + strcpy(node->label, "*zombie*"); +@@ -196,9 +213,15 @@ GetProcName(ProcInfo *p, TREENODE *node) + + /* We've got a sleeping process. (Hopefully that's the majority of + the processes. Assign a color based on userid. */ ++#if defined(__DragonFly__) ++ node->color = GetUID_Color(proc->kp_eproc.e_ucred.cr_ruid); ++ ++ if ( (username=IDtouser(proc->kp_eproc.e_ucred.cr_ruid)) != NULL ) { ++#else + node->color = GetUID_Color(proc->kp_eproc.e_pcred.p_ruid); + + if ( (username=IDtouser(proc->kp_eproc.e_pcred.p_ruid)) != NULL ) { ++#endif + strcpy(node->label1, username); + } else { + strcpy(node->label1, UNKNOWN_USER); +@@ -209,7 +232,11 @@ GetProcName(ProcInfo *p, TREENODE *node) + #ifdef XPS_RECOLOR_LOGIN_PROCESSES + for (i=0;ilabel, label_array[i]) == 0) { ++#if defined(__DragonFly__) ++ strcpy(node->label, IDtouser(proc->kp_eproc.e_ucred.cr_ruid)); ++#else + strcpy(node->label, IDtouser(proc->kp_eproc.e_pcred.p_ruid)); ++#endif + strcpy(node->label1, label_array[i]); + node->color = base.xterm; + node->show_username = 1; -- cgit v1.2.3