summaryrefslogtreecommitdiffstats
path: root/perl-install/install_any.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-09-13 08:56:00 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-09-13 08:56:00 +0000
commit5eb16ca817555c5766181fac7ade5ddd6dcb7c0d (patch)
tree7142f2b9d76f95852b4b42ad24e0d0f0236d98b2 /perl-install/install_any.pm
parente0b4d257d33379eb32156315801d9aa245fd9978 (diff)
downloaddrakx-backup-do-not-use-5eb16ca817555c5766181fac7ade5ddd6dcb7c0d.tar
drakx-backup-do-not-use-5eb16ca817555c5766181fac7ade5ddd6dcb7c0d.tar.gz
drakx-backup-do-not-use-5eb16ca817555c5766181fac7ade5ddd6dcb7c0d.tar.bz2
drakx-backup-do-not-use-5eb16ca817555c5766181fac7ade5ddd6dcb7c0d.tar.xz
drakx-backup-do-not-use-5eb16ca817555c5766181fac7ade5ddd6dcb7c0d.zip
deselection of found media: don't display twice media from the same
installation CD
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r--perl-install/install_any.pm32
1 files changed, 28 insertions, 4 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 6f766338b..f76b8c235 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -363,19 +363,43 @@ sub preConfigureTimezone {
}
sub deselectFoundMedia {
- #- TODO group by CD
+ #- group by CD
my ($o, $hdlists) = @_;
+ my %cdlist;
+ my @hdlist2;
+ my @corresp;
+ my $i = 0;
+ for (@$hdlists) {
+ (my $cd) = $_->[3] =~ /\bCD ?(\d+)\b/;
+ if (!$cd || !@{$cdlist{$cd} || []}) {
+ push @hdlist2, $_;
+ $corresp[$i] = [ $i ];
+ } else {
+ $corresp[$i] = [];
+ push @{$corresp[$cdlist{$cd}[0]]}, $i;
+ }
+ if ($cd) {
+ $cdlist{$1} ||= [];
+ push @{$cdlist{$1}}, $i;
+ }
+ ++$i;
+ }
my $l = $o->ask_many_from_list('',
N("The following installation media have been found.
If you want to skip some of them, you can unselect them now."),
{
- list => $hdlists,
+ list => \@hdlist2,
value => sub { 1 },
label => sub { $_[0][3] },
},
);
- log::l("keeping media " . join ',', map { $_->[1] } @$l);
- @$l;
+ my @l2; $i = 0;
+ for my $c (@$l) {
+ ++$i while $hdlists->[$i][3] ne $c->[3];
+ push @l2, $hdlists->[$_] for @{$corresp[$i]};
+ }
+ log::l("keeping media " . join ',', map { $_->[1] } @l2);
+ @l2;
}
sub ask_if_suppl_media {