libinput 1.15.4
This commit is contained in:
parent
c525038f71
commit
3a6c0aec2b
@ -1,97 +0,0 @@
|
|||||||
From 850925910f7f6db16f0aa645892d9121760de7b2 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Peter Hutterer <peter.hutterer@who-t.net>
|
|
||||||
Date: Mon, 9 Mar 2020 10:16:04 +1000
|
|
||||||
Subject: [PATCH libinput] tools: record: fix dmi recording
|
|
||||||
|
|
||||||
Processing os-release in the same buffer that the dmi modalias used caused the
|
|
||||||
dmi to be recorded as 'dmi: "VERSION_ID=31"'. The cause for that was simply
|
|
||||||
that the dmi modalias was read but not printed until after the os-release
|
|
||||||
information was processed.
|
|
||||||
|
|
||||||
Fix this two-fold: rearrange that each part now reads and prints in
|
|
||||||
one go, and rename the buffers so we don't re-use them.
|
|
||||||
|
|
||||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
||||||
---
|
|
||||||
tools/libinput-record.c | 46 ++++++++++++++++++++++-------------------
|
|
||||||
1 file changed, 25 insertions(+), 21 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/tools/libinput-record.c b/tools/libinput-record.c
|
|
||||||
index 0b10d8bf..6d45efc5 100644
|
|
||||||
--- a/tools/libinput-record.c
|
|
||||||
+++ b/tools/libinput-record.c
|
|
||||||
@@ -1430,37 +1430,26 @@ print_system_header(struct record_context *ctx)
|
|
||||||
struct utsname u;
|
|
||||||
const char *kernel = "unknown";
|
|
||||||
FILE *dmi, *osrelease;
|
|
||||||
- char buf[2048] = "unknown";
|
|
||||||
-
|
|
||||||
- if (uname(&u) != -1)
|
|
||||||
- kernel = u.release;
|
|
||||||
-
|
|
||||||
- dmi = fopen("/sys/class/dmi/id/modalias", "r");
|
|
||||||
- if (dmi) {
|
|
||||||
- if (fgets(buf, sizeof(buf), dmi)) {
|
|
||||||
- buf[strlen(buf) - 1] = '\0'; /* linebreak */
|
|
||||||
- } else {
|
|
||||||
- sprintf(buf, "unknown");
|
|
||||||
- }
|
|
||||||
- fclose(dmi);
|
|
||||||
- }
|
|
||||||
+ char dmistr[2048] = "unknown";
|
|
||||||
|
|
||||||
iprintf(ctx, "system:\n");
|
|
||||||
indent_push(ctx);
|
|
||||||
|
|
||||||
+ /* /etc/os-release version and distribution name */
|
|
||||||
osrelease = fopen("/etc/os-release", "r");
|
|
||||||
if (!osrelease)
|
|
||||||
osrelease = fopen("/usr/lib/os-release", "r");
|
|
||||||
if (osrelease) {
|
|
||||||
char *distro = NULL, *version = NULL;
|
|
||||||
+ char osrstr[256] = "unknown";
|
|
||||||
|
|
||||||
- while (fgets(buf, sizeof(buf), osrelease)) {
|
|
||||||
- buf[strlen(buf) - 1] = '\0'; /* linebreak */
|
|
||||||
+ while (fgets(osrstr, sizeof(osrstr), osrelease)) {
|
|
||||||
+ osrstr[strlen(osrstr) - 1] = '\0'; /* linebreak */
|
|
||||||
|
|
||||||
- if (!distro && strneq(buf, "ID=", 3))
|
|
||||||
- distro = safe_strdup(&buf[3]);
|
|
||||||
- else if (!version && strneq(buf, "VERSION_ID=", 11))
|
|
||||||
- version = safe_strdup(&buf[11]);
|
|
||||||
+ if (!distro && strneq(osrstr, "ID=", 3))
|
|
||||||
+ distro = safe_strdup(&osrstr[3]);
|
|
||||||
+ else if (!version && strneq(osrstr, "VERSION_ID=", 11))
|
|
||||||
+ version = safe_strdup(&osrstr[11]);
|
|
||||||
|
|
||||||
if (distro && version) {
|
|
||||||
iprintf(ctx, "os: \"%s:%s\"\n", distro, version);
|
|
||||||
@@ -1471,8 +1460,23 @@ print_system_header(struct record_context *ctx)
|
|
||||||
free(version);
|
|
||||||
fclose(osrelease);
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ /* kernel version */
|
|
||||||
+ if (uname(&u) != -1)
|
|
||||||
+ kernel = u.release;
|
|
||||||
iprintf(ctx, "kernel: \"%s\"\n", kernel);
|
|
||||||
- iprintf(ctx, "dmi: \"%s\"\n", buf);
|
|
||||||
+
|
|
||||||
+ /* dmi modalias */
|
|
||||||
+ dmi = fopen("/sys/class/dmi/id/modalias", "r");
|
|
||||||
+ if (dmi) {
|
|
||||||
+ if (fgets(dmistr, sizeof(dmistr), dmi)) {
|
|
||||||
+ dmistr[strlen(dmistr) - 1] = '\0'; /* linebreak */
|
|
||||||
+ } else {
|
|
||||||
+ sprintf(dmistr, "unknown");
|
|
||||||
+ }
|
|
||||||
+ fclose(dmi);
|
|
||||||
+ }
|
|
||||||
+ iprintf(ctx, "dmi: \"%s\"\n", dmistr);
|
|
||||||
indent_pop(ctx);
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.24.1
|
|
||||||
|
|
@ -4,8 +4,8 @@
|
|||||||
%global gitversion 58abea394
|
%global gitversion 58abea394
|
||||||
|
|
||||||
Name: libinput
|
Name: libinput
|
||||||
Version: 1.15.3
|
Version: 1.15.4
|
||||||
Release: 2%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
|
Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
|
||||||
Summary: Input device library
|
Summary: Input device library
|
||||||
|
|
||||||
License: MIT
|
License: MIT
|
||||||
@ -19,7 +19,6 @@ Source0: http://www.freedesktop.org/software/libinput/libinput-%{version}
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
Patch01: 0001-tools-point-users-to-the-libinput-utils-package-for-.patch
|
Patch01: 0001-tools-point-users-to-the-libinput-utils-package-for-.patch
|
||||||
Patch02: 0001-tools-record-fix-dmi-recording.patch
|
|
||||||
|
|
||||||
BuildRequires: git-core
|
BuildRequires: git-core
|
||||||
BuildRequires: gcc gcc-c++
|
BuildRequires: gcc gcc-c++
|
||||||
@ -139,6 +138,9 @@ pathfix.py -i %{__python3} -p -n $(git grep -l '#!/usr/bin/.*python3')
|
|||||||
%{_mandir}/man1/libinput-test-suite.1*
|
%{_mandir}/man1/libinput-test-suite.1*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Mar 18 2020 Peter Hutterer <peter.hutterer@redhat.com> 1.15.4-1
|
||||||
|
- libinput 1.15.4
|
||||||
|
|
||||||
* Mon Mar 09 2020 Peter Hutterer <peter.hutterer@redhat.com> 1.15.3-2
|
* Mon Mar 09 2020 Peter Hutterer <peter.hutterer@redhat.com> 1.15.3-2
|
||||||
- fix libinput record's dmi modalias recording
|
- fix libinput record's dmi modalias recording
|
||||||
|
|
||||||
|
2
sources
2
sources
@ -1 +1 @@
|
|||||||
SHA512 (libinput-1.15.3.tar.xz) = 6636fd618e2b9cfa5ee44701207dc98f2639adc53eb3ef135509d936fb19b2cedf5184eab58e887798d9cf8ee65f35bc9062f7e3630080bcbe45a90a8b631ef2
|
SHA512 (libinput-1.15.4.tar.xz) = 4659818952dc729cd5bdb78ebe21edbbacbf8a66a592b13ba30f3bb4c4e264208ec94440a253cfa4edc8b2ef904954eecea6be0f8d63cf239e3858d3abb64a80
|
||||||
|
Loading…
Reference in New Issue
Block a user