diff options
author | Francois Pons <fpons@mandriva.com> | 2001-06-06 08:11:36 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2001-06-06 08:11:36 +0000 |
commit | 091b6bef31170f0a00d21ae6b07a8ba041bbc41b (patch) | |
tree | cf77f17def86f248664e3680e705831be0b70335 | |
parent | 5d165fecad7ba9831fc47d47dc9d9a0a0ca66ea1 (diff) | |
download | drakx-backup-do-not-use-091b6bef31170f0a00d21ae6b07a8ba041bbc41b.tar drakx-backup-do-not-use-091b6bef31170f0a00d21ae6b07a8ba041bbc41b.tar.gz drakx-backup-do-not-use-091b6bef31170f0a00d21ae6b07a8ba041bbc41b.tar.bz2 drakx-backup-do-not-use-091b6bef31170f0a00d21ae6b07a8ba041bbc41b.tar.xz drakx-backup-do-not-use-091b6bef31170f0a00d21ae6b07a8ba041bbc41b.zip |
fixed burner and dvd drive detection ;-)
c::isBurner seems to detect both IDE and SCSI drive and description does not
necessary contains CDRW substring (for info).
c::isDvdDrive is unable to detect SCSI drive (at least one tested) but DVD
substring is quite nicely well represented, and there is few DVD drive available
as SCSI (pionneer?)
-rw-r--r-- | perl-install/detect_devices.pm | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index 754870662..ab4488f45 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -49,8 +49,8 @@ sub cdroms() { } @l; } -sub burners { grep { $_->{type} eq 'cdrom' && isBurner($_->{device}) } get() } -sub IDEburners { grep { $_->{type} eq 'cdrom' && isBurner($_->{device}) } getIDE() } +sub burners { grep { $_->{type} eq 'cdrom' && isBurner($_) } get() } +sub IDEburners { grep { $_->{type} eq 'cdrom' && isBurner($_) } getIDE() } sub dvdroms { grep { $_->{type} eq 'cdrom' && isDvdDrive($_) } get() } sub get_mac_model() { @@ -71,23 +71,13 @@ sub floppy { first(floppies()) } #- example ls120, model = "LS-120 SLIM 02 UHD Floppy" sub isBurner { - my ($dev) = @_; - if (my ($nb) = $dev =~ /scd (.*)/x) { - grep { /^(scd|sr)$nb:.*writer/ } syslog(); - } else { - my $f = tryOpen($dev); - $f && c::isBurner(fileno($f)); - } + my $f = tryOpen($_[0]{device}); #- SCSI burner seems to be detected this way. + $f && c::isBurner(fileno($f)); } -sub isDvdDrive { - my ($dev) = @_; - if (my ($nb) = $dev =~ /scd (.*)/x) { - # can't detect SCSI DVD - undef; - } else { - my $f = tryOpen($dev); - $f && c::isDvdDrive(fileno($f)); - } +sub isDvdDrive { + $_[0]{info} =~ /DVD/; #- SCSI DVD seems not to be detected correctly, so use another probe after. + my $f = tryOpen($_[0]{device}); + $f && c::isDvdDrive(fileno($f)); } sub isZipDrive { $_[0]->{info} =~ /ZIP\s+\d+/ } #- accept ZIP 100, untested for bigger ZIP drive. #-sub isJazzDrive { $_[0]->{info} =~ /JAZZ?\s+/ } #- untested. |