pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/sysutils/lsof - Don't hardcode the MFSNAMELEN length, ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5ebf00f07cd8
branches:  trunk
changeset: 532239:5ebf00f07cd8
user:      veego <veego%pkgsrc.org@localhost>
date:      Tue Aug 14 19:59:17 2007 +0000

description:
- Don't hardcode the MFSNAMELEN length, inspired by commits from
  Christos (patch-ae and patch-af). Fix PR 36680
- Define NETBSD_SYS in the pkgsrc Makefile so it works if NETBSDSRCDIR is
  not pointing to a default location and thus some featues, like ptyfs
  support were disabled
- Update the line numbers in patch-aa
- Add tmpfs support (patch-ad, patch-af and patch-ag)
- Update the NetBSD versions in Configure otherwise NETBSDV would fall
  back to 1006000 and so at least one feature was not found, the PFSfd
  procfs support (patch-ag)
- Bump pkg revision for new features (normaly I wouldn't have bumped the
  version if it were only to fix a -current compile, because the version
  also includes the kernel version)

diffstat:

 sysutils/lsof/Makefile         |    4 +-
 sysutils/lsof/distinfo         |   11 ++-
 sysutils/lsof/patches/patch-aa |   10 +-
 sysutils/lsof/patches/patch-ad |   79 +++++++++++++++++++++++++++++--
 sysutils/lsof/patches/patch-ae |   19 ++++++-
 sysutils/lsof/patches/patch-af |   29 ++++++++++-
 sysutils/lsof/patches/patch-ag |  103 +++++++++++++++++++++++++++++++++++++++++
 7 files changed, 232 insertions(+), 23 deletions(-)

diffs (truncated from 364 to 300 lines):

diff -r 49db2a4de7f9 -r 5ebf00f07cd8 sysutils/lsof/Makefile
--- a/sysutils/lsof/Makefile    Tue Aug 14 19:22:31 2007 +0000
+++ b/sysutils/lsof/Makefile    Tue Aug 14 19:59:17 2007 +0000
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.92 2007/05/06 21:41:30 christos Exp $
+# $NetBSD: Makefile,v 1.93 2007/08/14 19:59:17 veego Exp $
 #
 
 DISTNAME=              lsof_4.78
 PKGNAME=               ${DISTNAME:S/_/-/}.${OS_VERSION}
+PKGREVISION=           1
 CATEGORIES=            sysutils
 MASTER_SITES=          ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  \
                        ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/NEW/ \
@@ -34,6 +35,7 @@
 
 .if ${OPSYS} == "NetBSD"
 REAL_GROUP=            -g kmem
+CONFIGURE_ENV+=                NETBSD_SYS="${NETBSDSRCDIR}/sys"
 .elif ${OPSYS} == "SunOS"
 MAKE_ENV+=             CPPFLAGS=
 .endif
diff -r 49db2a4de7f9 -r 5ebf00f07cd8 sysutils/lsof/distinfo
--- a/sysutils/lsof/distinfo    Tue Aug 14 19:22:31 2007 +0000
+++ b/sysutils/lsof/distinfo    Tue Aug 14 19:59:17 2007 +0000
@@ -1,10 +1,11 @@
-$NetBSD: distinfo,v 1.68 2007/08/12 15:00:34 seb Exp $
+$NetBSD: distinfo,v 1.69 2007/08/14 19:59:18 veego Exp $
 
 SHA1 (lsof_4.78.tar.bz2) = 0379fc9f38a931ce19e8386e662314d96fc2a099
 RMD160 (lsof_4.78.tar.bz2) = 50d71e500f1109cda717b73ce209c0e100a6dbe9
 Size (lsof_4.78.tar.bz2) = 756729 bytes
-SHA1 (patch-aa) = 332eb1ac95d86023dde66d1b99b9335c8f54b81f
+SHA1 (patch-aa) = 051015025297ab131c30ceb62e926750c365d14a
 SHA1 (patch-ab) = 1501d8b0e6fd2c61949ba0d447c7b726655725c4
