summaryrefslogtreecommitdiffstats
path: root/perl-install
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
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')
-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 {