summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-11-08 12:48:35 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-11-08 12:48:35 +0000
commitefe40c08d9027aaf0cae2d2803923122b65c8b16 (patch)
tree100ce70d0748406f75237c8677685b8f0d3baa22
parentac0cb53525eba687d1dc23d9fe98c7b58f4dfded (diff)
downloaddrakx-backup-do-not-use-efe40c08d9027aaf0cae2d2803923122b65c8b16.tar
drakx-backup-do-not-use-efe40c08d9027aaf0cae2d2803923122b65c8b16.tar.gz
drakx-backup-do-not-use-efe40c08d9027aaf0cae2d2803923122b65c8b16.tar.bz2
drakx-backup-do-not-use-efe40c08d9027aaf0cae2d2803923122b65c8b16.tar.xz
drakx-backup-do-not-use-efe40c08d9027aaf0cae2d2803923122b65c8b16.zip
log is mixed with valid data (bugzilla #19654)
-rw-r--r--perl-install/patch/patch-2006-fix-parsing-dmraid.pl42
1 files changed, 42 insertions, 0 deletions
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;
+};