From 3e1dd843eac8e8a3f1a06b78fbbb30300b493d7b Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Tue, 4 Mar 2003 18:03:48 +0000 Subject: yoyotte experimentation. --- urpmi | 36 +++++++++++++++++------------------- urpmi.spec | 8 ++++++-- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/urpmi b/urpmi index 8fb1e04d..feefdb55 100755 --- a/urpmi +++ b/urpmi @@ -116,6 +116,16 @@ usage: exit(0); } +sub to_utf8 { Locale::gettext::iconv($_[0], undef, "UTF-8") } +sub gmessage { + my ($msg, %params) = @_; + my $ok = to_utf8(_("Ok")); + my $cancel = to_utf8(_("Cancel")); + my $buttons = $params{ok_only} ? "$ok:0" : "$ok:0,$cancel:2"; + $msg = to_utf8($msg); + `gmessage -default "$ok" -buttons "$buttons" "$msg"`; +} + #- parse arguments list. my @nextargv; my $command_line = join " ", @ARGV; @@ -370,9 +380,7 @@ if (%{$state->{ask_unselect} || {}}) { my $list = join "\n", map { scalar $urpm->{depslist}[$_]->fullname } keys %{$state->{ask_unselect}}; my $msg = _("Some package requested cannot be installed:\n%s\ndo you agree ?", $list); if ($X) { - my $ok = _("Ok"); - my $cancel = _("Cancel"); - `gmessage -default "$ok" -buttons "$ok:0,$cancel:2" "$msg"`; + gmessage($msg); $? and exit 0; } else { $noexpr = _("Nn"); @@ -412,9 +420,7 @@ if (%{$state->{ask_remove} || {}}) { } sort { $a cmp $b } keys %{$state->{ask_remove}}; my $msg = _("The following packages have to be removed for others to be upgraded:\n%s\ndo you agree ?", $list); if ($X) { - my $ok = _("Ok"); - my $cancel = _("Cancel"); - `gmessage -default "$ok" -buttons "$ok:0,$cancel:2" "$msg"`; + gmessage($msg); $? and exit 0; } else { $noexpr = _("Nn"); @@ -461,9 +467,7 @@ if (@root_only) { my $msg2 = _("Is this OK?"); my $p = join "\n", @to_install; if ($X) { - my $ok = _("Ok"); - my $cancel = _("Cancel"); - `gmessage -default "$ok" -buttons "$ok:0,$cancel:2" "$msg:\n$p\n\n$msg2"`; + gmessage("$msg:\n$p\n\n$msg2"); $? and exit 0; } else { $noexpr = _("Nn"); @@ -503,10 +507,8 @@ my %sources = $urpm->download_source_packages($local_sources, $list, my $msg = _("Please insert the medium named \"%s\" on device [%s]", @_); my $msg2 = _("Press Enter when ready..."); if ($X) { - my $ok = _("Ok"); - my $cancel = _("Cancel"); $msg =~ s/"/\\"/g; - `gmessage -default "$ok" -buttons "$ok:0,$cancel:2" "$msg"`; + gmessage($msg); !$?; } else { defined message_input("$msg\n$msg2 "); @@ -530,9 +532,7 @@ if ($urpm->{options}{'verify-rpm'}) { exit 1; } else { if ($X) { - my $ok = _("Ok"); - my $cancel = _("Cancel"); - `gmessage -default "$cancel" -buttons "$ok:0,$cancel:2" "$msg:\n$p\n\n$msg2"`; + gmessage("$msg:\n$p\n\n$msg2"); $? and exit 1; } else { $noexpr = _("Nn"); @@ -660,8 +660,7 @@ sub log_it { sub message { my ($msg, $noX) = @_; if ($X && !$noX && !$auto) { - my $ok = _("Ok"); - `gmessage -default "$ok" -buttons "$ok" "$msg"`; + gmessage($msg, ok_only => 1); $bug and log_it($msg); } else { if ($bug) { @@ -675,8 +674,7 @@ sub message_input { my ($msg, $default_input) = @_; if ($X && !default_input) { #- if a default input is given, the user doesn't have to choose (and being asked). - my $ok = _("Ok"); - `gmessage -default "$ok" -buttons "$ok" "$msg"`; + gmessage($msg, ok_only => 1); $bug and log_it($msg); } else { if ($bug) { diff --git a/urpmi.spec b/urpmi.spec index 930237dd..da4d27be 100644 --- a/urpmi.spec +++ b/urpmi.spec @@ -2,14 +2,14 @@ Name: urpmi Version: 4.2 -Release: 27mdk +Release: 28mdk License: GPL Source0: %{name}.tar.bz2 Source1: %{name}.logrotate Summary: User mode rpm install URL: http://cvs.mandrakesoft.com/cgi-bin/cvsweb.cgi/soft/urpmi Requires: eject webfetch perl-DateManip >= 5.40 gnupg -PreReq: perl-Locale-gettext rpmtools >= 4.3-6mdk perl-URPM >= 0.81 +PreReq: perl-Locale-gettext >= 1.01-7mdk rpmtools >= 4.3-6mdk perl-URPM >= 0.81 BuildRequires: bzip2-devel gettext rpm-devel >= 4.0.3 BuildRoot: %{_tmppath}/%{name}-buildroot BuildArch: noarch @@ -206,6 +206,10 @@ fi %changelog +* Tue Mar 4 2003 Guillaume Cottenceau 4.2-28mdk +- fixed french translations. +- fix bug 2680. + * Mon Mar 3 2003 François Pons 4.2-27mdk - avoid mounting or unmounting a supermounted device. - updated french translations (some from Thévenet Cédric). -- cgit v1.2.1