fix(os_release): Properly lex an os-release file
Metadata
Current evaluation
Merged #797, replacing os-release parsing with shlex to correctly handle quoted values, empty assignments, and trailing commands.
Resolution: closed resolved
Reason: PR #797 was merged as commit aa5688f. Its shlex-based parser fixes POSIX-style quoting, preserves empty variables, and ignores commands following assignments.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Supersedes https://github.com/canonical/craft-providers/pull/790
This uses `shutil` to lex an os-release file, making it more conformant with the specification. Specifically:
1. Mid-variable quotes are now properly lexed according to posix style.
2. Empty variables are now set to the empty string
3. Commands after variable assignment are ignored.
- [x] Have you followed the guidelines for contributing?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `make lint && make test`?
---
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged #797, replacing os-release parsing with shlex to correctly handle quoted values, empty assignments, and trailing commands. | |
| qwen/qwen3.6-35b-a3b | — | closed resolved | Fixed os-release parsing to properly handle mid-variable quotes, empty variables, and trailing commands by using a proper lexer. Merged into craft-providers. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Related To:
canonical/craft-providers#790
(confidence 100%)
PR #790 was explicitly superseded by #797, which provided a broader os-release parsing fix.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #790 util: do not crash on empty os-release value | craft-providers | closed | External PR #790 (1-line guard against empty os-release values) was closed unmerged as superseded; its generalisation landed as PR #797 'fix(os_release): Properly lex an os-release file', commit aa5688f. |