-SHA1 (patch-ad) = bbdd2c4c997233f7743a0c99ffcc6ce29679a8a9
-SHA1 (patch-ae) = ba3804e89101fb504edd33983f35904559a63dbf
-SHA1 (patch-af) = 0ceeb8e4a704d89aba5b9271d17afe038d877e8f
+SHA1 (patch-ad) = ac9ade0dce7299704d60daa15fb95a436938f456
+SHA1 (patch-ae) = 1d8c1c3baf9575631c23d3ced7b12fab1df95cd6
+SHA1 (patch-af) = 7110b279ca99bd399d1654683b6fc8367d2fee8d
+SHA1 (patch-ag) = b992cc4a80563f143e72fe3f27557a460af38121
diff -r 49db2a4de7f9 -r 5ebf00f07cd8 sysutils/lsof/patches/patch-aa
--- a/sysutils/lsof/patches/patch-aa    Tue Aug 14 19:22:31 2007 +0000
+++ b/sysutils/lsof/patches/patch-aa    Tue Aug 14 19:59:17 2007 +0000
@@ -1,13 +1,13 @@
-$NetBSD: patch-aa,v 1.25 2005/01/17 14:54:01 atatat Exp $
+$NetBSD: patch-aa,v 1.26 2007/08/14 19:59:18 veego Exp $
 
 If LSOF_MORE_SECURE is non-zero, compile lsof with security, and
 only let unprivileged (non-root) users view their own open files.
 Set LSOF_LESS_SECURE_SOCKETS to non-zero in order to allow non-root
 users to see open sockets, even when LSOF_MORE_SECURE is set.
 
---- dialects/n+obsd/machine.h.orig     2004-10-17 17:55:27.000000000 -0400
-+++ dialects/n+obsd/machine.h
-@@ -383,7 +383,9 @@
+--- dialects/n+obsd/machine.h.orig     2006-03-28 23:54:17.000000000 +0200
++++ dialects/n+obsd/machine.h  2007-08-11 18:01:56.000000000 +0200
+@@ -410,7 +410,9 @@
   * (the one that its user logged on with) of the lsof process.
   */
  
@@ -18,7 +18,7 @@
  
  
  /*
-@@ -392,7 +394,9 @@
+@@ -419,7 +421,9 @@
   * listing is selected by the "-i" option.
   */
  
diff -r 49db2a4de7f9 -r 5ebf00f07cd8 sysutils/lsof/patches/patch-ad
--- a/sysutils/lsof/patches/patch-ad    Tue Aug 14 19:22:31 2007 +0000
+++ b/sysutils/lsof/patches/patch-ad    Tue Aug 14 19:59:17 2007 +0000
@@ -1,7 +1,7 @@
-$NetBSD: patch-ad,v 1.12 2007/05/06 21:41:30 christos Exp $
+$NetBSD: patch-ad,v 1.13 2007/08/14 19:59:18 veego Exp $
 
---- dialects/n+obsd/dnode.c.orig       2007-04-24 12:22:06.000000000 -0400
-+++ dialects/n+obsd/dnode.c    2007-05-06 16:43:51.000000000 -0400
+--- dialects/n+obsd/dnode.c.orig       2007-04-24 18:22:06.000000000 +0200
++++ dialects/n+obsd/dnode.c    2007-08-11 19:46:43.000000000 +0200
 @@ -38,6 +38,9 @@
  
  #include "lsof.h"
@@ -12,7 +12,7 @@
  
  #if   defined(HAS_DINODE_U)
  #define       DINODE_U        dinode_u
-@@ -194,7 +197,9 @@
+@@ -194,12 +197,17 @@
        unsigned char ns;
        unsigned char rdevs;
        char *ep, *ty;
@@ -21,8 +21,37 @@
 +#endif
        struct inode i;
        struct mfsnode m;
++#if   defined(HASTMPFS)
++      struct tmpfs_node tmp;
++#endif        /* defined(HASTMPFS) */
        struct nfsnode n;
-@@ -619,6 +624,7 @@
+       enum nodetype {NONODE, CDFSNODE, DOSNODE, EXT2NODE, FDESCNODE, INODE,
+-              KERNFSNODE, MFSNODE, NFSNODE, PFSNODE, PTYFSNODE} nty;
++              KERNFSNODE, MFSNODE, NFSNODE, PFSNODE, PTYFSNODE, TMPFSNODE} nty;
+       enum vtype type;
+       struct vnode *v, vb;
+       struct l_vfs *vfs;
+@@ -471,6 +479,19 @@
+           nty = MFSNODE;
+           break;
+ 
++#if   defined(HASTMPFS)
++      case VT_TMPFS:
++          if (!v->v_data
++          ||  kread((KA_T)v->v_data, (char *)&tmp, sizeof(tmp))) {
++              (void) snpf(Namech, Namechl, "can't read tmpfs_node at: %s",
++                  print_kptr((KA_T)v->v_data, (char *)NULL, 0));
++              enter_nm(Namech);
++              return;
++          }
++          nty = TMPFSNODE;
++          break;
++#endif        /* defined(HASTMPFS) */
++
+ #if   defined(HASMSDOSFS)
+       case VT_MSDOSFS:
+           if (!v->v_data
+@@ -619,6 +640,7 @@
  
            }
  
