From 8e16b17939761e4097e9cc6984ef98418d50a8de Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Mon, 11 Sep 2006 17:27:22 +0000 Subject: Add support for updates_for keyword in media.cfg --- urpm.pm | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'urpm.pm') diff --git a/urpm.pm b/urpm.pm index 49c94eec..5e82657f 100644 --- a/urpm.pm +++ b/urpm.pm @@ -784,7 +784,7 @@ sub add_distrib_media { $urpm->try_mounting($url) or $urpm->{error}(N("unable to access first installation medium")), return (); - $distribconf->load() or $urpm->{error}(N("this url seems to not contains any distrib")), return (); + $distribconf->load() or $urpm->{error}(N("this url seems to not contain any distrib")), return (); } else { unlink "$urpm->{cachedir}/partial/media.cfg"; @@ -847,23 +847,24 @@ sub add_distrib_media { $skip and next; my $media_name = $distribconf->getvalue($media, 'name') || ''; - - push @newnames, $urpm->add_medium( - $name ? "$media_name ($name$medium)" : $media_name, - reduce_pathname($distribconf->getfullpath($media, 'path')), - offset_pathname( - $url, - $distribconf->getpath($media, 'path') - ) . '/' . $distribconf->getpath($media, - ($options{probe_with} eq 'synthesis' ? 'synthesis' : 'hdlist') - ), - index_name => $name ? undef : 0, - no_reload_config => 1, #- no need to reload config each time, since we don't update the media - %options, - ); - ++$medium; - } - return @newnames; + my $is_update_media = $distribconf->getvalue($media, 'updates_for'); + + push @newnames, $urpm->add_medium( + $name ? "$media_name ($name$medium)" : $media_name, + reduce_pathname($distribconf->getfullpath($media, 'path')), + offset_pathname( + $url, + $distribconf->getpath($media, 'path') + ) . '/' . $distribconf->getpath( $media, ($options{probe_with} eq 'synthesis' ? 'synthesis' : 'hdlist') ), + index_name => $name ? undef : 0, + no_reload_config => 1, #- no need to reload config each time, since we don't update the media + %options, + # the following override %options + update => $is_update_media ? 1 : 0, + ); + ++$medium; + } + return @newnames; } sub select_media { -- cgit v1.2.1