From 703af98cc4c470a49514326251efcb86ad28f6b3 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Tue, 10 Nov 2009 17:38:02 +0000 Subject: don't cache media.cfg files on virtual media media.cfg files were cached to /etc/urpmi/media.cfg even when using --use-distrib or other media for which we don't want to cache the media matadata. Make sure we no longer do that. --- urpm/media.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'urpm') diff --git a/urpm/media.pm b/urpm/media.pm index 18959f7d..8bfde15c 100644 --- a/urpm/media.pm +++ b/urpm/media.pm @@ -890,7 +890,9 @@ sub add_distrib_media { my $media_cfg = reduce_pathname("$dir/" . $distribconf->getpath(undef, 'infodir') . '/media.cfg'); $distribconf->parse_mediacfg($media_cfg) or $urpm->{error}(N("this location doesn't seem to contain any distribution")), return (); - _register_media_cfg($urpm, $dir, undef, $distribconf, $media_cfg); + if (!$options{virtual}) { + _register_media_cfg($urpm, $dir, undef, $distribconf, $media_cfg); + } } else { if ($options{mirrorlist}) { $url and die "unexpected url $url together with mirrorlist $options{mirrorlist}\n"; @@ -902,7 +904,9 @@ sub add_distrib_media { my $media_cfg = "$urpm->{cachedir}/partial/media.cfg"; $distribconf = _new_distribconf_and_download($urpm, $m); $parse_ok = $distribconf && $distribconf->parse_mediacfg($media_cfg); - _register_media_cfg($urpm, $url, $options{mirrorlist}, $distribconf, $media_cfg) if $parse_ok; + if ($parse_ok && !$options{virtual}) { + _register_media_cfg($urpm, $url, $options{mirrorlist}, $distribconf, $media_cfg); + } $parse_ok; }); $url = $m->{url}; -- cgit v1.2.1