Hi!

On Mon, 2023-01-09 at 11:59:17 +0100, Jakub Wilk wrote:
> Package: dpkg
> Version: 1.21.17

> The dpkg-query(1) man page says about the -S option:
> 
> > Hint: When machine parsing the output, it is customary to set the locale
> > to C.UTF-8 to get reproducible results.
> 
> Assuming that "set the locale" means setting the LC_ALL environment
> variable, then that's not sufficient, because the output is still affected
> by LANGUAGE:

I worded that hint vaguely so that I would not need to give details
about system specific quirks. :) In my mind "set the locale" implies
do whatever is necessary so set any locale stuff so that it does not
affect the output. Do you think it would have been more clear to say
instead something like "set the locale and language to C.UTF-8" or
similar?

>    $ LC_ALL=C.UTF-8 dpkg -S /bin/zgrep
>    diversion by zutils from: /bin/zgrep
>    diversion by zutils to: /bin/zgrep.gzip
>    gzip, zutils: /bin/zgrep
> 
>    $ LANGUAGE=pl LC_ALL=C.UTF-8 dpkg -S /bin/zgrep
>    ominięcie przez zutils z: /bin/zgrep
>    ominięcie przez zutils do: /bin/zgrep.gzip
>    gzip, zutils: /bin/zgrep
> 
> See also bug #748215.

(While I think I might have been aware of the precedence at some point
in time, that might not have properly sink in, as I see several
instances in the code setting LC_ALL but not LANGUAGE (in some cases
LANG instead which perhaps were a typo for LANGUAGE), so I'll be
fixing this in the code in the future. Thanks for the pointer!)

Thanks,
Guillem

Reply via email to