Hello community,

here is the log from the commit of package fatrace for openSUSE:Factory checked 
in at 2019-04-17 10:08:03
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/fatrace (Old)
 and      /work/SRC/openSUSE:Factory/.fatrace.new.17052 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "fatrace"

Wed Apr 17 10:08:03 2019 rev:5 rq:694439 version:0.13

Changes:
--------
--- /work/SRC/openSUSE:Factory/fatrace/fatrace.changes  2015-01-30 
15:08:26.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.fatrace.new.17052/fatrace.changes       
2019-04-17 10:08:05.418760722 +0200
@@ -1,0 +2,11 @@
+Mon Apr  8 22:55:42 UTC 2019 - Christophe Giboudeaux <[email protected]>
+
+- Run spec-cleaner
+- Update to 0.13:
+  * Add --filter/-f option to only show selected event types.
+  * Add -C/--command option to only show events for a particular
+    command.
+  * Fix #include file for major() and minor() to avoid a warning
+    with recent glibc.
+
+-------------------------------------------------------------------

Old:
----
  fatrace-0.9.tar.bz2

New:
----
  fatrace-0.13.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ fatrace.spec ++++++
--- /var/tmp/diff_new_pack.odohLl/_old  2019-04-17 10:08:07.438763054 +0200
+++ /var/tmp/diff_new_pack.odohLl/_new  2019-04-17 10:08:07.438763054 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package fatrace
 #
-# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 # Copyright (c) 2013 Philipp Thomas <[email protected]>
 #
 # All modifications and additions to the file contributed by third parties
@@ -13,17 +13,18 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
+
 Name:           fatrace
-Version:        0.9
-Release:        1
+Version:        0.13
+Release:        0
 Summary:        Report system wide file access events
+License:        GPL-3.0-or-later
 Group:          System/Monitoring
-License:        GPL-3.0+
 URL:            https://launchpad.net/fatrace
-Source0:        
https://launchpad.net/fatrace/trunk/0.9/+download/%{name}-%{version}.tar.bz2
+Source:         
https://launchpad.net/fatrace/trunk/%{version}/+download/%{name}-%{version}.tar.bz2
 BuildRequires:  glibc-devel
 
 %description
@@ -48,23 +49,20 @@
 log into a file (stdout by default), and run it for a specified number of
 seconds. Optional time stamps and PID filters are also provided.
 
-
 %prep
 %setup -q
 
-
 %build
 make %{?_smp_mflags} CFLAGS="%{optflags}" PREFIX="%{_prefix}"
 
-
 %install
 make install DESTDIR=%{buildroot} CFLAGS="%{optflags}" PREFIX="%{_prefix}"
 
 %files
-%defattr(-, root, root)
-%doc NEWS COPYING
+%license COPYING
+%doc NEWS
 %{_sbindir}/%{name}
 %{_sbindir}/power-usage-report
-%{_mandir}/man1/%{name}.1*
+%{_mandir}/man1/%{name}.1%{?ext_man}
 
 %changelog

++++++ fatrace-0.9.tar.bz2 -> fatrace-0.13.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fatrace-0.9/Makefile new/fatrace-0.13/Makefile
--- old/fatrace-0.9/Makefile    2014-11-07 09:17:24.000000000 +0100
+++ new/fatrace-0.13/Makefile   2018-03-25 13:34:23.000000000 +0200
@@ -1,10 +1,11 @@
 VERSION=$(shell head -n1 NEWS | cut -f1 -d' ')
 
 CFLAGS ?= -O2 -g -Wall -Wextra -Werror
+CDEFS = -D_GNU_SOURCE
 PREFIX ?= /usr/local
 
 fatrace: fatrace.o
