bentiss pushed to evemu (f22). "Apply 2 upstream patches: handle holes in the input node list, (..more)"

notifications at fedoraproject.org notifications at fedoraproject.org
Thu Jun 11 18:25:18 UTC 2015


From ad376fa18f9f65b8aef02282a7fa46a16e62cac1 Mon Sep 17 00:00:00 2001
From: Benjamin Tissoires <benjamin.tissoires at redhat.com>
Date: Thu, 11 Jun 2015 13:22:37 -0400
Subject: Apply 2 upstream patches: handle holes in the input node list,

  add uname to the header comment

diff --git a/0001-tools-handle-holes-in-the-event-node-lists.patch b/0001-tools-handle-holes-in-the-event-node-lists.patch
new file mode 100644
index 0000000..e11122a
--- /dev/null
+++ b/0001-tools-handle-holes-in-the-event-node-lists.patch
@@ -0,0 +1,54 @@
+From 095fc44e699b79ce28d30151e3768b933cf8e461 Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer at who-t.net>
+Date: Wed, 28 Jan 2015 10:02:17 +1000
+Subject: [PATCH evemu 1/2] tools: handle holes in the event node lists
+
+The current code simply counts the number of directory entries and takes that
+as the maximum event node given. That isn't true if we have a hole in the
+event range after removing a device, making the last device in the list
+unaccessible.
+
+Fix this by actually looking at the event node numbers.
+
+Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
+Signed-off-by: Benjamin Tissoires <benjamin.tissoires at gmail.com>
+---
+ tools/find_event_devices.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tools/find_event_devices.c b/tools/find_event_devices.c
+index fd975aa..1f7539a 100644
+--- a/tools/find_event_devices.c
++++ b/tools/find_event_devices.c
+@@ -46,6 +46,7 @@ char* find_event_devices(void)
+ 	struct dirent **namelist;
+ 	int i, ndev, devnum;
+ 	char *filename;
++	int max_device = 0;
+ 
+ 	ndev = scandir(DEV_INPUT_EVENT, &namelist, is_event_device, versionsort);
+ 	if (ndev <= 0)
+@@ -68,13 +69,18 @@ char* find_event_devices(void)
+ 
+ 		fprintf(stderr, "%s:	%s\n", fname, name);
+ 		close(fd);
++
++		sscanf(namelist[i]->d_name, "event%d", &devnum);
++		if (devnum > max_device)
++			max_device = devnum;
++
+ 		free(namelist[i]);
+ 	}
+ 
+-	fprintf(stderr, "Select the device event number [0-%d]: ", ndev - 1);
++	fprintf(stderr, "Select the device event number [0-%d]: ", max_device);
+ 	scanf("%d", &devnum);
+ 
+-	if (devnum >= ndev || devnum < 0)
++	if (devnum > max_device || devnum < 0)
+ 		return NULL;
+ 
+ 	asprintf(&filename, "%s/%s%d",
+-- 
+2.4.2
+
diff --git a/0002-Print-uname-in-the-header-comments.patch b/0002-Print-uname-in-the-header-comments.patch
new file mode 100644
index 0000000..98878b4
--- /dev/null
+++ b/0002-Print-uname-in-the-header-comments.patch
@@ -0,0 +1,56 @@
+From b9052900ba09005754114684789497f04040811b Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer at who-t.net>
+Date: Thu, 11 Jun 2015 11:14:17 +1000
+Subject: [PATCH evemu 2/2] Print uname in the header comments
+
+Knowing what approximate kernel version this was recorded against help
+identify a few bugs before we spend too much time trying to reproduce it on
+other kernels.
+
+Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
+Signed-off-by: Benjamin Tissoires <benjamin.tissoires at gmail.com>
+---
+ src/evemu.c | 16 +++++++++++++++-
+ 1 file changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/src/evemu.c b/src/evemu.c
+index b98d340..b800998 100644
+--- a/src/evemu.c
++++ b/src/evemu.c
+@@ -52,6 +52,7 @@
+ #include <poll.h>
+ #include <ctype.h>
+ #include <unistd.h>
++#include <sys/utsname.h>
+ 
+ #include "version.h"
+ 
+@@ -343,11 +344,24 @@ static void write_desc(const struct evemu_device *dev, FILE *fp)
+ #endif
+ }
+ 
++static void
++write_header(FILE *fp)
++{
++	struct utsname u;
++
++	fprintf(fp, "# EVEMU %d.%d\n", EVEMU_FILE_MAJOR, EVEMU_FILE_MINOR);
++
++	if (uname(&u) == -1)
++		return;
++
++	fprintf(fp, "# Kernel: %s\n", u.release);
++}
++
+ int evemu_write(const struct evemu_device *dev, FILE *fp)
+ {
+ 	int i;
+ 
+-	fprintf(fp, "# EVEMU %d.%d\n", EVEMU_FILE_MAJOR, EVEMU_FILE_MINOR);
++	write_header(fp);
+ 
+ 	write_desc(dev, fp);
+ 
+-- 
+2.4.2
+
diff --git a/evemu.spec b/evemu.spec
index 310d169..e0be783 100644
--- a/evemu.spec
+++ b/evemu.spec
@@ -3,7 +3,7 @@
 
 Name:           evemu
 Version:        2.1.0
-Release:        1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
+Release:        2%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
 Summary:        Event Device Query and Emulation Program
 
 Group:          Development/Tools
@@ -18,6 +18,9 @@ Source2:        commitid
 Source0:        http://www.freedesktop.org/software/%{name}/%{name}-%{version}.tar.xz
 %endif
 
+Patch0:         0001-tools-handle-holes-in-the-event-node-lists.patch
+Patch1:         0002-Print-uname-in-the-header-comments.patch
+
 BuildRequires:  automake libtool
 BuildRequires:  python2-devel
 BuildRequires:  xmlto asciidoc
@@ -47,6 +50,9 @@ Obsoletes:      utouch-evemu-devel < 1.0.10
 %prep
 %setup -q -n %{name}-%{?gitdate:%{gitdate}}%{!?gitdate:%{version}}
 
+%patch0 -p1
+%patch1 -p1
+
 %build
 autoreconf -v --install --force || exit 1
 %configure --disable-static --disable-silent-rules
@@ -80,6 +86,10 @@ rm -f %{buildroot}%{_libdir}/*.la
 %{python_sitelib}/evemu/*
 
 %changelog
+* Thu Jun 11 2015 Benjamin Tissoires <benjamin.tissoires at redhat.com> 2.1.0-2
+- Apply 2 upstream patches: handle holes in the input node list,
+  add uname to the header comment
+
 * Wed Nov 12 2014 Peter Hutterer <peter.hutterer at redhat.com> 2.1.0-1
 - Update to version 2.1.0
 
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/evemu.git/commit/?h=f22&id=ad376fa18f9f65b8aef02282a7fa46a16e62cac1


More information about the scm-commits mailing list