diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-12-02 17:14:22 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-12-02 17:14:22 +0000 |
commit | d781c33cc2a22272a6cb8237af4c9afb95f1cd28 (patch) | |
tree | bb26459017cf0b5ec68441761cc2af19a8d1109b | |
parent | 50f11021b4cce43e0e6f2921885d453c7fc03f3b (diff) | |
download | urpmi-d781c33cc2a22272a6cb8237af4c9afb95f1cd28.tar urpmi-d781c33cc2a22272a6cb8237af4c9afb95f1cd28.tar.gz urpmi-d781c33cc2a22272a6cb8237af4c9afb95f1cd28.tar.bz2 urpmi-d781c33cc2a22272a6cb8237af4c9afb95f1cd28.tar.xz urpmi-d781c33cc2a22272a6cb8237af4c9afb95f1cd28.zip |
Add a new configuration option, default-media, that specifies a comma-separated
list of media to be taken into account by default (i.e., if the --media switch
is not specified on the command-line)
-rw-r--r-- | urpm.pm | 8 | ||||
-rw-r--r-- | urpm/cfg.pm | 1 |
2 files changed, 7 insertions, 2 deletions
@@ -157,6 +157,7 @@ sub read_config { auto compress downloader + default-media excludedocs excludepath fuzzy @@ -507,10 +508,13 @@ sub configure { $urpm->add_distrib_media("Virtual", $options{usedistrib}, %options, 'virtual' => 1); } else { $urpm->read_config(%options); + if (!$options{media} && $urpm->{options}{'default-media'}) { + $options{media} = $urpm->{options}{'default-media'}; + } } if ($options{media}) { delete $_->{modified} foreach @{$urpm->{media} || []}; - $urpm->select_media(split ',', $options{media}); + $urpm->select_media(split /,/, $options{media}); foreach (grep { !$_->{modified} } @{$urpm->{media} || []}) { #- this is only a local ignore that will not be saved. $_->{ignore} = 1; @@ -527,7 +531,7 @@ sub configure { } if ($options{excludemedia}) { delete $_->{modified} foreach @{$urpm->{media} || []}; - $urpm->select_media(split ',', $options{excludemedia}); + $urpm->select_media(split /,/, $options{excludemedia}); foreach (grep { $_->{modified} } @{$urpm->{media} || []}) { #- this is only a local ignore that will not be saved. $_->{ignore} = 1; diff --git a/urpm/cfg.pm b/urpm/cfg.pm index 6e5f2809..581c4fa8 100644 --- a/urpm/cfg.pm +++ b/urpm/cfg.pm @@ -152,6 +152,7 @@ sub load_config ($;$) { |prohibit-remove |downloader |retry + |default-media |(?:curl|rsync|wget)-options )\s*:\s*['"]?(.*?)['"]?$/x and $config{$medium}{$1} = $2, next; |