-       $(CC) $(LDFLAGS) -o $@ $<
+       $(CC) $(CDEFS) $(LDFLAGS) -o $@ $<
 
 clean:
        rm -f *.o fatrace
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fatrace-0.9/NEWS new/fatrace-0.13/NEWS
--- old/fatrace-0.9/NEWS        2014-11-07 09:17:24.000000000 +0100
+++ new/fatrace-0.13/NEWS       2018-03-25 13:34:23.000000000 +0200
@@ -1,3 +1,24 @@
+0.13 (2018-03-25)
+-----------------
+ - Fix #include file for major() and minor() to avoid a warning with recent
+   glibc.
+
+0.12 (2016-04-25)
+-----------------
+ - Fix crash introdued in 0.10 when using the -p option. Thanks Yuriy M.
+   Kaminski! (Debian #817247, LP: #1563919)
+
+0.11 (2015-11-08)
+-----------------
+ - Make compatible with musl libc. Thanks Christian Neukirchen!
+ - Add -C/--command option to only show events for a particular command. Thanks
+   Christian Neukirchen!
+
+0.10 (2015-04-29)
+-----------------
+ - Add --filter/-f option to only show selected event types. Thanks to Bryce
+   Nesbitt!
+
 0.9 (2014-11-07)
 ----------------
  - power-usage-report: Adjust parsing to also work for powertop 2.6.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fatrace-0.9/fatrace.1 new/fatrace-0.13/fatrace.1
--- old/fatrace-0.9/fatrace.1   2014-11-07 09:17:24.000000000 +0100
+++ new/fatrace-0.13/fatrace.1  2018-03-25 13:34:23.000000000 +0200
@@ -88,6 +88,22 @@
 Ignore events for this process ID. Can be specified multiple times.
 
 .TP
+.B \-f \fITYPES\fR, \fB\-\-filter=\fITYPES
+Show only the given event types.
+.B TYPES
+is a list of
+.BR C ", " R ", " O ", or " W
+with the above meanings.
+
+E. g. use
+.B \--filter=OC
+to only show open and close events.
+
+.TP
+.B \-C \fICOMMAND\fR, \fB\-\-command=\fICOMMAND
+Show only events for this command.
+
+.TP
 .B \-h \fR, \fB\-\-help
 Print help and exit.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fatrace-0.9/fatrace.c new/fatrace-0.13/fatrace.c
--- old/fatrace-0.9/fatrace.c   2014-11-07 09:17:24.000000000 +0100
+++ new/fatrace-0.13/fatrace.c  2018-03-25 13:34:23.000000000 +0200
@@ -21,6 +21,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdint.h>
 #include <unistd.h>
 #include <string.h>
 #include <fcntl.h>
@@ -34,6 +35,8 @@
 #include <sys/stat.h>
 #include <sys/fanotify.h>
 #include <sys/time.h>
+#include <sys/sysmacros.h>
+#include <ctype.h>
 
 #define BUFSIZE 256*1024
 
@@ -45,11 +48,13 @@
 
 /* command line options */
 static char* option_output = NULL;
+static long option_filter_mask = 0xffffffff;
 static long option_timeout = -1;
 static int option_current_mount = 0;
 static int option_timestamp = 0;
 static pid_t ignored_pids[1024];
 static unsigned int ignored_pids_len = 0;
+static char* option_comm = NULL;
 
 /* --time alarm sets this to 0 */
 static volatile int running = 1;
@@ -97,6 +102,9 @@
     static char pathname[PATH_MAX];
     struct stat st;
 
+    if ((data->mask & option_filter_mask) == 0)
+        return;
+
     /* read process name */
     snprintf (printbuf, sizeof (printbuf), "/proc/%i/comm", data->pid);
     len = 0;
@@ -115,6 +123,9 @@
     if (fd >= 0)
        close (fd);
 
+    if (option_comm && strcmp (option_comm, procname) != 0)
+        return;
+
     /* try to figure out the path name */
     snprintf (printbuf, sizeof (printbuf), "/proc/self/fd/%i", data->fd);
     len = readlink (printbuf, pathname, sizeof (pathname));
@@ -212,6 +223,8 @@
 "  -s SECONDS, --seconds=SECONDS\tStop after the given number of seconds.\n"
 "  -t, --timestamp\t\tAdd timestamp to events. Give twice for seconds since 
the epoch.\n"
 "  -p PID, --ignore-pid PID\tIgnore events for this process ID. Can be 
specified multiple times.\n"
+"  -f TYPES, --filter=TYPES\tShow only the given event types; choose from C, 
R, O, or W, e. g. --filter=OC.\n"
+"  -C COMM, --command=COMM\tShow only events for this command.\n"
 "  -h, --help\t\t\tShow help.");
 }
 
@@ -224,6 +237,7 @@
 parse_args (int argc, char** argv)
 {
     int c;
+    int j;
     long pid;
     char *endptr;
 
@@ -233,17 +247,23 @@
         {"seconds",       required_argument, 0, 's'},
         {"timestamp",     no_argument,       0, 't'},
         {"ignore-pid",    required_argument, 0, 'p'},
+        {"filter",        required_argument, 0, 'f'},
+        {"command",       required_argument, 0, 'C'},
         {"help",          no_argument,       0, 'h'},
         {0,               0,                 0,  0 }
     };
 
     while (1) {
-        c = getopt_long (argc, argv, "co:s:tp:h", long_options, NULL);
+        c = getopt_long (argc, argv, "C:co:s:tp:f:h", long_options, NULL);
 
         if (c == -1)
             break;
 
         switch (c) {
+            case 'C':
+                option_comm = strdup (optarg);
+                break;
+
             case 'c':
                 option_current_mount = 1;
                 break;
@@ -252,6 +272,33 @@
                 option_output = strdup (optarg);
                 break;
 
+            case 'f':
+                j = 0;
+                option_filter_mask = 0;
+                while (optarg[j] != '\0') {
+                    switch (toupper (optarg[j])) {
+                        case 'R':
+                            option_filter_mask |= FAN_ACCESS;
+                            break;
+                        case 'C':
+                            option_filter_mask |= FAN_CLOSE_WRITE;
+                            option_filter_mask |= FAN_CLOSE_NOWRITE;
+                            break;
+                        case 'W':
+                            option_filter_mask |= FAN_CLOSE_WRITE;
+                            option_filter_mask |= FAN_MODIFY;
+                            break;
+                        case 'O':
+                            option_filter_mask |= FAN_OPEN;
+                            break;
+                        default:
+                            fprintf (stderr, "Error: Unknown --filter type 
'%c'\n", optarg[j]);
+                            exit (1);
+                    }
+                    j++;
+                }
+                break;
+
             case 's':
                 option_timeout = strtol (optarg, &endptr, 10);
                 if (*endptr != '\0' || option_timeout <= 0) {


Reply via email to