Re: [PATCH 2/2] Reimplement dpkg-divert in C
- To: debian-dpkg@lists.debian.org
- Subject: Re: [PATCH 2/2] Reimplement dpkg-divert in C
- From: Guillem Jover <guillem@debian.org>
- Date: Thu, 19 Nov 2009 08:23:00 +0100
- Message-id: <[🔎] 20091119072300.GB22306@gaara.hadrons.org>
- Mail-followup-to: debian-dpkg@lists.debian.org
- In-reply-to: <871vkyqyu8.fsf@vertex.dottedmag.net>
- References: <1255462605-26799-1-git-send-email-dottedmag@dottedmag.net> <1255462605-26799-2-git-send-email-dottedmag@dottedmag.net> <1255462605-26799-3-git-send-email-dottedmag@dottedmag.net> <20091017000547.GC28270@gaara.hadrons.org> <871vkyqyu8.fsf@vertex.dottedmag.net>
Hi!
On Tue, 2009-10-20 at 15:00:31 +0700, Mikhail Gusarov wrote:
> Twas brillig at 02:05:47 17.10.2009 UTC+02 when guillem@debian.org did gyre and gimble:
>
> >> + varbufaddstr(ret, "any ");
> >> +
> >> + varbufaddstr(ret, "diversion of ");
> >> + varbufaddstr(ret, file);
> >> +
> >> + if (divertto) {
> >> + varbufaddstr(ret, " to ");
> >> + varbufaddstr(ret, divertto);
> >> + }
> >> +
> >> + if (package && strcmp(package, ":") != 0) {
> >> + varbufaddstr(ret, " by ");
> >> + varbufaddstr(ret, package);
> >> + }
>
> GJ> Hmm, this makes translators work pretty hard. Also carried over from
> GJ> the perl code, but as this is getting rewritten let's get it right.
>
> Is --list supposed to be only human-readable?
I'd expect so, also if anyone is actually parsing it, they should be
making sure to pass LC_ALL=C to guarantee a constant locale. And
they'd have to be prepared to parse all variants anyway.
> Then we can change output format a bit to make it more localizable (12
> similar strings like "local diversion of %s to %s by %s",
> "diversion of %s", "any diversion of %s by %s"... are localizable,
> but insane).
Yes please, also there should not be that many possibilities, check
src/query.c:searchoutput(). The package name should either be a
pointer or NULL (in case of local diversions), so the "any " does
not apply, and cannot see where it did in the perl code either.
regards,
guillem
Reply to: