summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-08-31 07:57:06 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-08-31 07:57:06 +0000
commit0a7dfe2a26c1ec57892cb47d6fa87daf3e372855 (patch)
tree66bb52e22def658b8c8c7f097db33491936aa325
parent8b2c144f3ef57416c3f76ed77bf70fe5fb37fce1 (diff)
downloaddrakx-0a7dfe2a26c1ec57892cb47d6fa87daf3e372855.tar
drakx-0a7dfe2a26c1ec57892cb47d6fa87daf3e372855.tar.gz
drakx-0a7dfe2a26c1ec57892cb47d6fa87daf3e372855.tar.bz2
drakx-0a7dfe2a26c1ec57892cb47d6fa87daf3e372855.tar.xz
drakx-0a7dfe2a26c1ec57892cb47d6fa87daf3e372855.zip
Support for unselecting some media before the install (begin.)
-rw-r--r--perl-install/install_any.pm19
-rw-r--r--perl-install/install_steps.pm1
-rw-r--r--perl-install/install_steps_interactive.pm4
-rw-r--r--perl-install/pkgs.pm21
4 files changed, 35 insertions, 10 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index cf0939bc2..2260e894c 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -361,6 +361,21 @@ sub preConfigureTimezone {
add2hash_($o->{timezone}, { UTC => $utc, ntp => $ntp });
}
+sub deselectFoundMedia {
+ my ($o, $hdlists) = @_;
+ 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,
+ value => sub { 1 },
+ label => sub { $_[0][3] },
+ },
+ );
+ log::l("keeping media " . map { $_->[1] } @$l);
+ @$l;
+}
+
sub ask_if_suppl_media {
my ($o) = @_;
our $suppl_already_asked;
@@ -410,7 +425,7 @@ sub selectSupplMedia {
log::l($@) if $@;
useMedium($medium_name);
#- probe for an hdlists file and then look for all hdlists listed herein
- eval { pkgs::psUsingHdlists($o->{prefix}, $suppl_method, "/mnt/cdrom/media/media_info/hdlists", $o->{packages}, '1s') };
+ eval { pkgs::psUsingHdlists($o, $suppl_method, "/mnt/cdrom/media/media_info/hdlists", $o->{packages}, '1s') };
if ($@) {
log::l("psUsingHdlists failed: $@");
#- no hdlists found on the suppl. CD
@@ -493,7 +508,7 @@ sub setPackages {
require pkgs;
if (!$o->{packages} || is_empty_array_ref($o->{packages}{depslist})) {
my $cdrom;
- ($o->{packages}, my $suppl_method) = pkgs::psUsingHdlists($o->{prefix}, $o->{method});
+ ($o->{packages}, my $suppl_method) = pkgs::psUsingHdlists($o, $o->{method});
1 while
$suppl_method = $o->selectSupplMedia($suppl_method);
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 7a7ee2b7a..443e3353b 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -292,6 +292,7 @@ sub setPackages {
$rebuild_needed and pkgs::selectPackagesToUpgrade($o->{packages}, $o->{prefix});
}
+sub deselectFoundMedia { '' }
sub selectSupplMedia { '' }
sub choosePackages {
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index e8cb6097d..6221cda4f 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -391,6 +391,10 @@ sub setPackages {
}
}
+sub deselectFoundMedia {
+ my ($o, $p) = @_;
+ install_any::deselectFoundMedia($o, $p);
+}
sub selectSupplMedia {
my ($o, $suppl_method) = @_;
install_any::selectSupplMedia($o, $suppl_method);
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 7b66bca23..f4ef13220 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -378,7 +378,8 @@ sub psUpdateHdlistsDeps {
}
sub psUsingHdlists {
- my ($prefix, $method, $o_hdlistsfile, $o_packages, $o_initialmedium) = @_;
+ my ($o, $method, $o_hdlistsfile, $o_packages, $o_initialmedium) = @_;
+ my $prefix = $o->{prefix};
my $listf = install_any::getFile($o_hdlistsfile || 'media/media_info/hdlists')
or die "no hdlists found";
my $suppl_CDs = 0;
@@ -390,6 +391,7 @@ sub psUsingHdlists {
#- parse hdlists file.
my $medium_name = $o_initialmedium || 1;
+ my @hdlists;
foreach (<$listf>) {
chomp;
s/\s*#.*$//;
@@ -397,17 +399,20 @@ sub psUsingHdlists {
#- we'll ask afterwards for supplementary CDs, if the hdlists file contains
#- a line that begins with "suppl"
if (/^suppl/) { $suppl_CDs = 1; next }
+ my $cdsuppl = index($medium_name, 's') >= 0;
m/^\s*(noauto:)?(hdlist\S*\.cz2?)\s+(\S+)\s*(.*)$/ or die qq(invalid hdlist description "$_" in hdlists file);
+ push @hdlists, [ $2, $medium_name, $3, $4, !$1,
+ #- hdlist path, suppl CDs are mounted on /mnt/cdrom :
+ $cdsuppl ? "/mnt/cdrom/media/media_info/$2" : undef,
+ ];
+ $cdsuppl ? ($medium_name = ($medium_name + 1) . 's') : ++$medium_name;
+ }
+ @hdlists = $o->deselectFoundMedia(\@hdlists) unless defined $o_initialmedium;
+ foreach my $h (@hdlists) {
#- make sure the first medium is always selected!
#- by default select all image.
- psUsingHdlist(
- $prefix, $method, $o_packages, $2, $medium_name, $3, $4, !$1,
- #- hdlist path, suppl CDs are mounted on /mnt/cdrom :
- index($medium_name, 's') >= 0 ? "/mnt/cdrom/media/media_info/$2" : undef,
- );
-
- $medium_name =~ /s$/ ? ($medium_name = ($medium_name + 1) . 's') : ++$medium_name;
+ psUsingHdlist($prefix, $method, $o_packages, @$h);
}
log::l("psUsingHdlists read " . int(@{$o_packages->{depslist}}) .