From 68c21fe2efabc7310565d1746f2954fa4ea317ad Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Fri, 20 Mar 2020 22:43:48 +0000 Subject: Cache results from detect_devices::getInputDevices(). Significantly speeds up service_harddrake, and hence Live ISO boot, due to many calls to detect_devices::probeall(). --- perl-install/NEWS | 3 +++ perl-install/detect_devices.pm | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/perl-install/NEWS b/perl-install/NEWS index 148e26ee0..e54eea86d 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,3 +1,6 @@ +- cache results from detect_devices::getInputDevices() + (significantly speeds up service_harddrake, and hence Live ISO boot) + Version 18.26 - 20 March 2020 - diskdrake: diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index 924f88325..15201a057 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -545,6 +545,8 @@ sub isTVcardConfigurable { member($_[0]{driver}, qw(bttv cx88 saa7134)) } sub getTVcards() { probe_category('multimedia/tv') } sub getInputDevices() { + state @input_devices; + return @input_devices if @input_devices; my (@devices, $device); my $event; foreach (cat_('/proc/bus/input/devices')) { @@ -655,7 +657,7 @@ sub getInputDevices() { undef $device; } } - @devices; + @input_devices = @devices; } sub getInputDevices_and_usb() { -- cgit v1.2.1