@@ -30,7 +59,7 @@
            if ((lff = i.i_lockf)) {
  
            /*
-@@ -667,6 +673,7 @@
+@@ -667,6 +689,7 @@
                    break;
                } while ((lfp = lf.lf_next) && lfp != lff);
            }
@@ -38,3 +67,41 @@
            break;
        default:
            if (v->v_type == VBAD || v->v_type == VNON)
+@@ -900,6 +923,13 @@
+           break;
+ #endif        /* defined(HASPTYFS) */
+ 
++#if   defined(HASTMPFS)
++      case TMPFSNODE:
++          Lf->inode = (INODETYPE)tmp.tn_id;
++          Lf->inp_ty = 1;
++          break;
++#endif        /* defined(HASTMPFS) */
++
+       }
+ 
+ /*
+@@ -1019,6 +1049,13 @@
+                       Lf->sz_def = 1;
+                       break;
+ 
++#if   defined(HASTMPFS)
++                  case TMPFSNODE:
++                      Lf->sz = (SZOFFTYPE)tmp.tn_size;
++                      Lf->sz_def = 1;
++                      break;
++#endif        /* defined(HASTMPFS) */
++
+ #if   defined(HASEXT2FS)
+                   case EXT2NODE:
+ # if  defined(HASI_E2FS_PTR)
+@@ -1221,6 +1258,9 @@
+           Lf->dev_def = Lf->rdev_def = 0;
+           (void) snpf(Namech, Namechl, "%#x", m.mfs_baseoff);
+           enter_dev_ch("memory");
++      } else if (nty == TMPFSNODE) {
++          Lf->dev_def = Lf->rdev_def = 0;
++          enter_dev_ch("memory");
+       }
+ 
+ #if   defined(HASPROCFS)
diff -r 49db2a4de7f9 -r 5ebf00f07cd8 sysutils/lsof/patches/patch-ae
--- a/sysutils/lsof/patches/patch-ae    Tue Aug 14 19:22:31 2007 +0000
+++ b/sysutils/lsof/patches/patch-ae    Tue Aug 14 19:59:17 2007 +0000
@@ -1,7 +1,7 @@
-$NetBSD: patch-ae,v 1.10 2006/08/01 12:29:59 tron Exp $
+$NetBSD: patch-ae,v 1.11 2007/08/14 19:59:18 veego Exp $
 
---- dialects/n+obsd/dmnt.c.orig        2005-08-08 20:53:31.000000000 +0100
-+++ dialects/n+obsd/dmnt.c     2006-08-01 13:25:57.000000000 +0100
+--- dialects/n+obsd/dmnt.c.orig        2005-08-08 21:53:31.000000000 +0200
++++ dialects/n+obsd/dmnt.c     2007-08-11 14:43:05.000000000 +0200
 @@ -45,6 +45,15 @@
  #include <sys/statvfs.h>
  #endif  /* defined(NETBSDV) && defined(HASSTATVFS) */
@@ -18,3 +18,16 @@
  #include "lsof.h"
  
  
