From 11aef71ed8eaaf0764bfba2808009e6748c289ca Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Sun, 7 Dec 2014 10:34:25 +0100 Subject: drop support for dmidecode < 2.7 (which we have since January 2006, mdv2007.0...) --- perl-install/detect_devices.pm | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index deac44714..c29bb6a27 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -1269,23 +1269,17 @@ sub dmidecode() { return if $>; my ($ver, @l) = arch() =~ /86/ ? run_program::get_stdout('dmidecode') : (); - my $tab = "\t"; - my ($major, $minor) = $ver =~ /(\d+)\.(\d+)/; - if ($major > 2 || $major == 2 && $minor > 7) { - #- new dmidecode output is less indented - $tab = ''; - #- drop header - shift @l while @l && $l[0] ne "\n"; - } + #- drop header + shift @l while @l && $l[0] ne "\n"; foreach (@l) { next if /TRUNCATED/; - if (/^$tab\t(.*)/) { + if (/^\t(.*)/) { $dmis[-1]{string} .= "$1\n"; - $dmis[-1]{$1} = $2 if /^$tab\t(.*): (.*)$/; - } elsif (my ($s) = /^$tab(.*)/) { + $dmis[-1]{$1} = $2 if /^\t(.*): (.*)$/; + } elsif (my ($s) = /^(.*)/) { next if $s =~ /^$/ || $s =~ /\bDMI type \d+/; $s =~ s/ Information$//; push @dmis, { name => $s }; -- cgit v1.2.1