From efe40c08d9027aaf0cae2d2803923122b65c8b16 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 8 Nov 2005 12:48:35 +0000 Subject: log is mixed with valid data (bugzilla #19654) --- .../patch/patch-2006-fix-parsing-dmraid.pl | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 perl-install/patch/patch-2006-fix-parsing-dmraid.pl diff --git a/perl-install/patch/patch-2006-fix-parsing-dmraid.pl b/perl-install/patch/patch-2006-fix-parsing-dmraid.pl new file mode 100644 index 000000000..4e42dde56 --- /dev/null +++ b/perl-install/patch/patch-2006-fix-parsing-dmraid.pl @@ -0,0 +1,42 @@ +log::l("PATCH: 2006-fix-parsing-dmraid"); + +use fsedit; +package fsedit; + +my $old_handle_dmraid = \&handle_dmraid; + +undef *handle_dmraid; +*handle_dmraid = sub { + my ($drives) = @_; + + @$drives > 1 or return; + + devices::make($_->{device}) foreach @$drives; + + require fs::dmraid; + + log::l("PATCH: 2006-fix-parsing-dmraid (inside handle_dmraid)"); + + undef *fs::dmraid::_raid_devices_raw; + *fs::dmraid::_raid_devices_raw = sub { + map { + chomp; + log::l("got: $_"); + my %l; @l{qw(pv format vg level status size)} = split(':'); + if_(defined $l{size}, \%l); + } fs::dmraid::call_dmraid('-ccr'); + }; + + + undef *fs::dmraid::_sets_raw; + *fs::dmraid::_sets_raw = sub { + map { + chomp; + log::l("got: $_"); + my %l; @l{qw(name size stride level status subsets devs spares)} = split(':'); + if_(defined $l{spares}, \%l); + } fs::dmraid::call_dmraid('-ccs'); + }; + + &$old_handle_dmraid; +}; -- cgit v1.2.1