diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> | 2006-09-11 17:27:22 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> | 2006-09-11 17:27:22 +0000 |
commit | 8e16b17939761e4097e9cc6984ef98418d50a8de (patch) | |
tree | cb3132dd04364218ff4c598fbe5c981bb5a41b4a | |
parent | 8a683f1afe6c7526019a94aaa3376d4e0c9dfa80 (diff) | |
download | urpmi-8e16b17939761e4097e9cc6984ef98418d50a8de.tar urpmi-8e16b17939761e4097e9cc6984ef98418d50a8de.tar.gz urpmi-8e16b17939761e4097e9cc6984ef98418d50a8de.tar.bz2 urpmi-8e16b17939761e4097e9cc6984ef98418d50a8de.tar.xz urpmi-8e16b17939761e4097e9cc6984ef98418d50a8de.zip |
Add support for updates_for keyword in media.cfg
-rw-r--r-- | urpm.pm | 37 |
1 files changed, 19 insertions, 18 deletions
@@ -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 { |