From f287a267a59ba184898245d0730345cced5fd60b Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Mon, 26 Jul 2021 20:23:48 +0200 Subject: [PATCH] Add patch disabling timeouts in virtual-device to enable fedora CI --- ...o-not-time-out-when-waiting-for-SCAN.patch | 53 +++++++++++++++++++ libfprint.spec | 7 ++- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 0001-virtual-device-Do-not-time-out-when-waiting-for-SCAN.patch diff --git a/0001-virtual-device-Do-not-time-out-when-waiting-for-SCAN.patch b/0001-virtual-device-Do-not-time-out-when-waiting-for-SCAN.patch new file mode 100644 index 0000000..fff73d7 --- /dev/null +++ b/0001-virtual-device-Do-not-time-out-when-waiting-for-SCAN.patch @@ -0,0 +1,53 @@ +From 4cdca4da247b101e01d3c6266c4b2b3ba946c6f5 Mon Sep 17 00:00:00 2001 +From: Benjamin Berg +Date: Mon, 26 Jul 2021 19:45:02 +0200 +Subject: [PATCH] virtual-device: Do not time out when waiting for SCAN command + +The timeout is designed to continue commands automatically that are +common (e.g. opening the device). This doesn't really make sense for +scan commands, and removing the timeout enables test setups where user +interaction with the device may happen at arbitrary times. + +One exception is device removal/unplug, in which case the timeout will +be added anyway. +--- + libfprint/drivers/virtual-device.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/libfprint/drivers/virtual-device.c b/libfprint/drivers/virtual-device.c +index 1743692..a9efb39 100644 +--- a/libfprint/drivers/virtual-device.c ++++ b/libfprint/drivers/virtual-device.c +@@ -150,6 +150,8 @@ process_cmds (FpDeviceVirtualDevice * self, + char **scan_id, + GError **error) + { ++ gboolean removed; ++ + if (g_cancellable_is_cancelled (self->cancellable) || + (fpi_device_get_current_action (FP_DEVICE (self)) != FPI_DEVICE_ACTION_NONE && + g_cancellable_is_cancelled (fpi_device_get_cancellable (FP_DEVICE (self))))) +@@ -250,8 +252,11 @@ process_cmds (FpDeviceVirtualDevice * self, + if (self->ignore_wait) + return TRUE; + ++ g_object_get (self, "removed", &removed, NULL); ++ + g_assert (self->wait_command_id == 0); +- self->wait_command_id = g_timeout_add (500, wait_for_command_timeout, self); ++ if (!scan || removed) ++ self->wait_command_id = g_timeout_add (500, wait_for_command_timeout, self); + return FALSE; + } + +@@ -304,6 +309,7 @@ recv_instruction_cb (GObject *source_object, + else if (g_str_has_prefix (cmd, UNPLUG_CMD)) + { + fpi_device_remove (FP_DEVICE (self)); ++ maybe_continue_current_action (self); + } + else if (g_str_has_prefix (cmd, SET_ENROLL_STAGES_PREFIX)) + { +-- +2.31.1 + diff --git a/libfprint.spec b/libfprint.spec index c1fb6ca..2349116 100644 --- a/libfprint.spec +++ b/libfprint.spec @@ -1,7 +1,7 @@ Name: libfprint Version: 1.92.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Toolkit for fingerprint scanner License: LGPLv2+ @@ -29,6 +29,8 @@ BuildRequires: umockdev >= 0.13.2 Patch0000: https://gitlab.freedesktop.org/libfprint/libfprint/-/merge_requests/306.patch +Patch9999: 0001-virtual-device-Do-not-time-out-when-waiting-for-SCAN.patch + %description libfprint offers support for consumer fingerprint reader devices. @@ -73,6 +75,9 @@ developing applications that use %{name}. %{_datadir}/gtk-doc/html/libfprint-2/ %changelog +* Mon Jul 26 2021 Benjamin Berg - 1.92.0-3 +- Add patch disabling timeouts in virtual-device to enable fedora CI + * Thu Jul 22 2021 Fedora Release Engineering - 1.92.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild