summaryrefslogtreecommitdiffstats
path: root/perl-install/harddrake
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2002-07-08 13:53:32 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2002-07-08 13:53:32 +0000
commited8fb15246983b9698959d56cb966be8ac0b40a5 (patch)
treec632658ed1a0375b4d2aeb28f8eb508b6d00f331 /perl-install/harddrake
parente3b4c546b4e4830fffa0513878ae1c780a165f2a (diff)
downloaddrakx-ed8fb15246983b9698959d56cb966be8ac0b40a5.tar
drakx-ed8fb15246983b9698959d56cb966be8ac0b40a5.tar.gz
drakx-ed8fb15246983b9698959d56cb966be8ac0b40a5.tar.bz2
drakx-ed8fb15246983b9698959d56cb966be8ac0b40a5.tar.xz
drakx-ed8fb15246983b9698959d56cb966be8ac0b40a5.zip
cache @devices so that hw probe is only done once
Diffstat (limited to 'perl-install/harddrake')
-rw-r--r--perl-install/harddrake/data.pm14
1 files changed, 7 insertions, 7 deletions
diff --git a/perl-install/harddrake/data.pm b/perl-install/harddrake/data.pm
index 01fa6be00..bff9c42f8 100644
--- a/perl-install/harddrake/data.pm
+++ b/perl-install/harddrake/data.pm
@@ -18,6 +18,8 @@ sub unknown {
# NEVER, NEVER alter CLASS_ID or you'll harddrake2 service to detect changes
# in hw configuration ... :-(
+my @devices = detect_devices::probeall(1);
+
our @tree =
(
["FLOPPY","Floppy", "floppy.png", "",\&detect_devices::floppies],
@@ -27,11 +29,11 @@ our @tree =
# ["CDBURNER","Cd burners", "cd.png", "", \&detect_devices::burners],
["VIDEO","Videocard", "video.png", "$sbindir/XFdrake",
- sub {grep { $_->{driver} =~ /^(Card|Server):/ || $_->{media_type} =~ 'DISPLAY_VGA' } detect_devices::probeall(1) }],
+ sub {grep { $_->{driver} =~ /^(Card|Server):/ || $_->{media_type} =~ 'DISPLAY_VGA' } @devices }],
["TV","Tvcard", "tv.png", "/usr/bin/XawTV",
- sub {grep { $_->{media_type} =~ 'MULTIMEDIA_VIDEO' } detect_devices::probeall(1)}],
+ sub {grep { $_->{media_type} =~ 'MULTIMEDIA_VIDEO' } @devices}],
["AUDIO","Soundcard", "sound.png", "$bindir/aumix",
- sub {grep { $_->{media_type} =~ 'MULTIMEDIA_AUDIO' } detect_devices::probeall(1)}],
+ sub {grep { $_->{media_type} =~ 'MULTIMEDIA_AUDIO' } @devices}],
# "MULTIMEDIA_AUDIO" => "/usr/bin/X11/sounddrake";
["WEBCAM","Webcam", "webcam.png", "", sub {}],
["ETHERNET","Ethernetcard", "hw_network.png", "$sbindir/draknet", sub {
@@ -41,15 +43,13 @@ our @tree =
my @usbnet = qw/CDCEther catc kaweth pegasus usbnet/;
# should be taken from detect_devices.pm or modules.pm. it's identical
- grep { $_->{media_type} =~ /^NETWORK/ ||
- member($_->{driver}, @usbnet)
- } detect_devices::probeall(1)}],
+ grep { $_->{media_type} =~ /^NETWORK/ || member($_->{driver}, @usbnet) } @devices}],
# ["","Tokenring cards", "Ethernetcard.png", "", \&detect_devices::getNet],
# ["","FDDI cards", "Ethernetcard.png", "", \&detect_devices::getNet],
# ["","Modem", "Modem.png", "", \&detect_devices::getNet],
# ["","Isdn", "", "", \&detect_devices::getNet]
- ["BRIDGE","Bridge", "memory.png", "", sub {grep { $_->{media_type} =~ 'BRIDGE' } detect_devices::probeall(1)}],
+ ["BRIDGE","Bridge", "memory.png", "", sub {grep { $_->{media_type} =~ 'BRIDGE' } @devices}],
# ["","Cpu", "cpu.png", "", sub {}],
# ["","Memory", "memory.png", "", sub {}],
["UNKNOWN","Unknown/Others", "unknown.png", "" , \&unknown],