+@@ -94,7 +103,12 @@
+       for (; n; n--, mb++) {
+           if (mb->f_fstypename[0] == '\0')
+               continue;
++#if defined(NETBSDV) && __NetBSD_Version__ >= 499002500
++          /* MFSNAMELEN was removed from the kernel source after 4.99.24 */
++          mb->f_fstypename[sizeof(mb->f_fstypename) - 1] = '\0';
++#else
+           mb->f_fstypename[MFSNAMELEN - 1] = '\0';
++#endif
+       /*
+        * Interpolate a possible symbolic directory link.
+        */
diff -r 49db2a4de7f9 -r 5ebf00f07cd8 sysutils/lsof/patches/patch-af
--- a/sysutils/lsof/patches/patch-af    Tue Aug 14 19:22:31 2007 +0000
+++ b/sysutils/lsof/patches/patch-af    Tue Aug 14 19:59:17 2007 +0000
@@ -1,7 +1,7 @@
-$NetBSD: patch-af,v 1.9 2007/08/12 15:00:34 seb Exp $
+$NetBSD: patch-af,v 1.10 2007/08/14 19:59:18 veego Exp $
 
---- dialects/n+obsd/dlsof.h.orig       2006-03-28 16:54:15.000000000 -0500
-+++ dialects/n+obsd/dlsof.h    2007-05-06 17:37:00.000000000 -0400
+--- dialects/n+obsd/dlsof.h.orig       2006-03-28 23:54:15.000000000 +0200
++++ dialects/n+obsd/dlsof.h    2007-08-11 18:16:59.000000000 +0200
 @@ -161,6 +161,7 @@
  #include <sys/socketvar.h>
  #include <sys/un.h>
@@ -18,3 +18,26 @@
  #include <netinet/in_pcb.h>
  #include <netinet/ip_var.h>
  #include <netinet/tcp.h>
+@@ -264,6 +264,9 @@
+ 
+ #undef KERNEL
+ #include <ufs/mfs/mfsnode.h>
++# if  defined(HASTMPFS)
++#include <fs/tmpfs/tmpfs.h>
++# endif       /* defined(HASTMPFS) */
+ 
+ # if  defined(HASNFSPROTO)
+ #include <nfs/rpcv2.h>
+@@ -489,7 +492,12 @@
+ struct l_vfs {
+       KA_T addr;                      /* kernel address */
+       fsid_t  fsid;                   /* file system ID */
++#if defined(NETBSDV) && __NetBSD_Version__ >= 499002500
++      /* MFSNAMELEN was removed from the kernel source after 4.99.24 */
++      char type[sizeof(((struct statvfs *)NULL)->f_fstypename)];      /* type of file system */
++#else
+       char type[MFSNAMELEN];          /* type of file system */
++#endif
+       char *dir;                      /* mounted directory */
+       char *fsname;                   /* file system name */
+       struct l_vfs *next;             /* forward link */
diff -r 49db2a4de7f9 -r 5ebf00f07cd8 sysutils/lsof/patches/patch-ag
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/lsof/patches/patch-ag    Tue Aug 14 19:59:17 2007 +0000
@@ -0,0 +1,103 @@
+$NetBSD: patch-ag,v 1.3 2007/08/14 19:59:18 veego Exp $
+
+--- Configure.orig     2007-04-24 21:00:22.000000000 +0200
++++ Configure  2007-08-11 18:00:38.000000000 +0200
+@@ -86,6 +86,7 @@
+ #     $LSOF_LOCALSUFFIX   local suffix for Makefile
+ #     $LSOF_NBSD_BUFQH    NetBSD <sys/bufq.h> copy status
+ #     $LSOF_NBSD_PTYFS    NetBSD ${NETBSD_SYS}/sys/fs/ptyfs/ copy status
++#     $LSOF_NBSD_TMPFS    NetBSD ${NETBSD_SYS}/sys/fs/tmpfs/ copy status
+ #     $LSOF_N_UNIXV       *BSD system's kernel file
+ #     $LSOF_PL            patch level
+ #     $LSOF_RANLIB        randomizing command for the lsof library
+@@ -2447,6 +2448,19 @@
+       echo "!!!WARNING!!!  Unsupported NetBSD version: $LSOF_VSTR"
+       echo "!!!WARNING!!!  Configuring for NetBSD 3.0"
+       ;;
++      4.0*)
++      LSOF_TSTBIGF=" "
++      LSOF_VERS="4000000"
++      ;;
++      4.99.*)
++      LSOF_TSTBIGF=" "
++      LSOF_VERS="4099000"
++      ;;
++      4*)
++      LSOF_VERS="4000000"
++      echo "!!!WARNING!!!  Unsupported NetBSD version: $LSOF_VSTR"
++      echo "!!!WARNING!!!  Configuring for NetBSD 4.0"
++      ;;
+       *)
+       echo "Unknown NetBSD release: $LSOF_VSTR"
+       echo Assuming NetBSD 1.6
+@@ -2464,6 +2478,8 @@
+       ;;
+     3000000|3099000)
+       ;;
++    4000000|4099000)
++      ;;
+     *)



Home | Main Index | Thread Index | Old Index