summaryrefslogtreecommitdiffstats
path: root/perl-install/install/media.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-03-04 15:33:03 +0000
committerThierry Vignaud <tv@mandriva.org>2009-03-04 15:33:03 +0000
commitf6be2128ee5d3c31c278194bd2e185bcf7acb9f3 (patch)
treee2b62eb41ee3a4f48d7183fe1b62636d254e1748 /perl-install/install/media.pm
parent5ba6f751b0537144b4890510e0e66304f4085411 (diff)
downloaddrakx-backup-do-not-use-f6be2128ee5d3c31c278194bd2e185bcf7acb9f3.tar
drakx-backup-do-not-use-f6be2128ee5d3c31c278194bd2e185bcf7acb9f3.tar.gz
drakx-backup-do-not-use-f6be2128ee5d3c31c278194bd2e185bcf7acb9f3.tar.bz2
drakx-backup-do-not-use-f6be2128ee5d3c31c278194bd2e185bcf7acb9f3.tar.xz
drakx-backup-do-not-use-f6be2128ee5d3c31c278194bd2e185bcf7acb9f3.zip
(install,select_only_some_media) honor 'selected_names' for auto_install
Diffstat (limited to 'perl-install/install/media.pm')
-rw-r--r--perl-install/install/media.pm19
1 files changed, 19 insertions, 0 deletions
diff --git a/perl-install/install/media.pm b/perl-install/install/media.pm
index 50b22fcab..5b6441b4c 100644
--- a/perl-install/install/media.pm
+++ b/perl-install/install/media.pm
@@ -477,6 +477,20 @@ sub _parse_media_cfg {
$distribconf, \@hdlists;
}
+sub select_only_some_media {
+ my ($packages, $selected_names) = @_;
+ my @names = split(',', $selected_names);
+ foreach my $m (@{$packages->{media}}) {
+ my $bool = !member($m->{name}, @names);
+ # workaround urpmi transforming "ignore => ''" or "ignore => 0" into "ignore => 1":
+ undef $bool if !$bool;
+ log::l "disabling '$m->{name}' medium: " . to_bool($bool);
+ urpm::media::_tempignore($m, $bool);
+ # make sure we update un-ignored media (eg: */Testing and the like):
+ $m->{modified} = 1 if !$bool;
+ }
+}
+
sub get_media {
my ($o, $media, $packages) = @_;
@@ -488,6 +502,11 @@ sub get_media {
$phys_m->{method} =~ m!^(ftp|http)://! && $phys_m->{method}
|| $phys_m->{real_mntpoint} || $phys_m->{url};
urpm::media::add_distrib_media($packages, undef, $uri, ask_media => undef); #allmedia => 1
+
+ if (defined $_->{selected_names}) {
+ select_only_some_media($packages, $_->{selected_names});
+ }
+
_get_compsUsers_pl($phys_m, $_->{force_rpmsrate});
($suppl_CDs, $copy_rpms_on_disk) = eval { _get_media_cfg_options($o, $phys_m) };
} elsif ($_->{type} eq 'media') {