I have made the following changes intended for :
  CE:UX:MTF / lsof

Please review and accept or decline.
BOSS has already run some checks on this request.
See the "Messages from BOSS" section below.

https://build.pub.meego.com//request/show/5343

Thank You,
Marko Saukko

[This message was auto-generated]

---

Request # 5343:

Messages from BOSS:

State: review at 2012-07-29T21:20:58 by bossbot

Reviews:
       accepted by bossbot : Prechecks succeeded.
       new for CE-maintainers : Please replace this text with a review and 
approve/reject the review (not the SR). BOSS will take care of the rest

Changes:
  submit: Project:MTF:UX / lsof -> CE:UX:MTF / lsof
  
changes files:
--------------
--- lsof.changes
+++ lsof.changes
@@ -0,0 +1,3 @@
+* Sun Jul 29 2012 Marko Saukko <[email protected]> - 4.86
+- Update to 4.86
+

old:
----
  lsof_4.81-threads.patch
  lsof_4.82-rh.tar.bz2

new:
----
  lsof-4.86-anoninodfs.patch
  lsof_4.86-rh.tar.bz2
  upstream2downstream.sh

spec files:
-----------
--- lsof.spec
+++ lsof.spec
@@ -1,26 +1,22 @@
-#
-# Please submit bugfixes or comments via http://bugs.meego.com/
-#
-
+Summary: A utility which lists open files on a Linux/UNIX system
 Name:           lsof
-Version:        4.82
+Version: 4.86
 Release:        1
 License:        zlib
-Summary:        A utility which lists open files on a Linux/UNIX system
 Group:          Development/Debuggers
 
-Url:            ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof
 # lsof contains licensed code that we cannot ship.  Therefore we use
 # upstream2downstream.sh script to remove the code before shipping it.
 #
-# The script you can found in CVS or download from:
-# http://cvs.fedoraproject.org/viewcvs/rpms/lsof/devel/upstream2downstream.sh
+# The script you can found in SCM or download from:
+# 
http://pkgs.fedoraproject.org/gitweb/?p=lsof.git;a=blob_plain;f=upstream2downstream.sh
 #
-%define lsofrh lsof_4.82-rh
+%define lsofrh lsof_%{version}-rh
 Source0:        %{lsofrh}.tar.bz2
+Source1: upstream2downstream.sh
+URL: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof
 
-# 184338 - allow lsof access nptl threads
-Patch1:         lsof_4.81-threads.patch
+Patch0: lsof-4.86-anoninodfs.patch
 
 %description
 Lsof stands for LiSt Open Files, and it does just that: it lists
@@ -29,25 +25,23 @@
 
 %prep
 %setup -q -n %{lsofrh}
-%patch1 -p1
+%patch0 -p1
 
 %build
 LSOF_VSTR=2.6.16 LINUX_BASE=/proc ./Configure -n linux
 
-make DEBUG="%{optflags}" %{?_smp_mflags}
+make DEBUG="$RPM_OPT_FLAGS" %{?_smp_mflags}
 
 %install
-mkdir -p %{buildroot}%{_sbindir}
-install -p -m 0755 lsof %{buildroot}%{_prefix}/sbin
-mkdir -p %{buildroot}%{_mandir}/man8
-install -p lsof.8 %{buildroot}%{_mandir}/man8/
-
-%clean
-rm -rf %{buildroot}
+rm -rf ${RPM_BUILD_ROOT}
+mkdir -p ${RPM_BUILD_ROOT}%{_sbindir}
+install -p -m 0755 lsof ${RPM_BUILD_ROOT}%{_prefix}/sbin
+mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man8
+install -p -m 0644 lsof.8 ${RPM_BUILD_ROOT}%{_mandir}/man8/
 
 %docs_package
 
 %files
-%defattr(644,root,root,755)
-%attr(0755,root,root) %{_sbindir}/lsof
+%defattr(-,root,root,-)
+%{_sbindir}/lsof
 

other changes:
--------------

