re-import sources as agreed with the maintainer

This commit is contained in:
Adam Samalik 2023-07-10 10:10:37 +02:00
parent 6787007711
commit d430669f38
5 changed files with 129 additions and 1 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
SOURCES/evemu-2.7.0.tar.xz
/evemu-2.6.0.tar.xz
/evemu-2.7.0.tar.xz

View File

@ -0,0 +1,54 @@
From 095fc44e699b79ce28d30151e3768b933cf8e461 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@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@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@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

View File

@ -0,0 +1,56 @@
From b9052900ba09005754114684789497f04040811b Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@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@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@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

1
commitid Normal file
View File

@ -0,0 +1 @@
eba96a4d2be7260b5843e65c4b99c8b06a1f4c9d

17
make-git-snapshot.sh Normal file
View File

@ -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