diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-03-07 10:11:51 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-03-07 10:11:51 +0000 |
commit | 71ec9b21cf82a6598c40c159c68378f46e136904 (patch) | |
tree | 7b4b8983d26497be777e7678f08b852c44996ea5 | |
parent | 79d0b371ba0dd8e055d590c78c0dd6debea7d2ff (diff) | |
download | urpmi-71ec9b21cf82a6598c40c159c68378f46e136904.tar urpmi-71ec9b21cf82a6598c40c159c68378f46e136904.tar.gz urpmi-71ec9b21cf82a6598c40c159c68378f46e136904.tar.bz2 urpmi-71ec9b21cf82a6598c40c159c68378f46e136904.tar.xz urpmi-71ec9b21cf82a6598c40c159c68378f46e136904.zip |
Some options don't belong to urpmi.cfg
-rw-r--r-- | urpm.pm | 42 |
1 files changed, 21 insertions, 21 deletions
@@ -26,25 +26,6 @@ BEGIN { } } -#- list of options defined for each media -our @PER_MEDIA_OPT = qw( - downloader - hdlist - ignore - key-ids - list - md5sum - noreconfigure - priority - priority-upgrade - removable - synthesis - update - verify-rpm - virtual - with_hdlist -); - #- create a new urpm object. sub new { my ($class) = @_; @@ -182,7 +163,24 @@ sub read_config { #- per-media options foreach my $m (grep { $_ ne '' } keys %$config) { my $medium = { name => $m, clear_url => $config->{$m}{url} }; - defined $config->{$m}{$_} and $medium->{$_} = $config->{$m}{$_} foreach @PER_MEDIA_OPT; + foreach my $opt (qw( + downloader + hdlist + ignore + key-ids + list + md5sum + noreconfigure + priority + removable + synthesis + update + verify-rpm + virtual + with_hdlist + )) { + defined $config->{$m}{$opt} and $medium->{$opt} = $config->{$m}{$opt}; + } $urpm->probe_medium($medium, %options) and push @{$urpm->{media}}, $medium; } @@ -381,7 +379,9 @@ sub write_config { foreach my $medium (@{$urpm->{media}}) { my $medium_name = $medium->{name}; $config->{$medium_name}{url} = $medium->{clear_url}; - defined $medium->{$_} and $config->{$medium_name}{$_} = $medium->{$_} foreach @PER_MEDIA_OPT; + foreach (qw(hdlist with_hdlist list removable key-ids priority priority-upgrade update ignore synthesis virtual)) { + defined $medium->{$_} and $config->{$medium_name}{$_} = $medium->{$_}; + } } urpm::cfg::dump_config($urpm->{config}, $config) or $urpm->{fatal}(6, N("unable to write config file [%s]", $urpm->{config})); |