summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-06-25 06:52:42 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-06-25 06:52:42 +0000
commita0d6dc498b1d74c986c8ae143d9dd663b0b61d67 (patch)
tree4f9db011f9008308ab27ff98f19ce6dc8b559908 /urpm.pm
parent2097f0f18e1362d5e020cefbdbf304ca8754c076 (diff)
downloadurpmi-a0d6dc498b1d74c986c8ae143d9dd663b0b61d67.tar
urpmi-a0d6dc498b1d74c986c8ae143d9dd663b0b61d67.tar.gz
urpmi-a0d6dc498b1d74c986c8ae143d9dd663b0b61d67.tar.bz2
urpmi-a0d6dc498b1d74c986c8ae143d9dd663b0b61d67.tar.xz
urpmi-a0d6dc498b1d74c986c8ae143d9dd663b0b61d67.zip
Don't write in urpmi.cfg the options set via the command-line of urpmi.
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm17
1 files changed, 10 insertions, 7 deletions
diff --git a/urpm.pm b/urpm.pm
index ff039af0..603fe881 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -166,6 +166,9 @@ sub read_config {
}
}
close $md5sum;
+
+ #- remember global options for write_config
+ $urpm->{global_config} = $config->{''};
}
#- probe medium to be used, take old medium into account too.
@@ -295,15 +298,15 @@ sub write_config {
#- avoid trashing exiting configuration if it wasn't loaded
$urpm->{media} or return;
- my $config = {};
- #- TODO options set via the command-line shouldn't be taken into account
- while (my ($k, $v) = each %{$urpm->{options} || {}}) {
- $config->{''}{$k} = $v;
- }
+ my $config = {
+ #- global config options found in the config file, without the ones
+ #- set from the command-line
+ '' => $urpm->{global_config},
+ };
foreach my $medium (@{$urpm->{media}}) {
my $medium_name = $medium->{name};
$config->{$medium_name}{url} = $medium->{clear_url};
- foreach (qw(hdlist with_hdlist list removable key-ids priority-upgrade update ignore synthesis modified virtual)) {
+ foreach (qw(hdlist with_hdlist list removable key-ids priority-upgrade update ignore synthesis virtual)) {
defined $medium->{$_} and $config->{$medium_name}{$_} = $medium->{$_};
}
}
@@ -383,7 +386,7 @@ sub configure {
$options{media} || $options{excludemedia} || $options{sortmedia} || $options{update} || $options{parallel} and
$urpm->{fatal}(1, N("--synthesis cannot be used with --media, --excludemedia, --sortmedia, --update or --parallel"));
$urpm->parse_synthesis($options{synthesis});
- #- synthesis disable the split of transaction (too risky and not usefull).
+ #- synthesis disables the split of transaction (too risky and not useful).
$urpm->{options}{'split-length'} = 0;
}
} else {