summaryrefslogtreecommitdiffstats
path: root/perl-install/install/media.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-04-06 18:00:48 +0000
committerThierry Vignaud <tv@mandriva.org>2009-04-06 18:00:48 +0000
commit41d805add5f0d4d8be3570164110c453865b42c3 (patch)
treea3dc49e40d1058eb24adaed4c2d287a048f54f58 /perl-install/install/media.pm
parent1e000f9b2e32c3f2490eeea0efa4a600a00a4cbf (diff)
downloaddrakx-41d805add5f0d4d8be3570164110c453865b42c3.tar
drakx-41d805add5f0d4d8be3570164110c453865b42c3.tar.gz
drakx-41d805add5f0d4d8be3570164110c453865b42c3.tar.bz2
drakx-41d805add5f0d4d8be3570164110c453865b42c3.tar.xz
drakx-41d805add5f0d4d8be3570164110c453865b42c3.zip
(_adjust_paths_in_urpmi_cfg) change it so that it consider per medium
physical medium instead of global medium ; fix path of NFS media after installation (setPackages) adjust paths in urpmi.cfg there instead of within get_media()
Diffstat (limited to 'perl-install/install/media.pm')
-rw-r--r--perl-install/install/media.pm27
1 files changed, 13 insertions, 14 deletions
diff --git a/perl-install/install/media.pm b/perl-install/install/media.pm
index 2aaa77e51..bed27116d 100644
--- a/perl-install/install/media.pm
+++ b/perl-install/install/media.pm
@@ -515,28 +515,27 @@ sub get_media {
log::l("unknown media type $_->{type}, skipping");
}
}
- my @new_media = difference2([ map { $_->{name} } @{$packages->{media}} ], \@names);
-
-
- _adjust_paths_in_urpmi_cfg($o, $phys_m, @new_media);
log::l("suppl_CDs=$suppl_CDs copy_rpms_on_disk=$copy_rpms_on_disk");
$suppl_CDs, $copy_rpms_on_disk;
}
-sub _adjust_paths_in_urpmi_cfg {
- my ($o, $phys_m, @new_media) = @_;
- if ($o->{stage2_phys_medium}{method} eq 'cdrom') {
- my $urpm = install::pkgs::empty_packages();
- # force rereading media:
- undef $urpm->{media};
- urpm::media::read_config($urpm);
- foreach my $medium (@{$urpm->{media}}) {
- next if !member($medium->{name}, @new_media);
+sub adjust_paths_in_urpmi_cfg {
+ my ($packages) = @_;
+
+ require Clone;
+ my ($urpm) = Clone::clone($packages);
+ foreach my $medium (@{$urpm->{media}}) {
+ my $phys_m = $medium->{phys_medium};
+ my $dir = _get_medium_dir($phys_m);
+ my $old_url = $medium->{url};
+ if ($phys_m->{method} eq 'cdrom') {
$medium->{url} =~ s!^$phys_m->{real_mntpoint}/!cdrom://!;
+ } elsif ($phys_m->{method} eq 'nfs') {
+ $medium->{url} =~ s!^$::prefix!!;
}
- urpm::media::write_config($urpm);
}
+ urpm::media::write_config($urpm);
}
sub remove_from_fstab {