summaryrefslogtreecommitdiffstats
path: root/perl-install/diskdrake
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-01-07 13:22:28 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-01-07 13:22:28 +0000
commitc2f200920f04dba0874c054038770a91a71fbba5 (patch)
tree7448485cea94afcd511535b592b1f061c543f3b9 /perl-install/diskdrake
parent0a813b0ea3c7c30ca81e79b6303f5141e95fee4b (diff)
downloaddrakx-c2f200920f04dba0874c054038770a91a71fbba5.tar
drakx-c2f200920f04dba0874c054038770a91a71fbba5.tar.gz
drakx-c2f200920f04dba0874c054038770a91a71fbba5.tar.bz2
drakx-c2f200920f04dba0874c054038770a91a71fbba5.tar.xz
drakx-c2f200920f04dba0874c054038770a91a71fbba5.zip
use "if any" instead of "if grep", and various other occurences of "any", "every", "partition"
Diffstat (limited to 'perl-install/diskdrake')
-rw-r--r--perl-install/diskdrake/hd_gtk.pm2
-rw-r--r--perl-install/diskdrake/interactive.pm7
-rw-r--r--perl-install/diskdrake/smbnfs_gtk.pm2
3 files changed, 5 insertions, 6 deletions
diff --git a/perl-install/diskdrake/hd_gtk.pm b/perl-install/diskdrake/hd_gtk.pm
index 41df6a5f9..f065eac0f 100644
--- a/perl-install/diskdrake/hd_gtk.pm
+++ b/perl-install/diskdrake/hd_gtk.pm
@@ -246,7 +246,7 @@ sub create_automatic_notebooks {
};
$may_add->(hd2kind($_)) foreach @{$all_hds->{hds}};
$may_add->(lvm2kind($_)) foreach @{$all_hds->{lvms}};
- $may_add->(raid2kind()) if grep { $_ } @{$all_hds->{raids}};
+ $may_add->(raid2kind()) if any { $_ } @{$all_hds->{raids}};
$may_add->(loopback2kind()) if @{$all_hds->{loopbacks}};
@notebook = grep_index {
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm
index e3055ca2a..04215eb07 100644
--- a/perl-install/diskdrake/interactive.pm
+++ b/perl-install/diskdrake/interactive.pm
@@ -798,9 +798,8 @@ sub RemoveFromLVM {
my ($_in, $_hd, $part, $all_hds) = @_;
my $lvms = $all_hds->{lvms};
isPartOfLVM($part) or die;
- my ($lvm) = grep { $_->{VG_name} eq $part->{lvm} } @$lvms;
- lvm::vg_destroy($lvm);
- @$lvms = grep { $_ != $lvm } @$lvms;
+ (my $lvm, $lvms) = partition { $_->{VG_name} eq $part->{lvm} } @$lvms;
+ lvm::vg_destroy($lvm->[0]);
}
sub ModifyRAID {
my ($in, $_hd, $part, $all_hds) = @_;
@@ -920,7 +919,7 @@ sub Options {
sub is_part_existing {
my ($part, $all_hds) = @_;
- $part && grep { fsedit::is_same_part($part, $_) } fsedit::get_all_fstab_and_holes($all_hds);
+ $part && any { fsedit::is_same_part($part, $_) } fsedit::get_all_fstab_and_holes($all_hds);
}
sub modifyRAID {
diff --git a/perl-install/diskdrake/smbnfs_gtk.pm b/perl-install/diskdrake/smbnfs_gtk.pm
index 7bf184afe..8a8feb8d3 100644
--- a/perl-install/diskdrake/smbnfs_gtk.pm
+++ b/perl-install/diskdrake/smbnfs_gtk.pm
@@ -119,7 +119,7 @@ sub find_fstab_entry {
my $fs_entry = $kind->to_fstab_entry($e);
- if (my ($fs_entry_) = grep { $fs_entry->{device} eq $_->{device} } @{$kind->{val}}) {
+ if (my $fs_entry_ = find { $fs_entry->{device} eq $_->{device} } @{$kind->{val}}) {
$fs_entry_;
} elsif ($add_or_not) {
push @{$kind->{val}}, $fs_entry;