summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/install/NEWS1
-rw-r--r--perl-install/install/any.pm1
-rw-r--r--perl-install/install/media.pm27
3 files changed, 15 insertions, 14 deletions
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 25c4ca298..a6b76c2a4 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,4 +1,5 @@
- media management:
+ o fix path of NFS media after installation
o use urpmi in order to add supplementary media
- put distro version after release because release contains "Mandriva Linux"
diff --git a/perl-install/install/any.pm b/perl-install/install/any.pm
index 2698317e6..bb2ddfcf5 100644
--- a/perl-install/install/any.pm
+++ b/perl-install/install/any.pm
@@ -323,6 +323,7 @@ sub setPackages {
urpm::media::update_media($o->{packages}, distrib => 1, callback => \&urpm::download::sync_logger) or
log::l('updating media failed');
+ install::media::adjust_paths_in_urpmi_cfg($o->{packages});
urpm::media::configure($o->{packages});
log::l('urpmi completely set up');
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 {