From 35ca26da6599faf3c677c16171734f905c4d8fc1 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Thu, 24 Jun 2004 02:44:16 +0000 Subject: I18N of error messages in urpm::cfg Normalize key_ids to key-ids --- urpm/cfg.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'urpm/cfg.pm') diff --git a/urpm/cfg.pm b/urpm/cfg.pm index 2b50c6f9..2dd3a062 100644 --- a/urpm/cfg.pm +++ b/urpm/cfg.pm @@ -41,14 +41,14 @@ Returns 1 on success, 0 on failure. our $err; -sub _syntax_error () { $err = N("syntax error in config file at line %s") } +sub _syntax_error () { $err = N("syntax error in config file at line %s", $.) } sub load_config ($) { my ($file) = @_; my %config; my $medium = undef; $err = ''; - open my $f, $file or do { $err = "Can't read $file: $!\n"; return }; + open my $f, $file or do { $err = N("unable to read config file [%s]", $file); return }; local $_; while (<$f>) { chomp; @@ -82,12 +82,13 @@ sub load_config ($) { |md5sum |limit-rate |excludepath - |key[\-_]ids |split-(?:level|length) |priority-upgrade |downloader )\s*:\s*(.*)$/x and $config{$medium}{$1} = $2, next; + /^key[-_]ids\s*:\s*(.*)$/ + and $config{$medium}{'key-ids'} = $1, next; #- positive flags /^(update|ignore|synthesis|virtual)$/ and $config{$medium}{$1} = 1, next; @@ -125,7 +126,7 @@ sub dump_config ($$) { return $a cmp $b; } keys %$config; open my $f, '>', $file or do { - $err = "Can't write to $file: $!\n"; + $err = N("unable to write config file [%s]", $file); return 0; }; print $f "# generated ".(scalar localtime)."\n"; -- cgit v1.2.1