fix(topgrade-wrapper): force LC_ALL=C for background queries (#204)

This commit is contained in:
Cyrus
2026-08-01 21:33:31 -04:00
committed by GitHub
parent 03885646d4
commit a25493bcb1
+3 -3
View File
@@ -86,7 +86,7 @@ local COUNTERS = {
{ {
key = "apt", key = "apt",
requires = "apt-get", requires = "apt-get",
signals = { "apt%-get[^\n]*upgrade", "apt[^\n]*full%-upgrade", "nala[^\n]*upgrade" }, signals = { "apt%-get[^\n]*upgrade", "apt[^\n]*full%-upgrade", "apt[^\n]*dist%-upgrade", "nala[^\n]*upgrade" },
cmd = [[apt-get -s -o Debug::NoLocking=1 upgrade 2>/dev/null | awk '/^Inst /{gsub(/[][]/,"",$3); gsub(/[()]/,"",$4); print $2"\t"$3"\t"$4}']], cmd = [[apt-get -s -o Debug::NoLocking=1 upgrade 2>/dev/null | awk '/^Inst /{gsub(/[][]/,"",$3); gsub(/[()]/,"",$4); print $2"\t"$3"\t"$4}']],
}, },
{ {
@@ -451,7 +451,7 @@ pumpQueue = function()
local counter = table.remove(queue, 1) local counter = table.remove(queue, 1)
step = tr("count." .. counter.key) step = tr("count." .. counter.key)
publish() publish()
local started = noctalia.runAsync(counter.cmd, function(result) local started = noctalia.runAsync("export LC_ALL=C; " .. counter.cmd, function(result)
-- A query that timed out or reported an error is recorded as unknown -- A query that timed out or reported an error is recorded as unknown
-- rather than zero: saying "up to date" because a mirror was down would -- rather than zero: saying "up to date" because a mirror was down would
-- be a lie. Note that most of these commands end in a filter, so their -- be a lie. Note that most of these commands end in a filter, so their
@@ -512,7 +512,7 @@ startCheck = function()
step = tr("step_planning") step = tr("step_planning")
publish() publish()
local started = noctalia.runAsync(buildCommand(true), function(result) local started = noctalia.runAsync("export LC_ALL=C; " .. buildCommand(true), function(result)
if result.timedOut then if result.timedOut then
failCheck(tr("err_dry_timeout")) failCheck(tr("err_dry_timeout"))
return return