Scanning the dpkg-query code I think the first instance (dpkg-query --search) is redundant. The history behind it is that the output from dpkg-query for *diverted files* is localized and in the code this originally came from I needed to avoid that localization. However, we're not concerned with diverted files here, and I see the output for non-diverted files doesn't involve localization so there's no need to avoid it.
The second instance (dpkg-query --show) is *possibly* redundant and has to do with whether the db:Status field is localized (or potentially could be) in output. If it's not, then it's redundant. Still, you are correct; I guess LC_ALL would be the better catch-all here (though there's something nagging in my memory about dangers of using LC_ALL)?
Scanning the dpkg-query code I think the first instance (dpkg-query --search) is redundant. The history behind it is that the output from dpkg-query for *diverted files* is localized and in the code this originally came from I needed to avoid that localization. However, we're not concerned with diverted files here, and I see the output for non-diverted files doesn't involve localization so there's no need to avoid it.
The second instance (dpkg-query --show) is *possibly* redundant and has to do with whether the db:Status field is localized (or potentially could be) in output. If it's not, then it's redundant. Still, you are correct; I guess LC_ALL would be the better catch-all here (though there's something nagging in my memory about dangers of using LC_ALL)?