summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-12-02 17:14:22 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-12-02 17:14:22 +0000
commitd781c33cc2a22272a6cb8237af4c9afb95f1cd28 (patch)
treebb26459017cf0b5ec68441761cc2af19a8d1109b
parent50f11021b4cce43e0e6f2921885d453c7fc03f3b (diff)
downloadurpmi-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.pm8
-rw-r--r--urpm/cfg.pm1
2 files changed, 7 insertions, 2 deletions
diff --git a/urpm.pm b/urpm.pm
index 34198243..9006bdb8 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -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;