++++++ lsof-4.86-anoninodfs.patch (new)
--- lsof-4.86-anoninodfs.patch
+++ lsof-4.86-anoninodfs.patch
@@ -0,0 +1,136 @@
+diff -X excludes -ruN lsof_4.86_src/dialects/linux/dnode.c 
_lsof_4.86_src/dialects/linux/dnode.c
+--- lsof_4.86_src/dialects/linux/dnode.c       2012-04-11 01:40:00.000000000 
+0900
++++ _lsof_4.86_src/dialects/linux/dnode.c      2012-06-04 13:19:05.290490391 
+0900
+@@ -401,6 +401,10 @@
+               /* Lf->ntype = Ntype = N_REGLR;         by alloc_lfile() */
+               process_proc_sock(p, s, ss, l, ls);
+               return;
++          case 0:
++              if (!strcmp(p, "anon_inode"))
++                  Lf->ntype = Ntype = N_ANON_INODE;
++              break;
+           }
+       }
+       if (Selinet)
+@@ -503,9 +507,13 @@
+               tn = "VTXT";
+               break;
+           default:
+-              (void) snpf(Lf->type, sizeof(Lf->type), "%04o",
+-                  ((type >> 12) & 0xf));
+-              tn = (char *)NULL;
++              if (Ntype == N_ANON_INODE) {
++                  tn = "a_inode";
++              } else {
++                  (void) snpf(Lf->type, sizeof(Lf->type), "%04o",
++                              ((type >> 12) & 0xf));
++                  tn = (char *)NULL;
++              }
+           }
+       } else
+           tn = "unknown";
+diff -X excludes -ruN lsof_4.86_src/dialects/linux/dproc.c 
_lsof_4.86_src/dialects/linux/dproc.c
+--- lsof_4.86_src/dialects/linux/dproc.c       2012-04-11 01:40:01.000000000 
+0900
++++ _lsof_4.86_src/dialects/linux/dproc.c      2012-06-04 13:29:44.684989913 
+0900
+@@ -81,7 +81,7 @@
+  */
+ 
+ _PROTOTYPE(static int get_fdinfo,(char *p, struct l_fdinfo *fi));
+-_PROTOTYPE(static int getlinksrc,(char *ln, char *src, int srcl));
++_PROTOTYPE(static int getlinksrc,(char *ln, char *src, int srcl, char** 
rest));
+ _PROTOTYPE(static int isefsys,(char *path, char *type, int l,
+                              efsys_list_t **rep, struct lfile **lfr));
+ _PROTOTYPE(static int nm2id,(char *nm, int *id, int *idl));
+@@ -440,14 +440,18 @@
+ 
+ 
+ static int
+-getlinksrc(ln, src, srcl)
++getlinksrc(ln, src, srcl, rest)
+       char *ln;                       /* link path */
+       char *src;                      /* link source path return address */
+       int srcl;                       /* length of src[] */
++      char **rest;                    /* string after `:' of link source path 
*/
+ {
+       char *cp;
+       int ll;
+ 
++      if (rest)
++          *rest = NULL;
++
+       if ((ll = readlink(ln, src, srcl - 1)) < 1
+       ||  ll >= srcl)
+           return(-1);
+@@ -457,6 +461,8 @@
+       if ((cp = strchr(src, ':'))) {
+           *cp = '\0';
+           ll = strlen(src);
++          if (rest)
++              *rest = cp + 1;
+       }
+       return(ll);
+ }
+@@ -795,6 +801,7 @@
+       static char *pathi = (char *)NULL;
+       static int pathil = 0;
+       int txts = 0;
++      char* rest;
+ 
+ #if   defined(HASSELINUX)
+       cntxlist_t *cntxp;
+@@ -825,7 +832,7 @@
+           (void) make_proc_path(idp, idpl, &path, &pathl, "cwd");
+           alloc_lfile(CWD, -1);
+           efs = 0;
+-          if (getlinksrc(path, pbuf, sizeof(pbuf)) < 1) {
++          if (getlinksrc(path, pbuf, sizeof(pbuf), NULL) < 1) {
+               if (!Fwarn) {
+                   (void) memset((void *)&sb, 0, sizeof(sb));
+                   lnk = ss = 0;
+@@ -873,7 +880,7 @@
+       if (!Ckscko) {
+           (void) make_proc_path(idp, idpl, &path, &pathl, "root");
+           alloc_lfile(RTD, -1);
+-          if (getlinksrc(path, pbuf, sizeof(pbuf)) < 1) {
++          if (getlinksrc(path, pbuf, sizeof(pbuf), NULL) < 1) {
+               if (!Fwarn) {
+                   (void) memset((void *)&sb, 0, sizeof(sb));
+                   lnk = ss = 0;
+@@ -921,7 +928,7 @@
+           txts = 0;
+           (void) make_proc_path(idp, idpl, &path, &pathl, "exe");
+           alloc_lfile("txt", -1);
+-          if (getlinksrc(path, pbuf, sizeof(pbuf)) < 1) {
++          if (getlinksrc(path, pbuf, sizeof(pbuf), NULL) < 1) {
+               (void) memset((void *)&sb, 0, sizeof(sb));
+               lnk = ss = 0;
+               if (!Fwarn) {
+@@ -1044,7 +1051,7 @@
+               continue;
+           (void) make_proc_path(dpath, i, &path, &pathl, fp->d_name);
+           (void) alloc_lfile((char *)NULL, fd);
+-          if (getlinksrc(path, pbuf, sizeof(pbuf)) < 1) {
++          if (getlinksrc(path, pbuf, sizeof(pbuf), &rest) < 1) {
+               (void) memset((void *)&sb, 0, sizeof(sb));
+               lnk = ss = 0;
+               if (!Fwarn) {
+@@ -1137,6 +1144,8 @@
+               }
+               if (pn) {
+                   process_proc_node(lnk ? pbuf : path, &sb, ss, &lsb, ls);
++                  if (Lf->ntype == N_ANON_INODE)
++                      enter_nm(rest);
+                   if (Lf->sf)
+                       link_lfile();
+               }
+diff -X excludes -ruN lsof_4.86_src/lsof.h _lsof_4.86_src/lsof.h
+--- lsof_4.86_src/lsof.h       2011-09-08 04:14:10.000000000 +0900
++++ _lsof_4.86_src/lsof.h      2012-06-04 13:27:40.190724414 +0900
+@@ -349,6 +349,7 @@
+ #define       N_VXFS          51              /* Veritas file system node */
+ #define       N_XFS           52              /* XFS node */
+ #define       N_ZFS           53              /* ZFS node */
++#define N_ANON_INODE  54              /* inode on linux anon_inodefs */
+ 
+ # if  !defined(OFFDECDIG)
+ #define       OFFDECDIG       8               /* maximum number of digits in 
the

++++++ lsof_4.86-rh.tar.bz2 (new)

++++++ upstream2downstream.sh (new)
--- upstream2downstream.sh
+++ upstream2downstream.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+#
+# This script removes non-linux dialects from upstream source package before
+# release.  There is a problem with copyrights for some UN*Xes ... also .. this
+# script merges all to the one normal tarball and rename all to lsof_X.XX-rh.
+#
+# Usage:  ./upstream2downstream  <usptream-tarball>
+# 
+# This code is in the public domain; do with it what you wish.
+#
+# Copyright (C) 2007 Karel Zak <[email protected]>
+#
+
+UPSTREAM="$1"
+NAME=$(basename $UPSTREAM .tar.bz2)
+MYPWD=$(pwd)
+TMP=$(mktemp -d)
+
+echo
+echo -n "Extracting upstream code..."
+tar -jxf $UPSTREAM  -C $TMP
+cd $TMP/$NAME
+tar xf "$NAME"_src.tar
+echo " done."
+
+echo -n "Moving files to downstream directory..."
+mv "$NAME"_src/ "$NAME"-rh
+mv README* 00* "$NAME"-rh
+echo " done."
+
+echo -n "Removing non-Linux dialects..."
+rm -rf "$NAME"-rh/dialects/{aix,darwin,du,freebsd,hpux,n+obsd,n+os,osr,sun,uw}
+echo " done."
+
+echo -n "Creating final downstream tarball..."
+tar jcf $MYPWD/"$NAME"-rh.tar.bz2 "$NAME"-rh
+echo " done."
+
+rm -rf $TMP
+cd $MYPWD
+
+echo
+echo "Linux-only tarball: $MYPWD/"$NAME"-rh.tar.bz2"
+echo
+

++++++ deleted files:
--- lsof_4.81-threads.patch
--- lsof_4.82-rh.tar.bz2



Reply via email to