From d430669f3899651fe2ca1817c4a8cb11d2b34517 Mon Sep 17 00:00:00 2001 From: Adam Samalik Date: Mon, 10 Jul 2023 10:10:37 +0200 Subject: [PATCH] re-import sources as agreed with the maintainer --- .gitignore | 2 +- ...handle-holes-in-the-event-node-lists.patch | 54 ++++++++++++++++++ 0002-Print-uname-in-the-header-comments.patch | 56 +++++++++++++++++++ commitid | 1 + make-git-snapshot.sh | 17 ++++++ 5 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 0001-tools-handle-holes-in-the-event-node-lists.patch create mode 100644 0002-Print-uname-in-the-header-comments.patch create mode 100644 commitid create mode 100644 make-git-snapshot.sh diff --git a/.gitignore b/.gitignore index 82eb8fa..9acc204 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -SOURCES/evemu-2.7.0.tar.xz +/evemu-2.6.0.tar.xz /evemu-2.7.0.tar.xz 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 +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 +Signed-off-by: Benjamin Tissoires +--- + 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 +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 +Signed-off-by: Benjamin Tissoires +--- + 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 + #include + #include ++#include + + #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/commitid b/commitid new file mode 100644 index 0000000..0fc746e --- /dev/null +++ b/commitid @@ -0,0 +1 @@ +eba96a4d2be7260b5843e65c4b99c8b06a1f4c9d diff --git a/make-git-snapshot.sh b/make-git-snapshot.sh new file mode 100644 index 0000000..2e375bf --- /dev/null +++ b/make-git-snapshot.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +DIRNAME=evemu-$( date +%Y%m%d ) + +rm -rf $DIRNAME +git clone git://git.freedesktop.org/git/evemu $DIRNAME +cd $DIRNAME +if [ -z "$1" ]; then + git log | head -1 +else + git checkout $1 +fi +git log | head -1 | awk '{ print $2 }' > ../commitid +git repack -a -d +cd .. +tar jcf $DIRNAME.tar.bz2 $DIRNAME +rm -rf $DIRNAME