← Back to issue list

Don't fail over empty or faulty lines

View original Github issue

Metadata

Project
snapcraft
Number
#1570
Type
pull request
State
merged
Author
aleixpol
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #1570 to ignore empty or malformed /etc/os-release lines, including trailing blank lines, in commit bf216fd26.

Resolution: closed resolved

Reason: PR #1570 was approved and merged as commit bf216fd26, which skips os-release lines that cannot be parsed as key/value entries.

Evaluated by: mr-cal-bot

No scores available.

Issue body

If we're not going to be able to unpack it, ignore the line. This is what it looks like on Arch Linux. Note the empty line in the end: ``` $ cat /etc/os-release NAME="Arch Linux" PRETTY_NAME="Arch Linux" ID=arch ID_LIKE=archlinux ANSI_COLOR="0;36" HOME_URL="https://www.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://bugs.archlinux.org/" $ ``` ----- - [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [ ] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)? - [ ] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)? - [x] Have you successfully run `./runtests.sh static`? - [x] Have you successfully run `./runtests.sh unit`? < some tests fail but they also failed before as well

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #1570 to ignore empty or malformed /etc/os-release lines, including trailing blank lines, in commit bf216fd26.
stealth/space-bunny-alpha — closed resolved Merged a fix to ignore empty or malformed /etc/os-release lines, including Arch Linux's trailing blank line, in commit bf216fd26.
stealth/space-bunny-alpha — closed resolved Merged in canonical/snapcraft#1570, ignoring empty or malformed /etc/os-release lines to prevent parsing failures such as Arch Linux's trailing blank line.
qwen/qwen3.6-35b-a3b — — Merged. The change ignores empty or malformed lines during parsing to prevent crashes, resolving compatibility issues with files like Arch Linux's /etc/os-release. Approved by reviewers.
qwen3.6-35b-a3b-mtp-q6 — — Merged a fix that ignores empty or unparseable lines in release files like /etc/os-release instead of failing. The change prevents parsing errors from trailing whitespace or malformed entries, ensuring robust cross-distro compatibility.

Update history

No update history recorded yet.

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.
72%