summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-03-05 13:39:56 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-03-05 13:39:56 +0000
commite9a8e8dbc89913fb930f31e4c011aa016111314d (patch)
treed5af9a11a434f14e1fd21f739ca367086045f0bc /perl-install/detect_devices.pm
parent54e499995b9cb2d1ec9199710fa3da1a27732754 (diff)
downloaddrakx-backup-do-not-use-e9a8e8dbc89913fb930f31e4c011aa016111314d.tar
drakx-backup-do-not-use-e9a8e8dbc89913fb930f31e4c011aa016111314d.tar.gz
drakx-backup-do-not-use-e9a8e8dbc89913fb930f31e4c011aa016111314d.tar.bz2
drakx-backup-do-not-use-e9a8e8dbc89913fb930f31e4c011aa016111314d.tar.xz
drakx-backup-do-not-use-e9a8e8dbc89913fb930f31e4c011aa016111314d.zip
prevent warning when using diagnostics pragma (easier debugging)
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm12
1 files changed, 7 insertions, 5 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 91afd12e6..7e4ec4864 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -108,7 +108,8 @@ sub get_sys_cdrom_info {
my @drives_order;
foreach (cat_("/proc/sys/dev/cdrom/info")) {
my ($t, $l) = split ':';
- my @l = split ' ', $l;
+ my @l;
+ @l = split(' ', $l) if $l;
if ($t eq 'drive name') {
@drives_order = map {
s/^sr/scd/;
@@ -196,11 +197,11 @@ sub isDvdDrive {
sub isZipDrive { $_[0]{info} =~ /ZIP\s+\d+/ } #- accept ZIP 100, untested for bigger ZIP drive.
sub isJazzDrive { $_[0]{info} =~ /\bJAZZ?\b/i } #- accept "iomega jaz 1GB"
sub isLS120Drive { $_[0]{info} =~ /LS-?120|144MB/ }
-sub isRemovableUsb { index($_[0]{usb_media_type}, 'Mass Storage|') == 0 && usb2removable($_[0]) }
-sub isFloppyUsb { $_[0]{usb_driver} eq 'Removable:floppy' }
+sub isRemovableUsb { $_[0]{usb_media_type} && index($_[0]{usb_media_type}, 'Mass Storage|') == 0 && usb2removable($_[0]) }
+sub isFloppyUsb { $_[0]{usb_driver} && $_[0]{usb_driver} eq 'Removable:floppy' }
sub isRemovableDrive {
my ($e) = @_;
- isZipDrive($e) || isLS120Drive($e) || $e->{media_type} eq 'fd' || isRemovableUsb($e) || index($e->{usb_media_type}, 'Mass Storage|Floppy (UFI)') == 0;
+ isZipDrive($e) || isLS120Drive($e) || $e->{media_type} && $e->{media_type} eq 'fd' || isRemovableUsb($e) || $e->{usb_media_type} && index($e->{usb_media_type}, 'Mass Storage|Floppy (UFI)') == 0;
}
sub getSCSI() {
@@ -530,7 +531,8 @@ sub tryWrite($) {
sub syslog {
-r "/tmp/syslog" and return map { /<\d+>(.*)/ } cat_("/tmp/syslog");
- `$ENV{LD_LOADER} /bin/dmesg`;
+ my $LD_LOADER = $ENV{LD_LOADER} ? $ENV{LD_LOADER} : "";
+ `$LD_LOADER /bin/dmesg`;
}
sub get_mac_model() {