From d9fc5f70b0c872f66b60649bca9a2fa4eb6aa762 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 18 Jan 2010 11:22:03 +0000 Subject: (complete_usb_storage_info) fix retrieving empty info for USB discs do not overwrite values when we cannot access sysfs (fix "displaying empty info for USB discs" regression "introduced" by path fix in getSCSI() (r263658 by blino on 2009/11/24) that exposed the complete_usb_storage_info() breakage to the real world (was: "fix reading USB details (#55690)") --- perl-install/detect_devices.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'perl-install/detect_devices.pm') diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index b076187a4..0022d4685 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -121,7 +121,8 @@ sub complete_usb_storage_info { if (my $e = find { !$_->{found} && $_->{usb_vendor} == $usb->{vendor} && $_->{usb_id} == $usb->{id} } @usb) { my $host = get_sysfs_usbpath_for_block($e->{device}); if ($host) { - $e->{info} = chomp_(cat_("/sys/block/$host/../serial")); + my $file = "/sys/block/$host/../serial"; + $e->{info} = chomp_(cat_($file)) if -e $file; $e->{usb_description} = join('|', chomp_(cat_("/sys/block/$host/../manufacturer")), chomp_(cat_("/sys/block/$host/../product"))); -- cgit v1.2.1