diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-06-24 03:13:35 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-06-24 03:13:35 +0000 |
commit | e3dbb6fabf87a132b95e1210be30c5454099ac31 (patch) | |
tree | 9204aec29fd8b44790514434c7c19a6165082644 | |
parent | 35ca26da6599faf3c677c16171734f905c4d8fc1 (diff) | |
download | urpmi-e3dbb6fabf87a132b95e1210be30c5454099ac31.tar urpmi-e3dbb6fabf87a132b95e1210be30c5454099ac31.tar.gz urpmi-e3dbb6fabf87a132b95e1210be30c5454099ac31.tar.bz2 urpmi-e3dbb6fabf87a132b95e1210be30c5454099ac31.tar.xz urpmi-e3dbb6fabf87a132b95e1210be30c5454099ac31.zip |
Handle quoted option values
-rw-r--r-- | t/cfg.t | 10 | ||||
-rw-r--r-- | urpm/cfg.pm | 4 |
2 files changed, 9 insertions, 5 deletions
@@ -18,7 +18,7 @@ update\\ 1 http://foo/bar/ { compress: 1 fuzzy: 1 keep: yes - key-ids: 123 + key-ids: "123" update verify-rpm: yes } @@ -26,8 +26,8 @@ update\\ 1 http://foo/bar/ { update_2 ftp://foo/bar/ { hdlist: hdlist.update2.cz ignore - key_ids: 456 - priority-upgrade: kernel + key_ids: 456 789 + priority-upgrade: 'kernel' synthesis with_hdlist: hdlist.update2.cz } @@ -40,9 +40,13 @@ ok( ref $config, 'config loaded' ); ok( urpm::cfg::dump_config($file.2, $config), 'config written' ); +# things that have been tidied up by dump_config $cfgtext =~ s/\byes\b/1/g; $cfgtext =~ s/\bno\b/0/g; $cfgtext =~ s/\bkey_ids\b/key-ids/g; +$cfgtext =~ s/"123"/123/g; +$cfgtext =~ s/'kernel'/kernel/g; + my $cfgtext2 = cat_($file.2); $cfgtext2 =~ s/# generated.*\n//; is( $cfgtext, $cfgtext2, 'config is the same' ) diff --git a/urpm/cfg.pm b/urpm/cfg.pm index 2dd3a062..b6610c71 100644 --- a/urpm/cfg.pm +++ b/urpm/cfg.pm @@ -85,9 +85,9 @@ sub load_config ($) { |split-(?:level|length) |priority-upgrade |downloader - )\s*:\s*(.*)$/x + )\s*:\s*['"]?(.*?)['"]?$/x and $config{$medium}{$1} = $2, next; - /^key[-_]ids\s*:\s*(.*)$/ + /^key[-_]ids\s*:\s*['"]?(.*?)['"]?$/ and $config{$medium}{'key-ids'} = $1, next; #- positive flags /^(update|ignore|synthesis|virtual)$/ |