Skip to content

pc-agents setup: repair an interrupted dpkg with no audit output; fake audit exit code; LC_ALL=C (#338 follow-ups) #349

Closed

Description

@scuttletoby

Follow-ups from the SAFE lens on #338 (#338 (comment)). Item 1 is a small regression from #338: do it first.

  1. A stopped dpkg can leave a state setup no longer repairs (fork-kit/pc-agents/sbin/pc-agents ~226-227). If dpkg stops after its last status change but before saving it, files stay in /var/lib/dpkg/updates/; dpkg --audit names nothing, so setup skips --configure -a, and apt-get install then refuses with "dpkg was interrupted" while setup shows the network advice. Every rerun hits the same wall (before pc-agents: follow-ups from the #308 lens (#321) #338 the unconditional --configure -a cleared it). Window: e.g. wsl --shutdown during unattended-upgrades. Fix: also run --configure -a when that folder holds a numbered file (what apt checks); test.
  2. The fake dpkg --audit exits 1 when it names a package (fork-kit/pc-agents/tests/fake_distro.py ~114); real dpkg exits 0 and prints the list on stdout. Make the fake match, so a gate cut to if r.returncode: goes red.
  3. No test that a network failure is not retried (sbin/pc-agents ~206): removing the lock-message check keeps all tests green (a down network would then be retried 5 minutes per step). Add one.
  4. Lock messages in another language are missed (~223): run apt/dpkg with LC_ALL=C as wsl2_walls() already does; test.
  5. Nits: "unable to lock" also matches a permission error (unlikely as root); the [experimental] regex change in start-desk.ps1 has no test.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions