summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-06-05 17:04:34 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-06-05 17:04:34 +0000
commit5d165fecad7ba9831fc47d47dc9d9a0a0ca66ea1 (patch)
tree58ea6bef5edbc25f0b737df61f507dc159ff5335 /perl-install/detect_devices.pm
parentf4ad582b9636b4ade9a332380a7a15d75a92b429 (diff)
downloaddrakx-backup-do-not-use-5d165fecad7ba9831fc47d47dc9d9a0a0ca66ea1.tar
drakx-backup-do-not-use-5d165fecad7ba9831fc47d47dc9d9a0a0ca66ea1.tar.gz
drakx-backup-do-not-use-5d165fecad7ba9831fc47d47dc9d9a0a0ca66ea1.tar.bz2
drakx-backup-do-not-use-5d165fecad7ba9831fc47d47dc9d9a0a0ca66ea1.tar.xz
drakx-backup-do-not-use-5d165fecad7ba9831fc47d47dc9d9a0a0ca66ea1.zip
nicer solution for detecting DVD drives (still need SCSI detection)
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index c2be7e1e8..754870662 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -79,7 +79,16 @@ sub isBurner {
$f && c::isBurner(fileno($f));
}
}
-sub isDvdDrive { $_[0]->{info} =~ /DVD/ }
+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 isZipDrive { $_[0]->{info} =~ /ZIP\s+\d+/ } #- accept ZIP 100, untested for bigger ZIP drive.
#-sub isJazzDrive { $_[0]->{info} =~ /JAZZ?\s+/ } #- untested.
sub isLS120Drive { $_[0]->{info} =~ /LS-?120|144MB/ }