From 0e7126fdc833d2696c8c70070641300fa2d14285 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 16 Nov 2004 11:33:24 +0000 Subject: cleanup get_mac_generation() --- perl-install/detect_devices.pm | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'perl-install/detect_devices.pm') diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index 2f303200d..f0456bdc7 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -763,17 +763,7 @@ sub get_mac_model() { } sub get_mac_generation() { - my $generation = cat_("/proc/cpuinfo") || die "Can't open /proc/cpuinfo"; - my @genarray = split(/\n/, $generation); - my $count = 0; - while ($count <= @genarray) { - if ($genarray[$count] =~ /pmac-generation/) { - @genarray = split(/:/, $genarray[$count]); - return $genarray[1]; - } - $count++; - } - return "Unknown Generation"; + cat_('/proc/cpuinfo') =~ /^pmac-generation\s*:\s*(.*)/m ? $1 : "Unknown Generation"; } sub hasSMP() { -- cgit v1.2.1