Created attachment 117716 [details] minimal flatpak builder json SUMMARY The os-release file "VERSION" field is incorrectly formatted and causes parsing errors in software that tries to source it. STEPS TO REPRODUCE 1. Create a basic flatpak build json (as in http://docs.flatpak.org/en/latest/first-build.html) but specify the KDE runtime instead of the default freedesktop one. 2. In the "commands" section of the flatpak json file, add ". /etc/os-release". 3. Run the build (flatpak-builder build org.flatpak.Hello.json) OBSERVED RESULT The flatpak build exits with an error parsing the os-release file due to missing quotes. EXPECTED RESULT The flatpak should build successfully. SOFTWARE/OS VERSIONS KDE Flatpak platform 5.12 ADDITIONAL INFORMATION I've attached a json file demonstrating the problem. See "https://www.freedesktop.org/software/systemd/man/os-release.html" for details on the correct way to specify the os-release file, in particular the part that says: {{{Variable assignment values must be enclosed in double or single quotes if they include spaces, semicolons or other special characters outside of A–Z, a–z, 0–9.}}}
These are the contents I get: $ cat /etc/os-release NAME=KDE VERSION=master (Flatpak runtime) VERSION_ID=master ID=org.kde.Platform Feels like an issue upstream.
(In reply to Aleix Pol from comment #1) Yes, those contents are incorrect as per the spec. The VERSION string must be enclosed in quotes so build scripts that rely on them can source it. I don't think it is related to upstream because the freedesktop runtime (org.freedesktop.Platform, v18.08) does it with quotes: VERSION="18.08 (Flatpak runtime)"
That it works on freedesktop it doesn't mean we're doing it wrong. Bringing to upstream because I can't see what we're doing wrong. https://github.com/flatpak/flatpak-builder/issues/267
Please correct me if I am wrong but it looks to me that os-release is managed here, not generated by them. https://cgit.kde.org/flatpak-kde-runtime.git/log/os-release
You are super correct. Thanks for pointing it out.
Git commit 9f8944f85638dcea8455d8a08ae9d929b1cde99b by Aleix Pol. Committed on 31/01/2019 at 17:49. Pushed by apol into branch 'qt5.12lts'. Fix version id M +2 -2 os-release https://commits.kde.org/flatpak-kde-runtime/9f8944f85638dcea8455d8a08ae9d929b1cde99b
Hate to be a bother, but you didn't add quotes!
Git commit 5abb6e1aa6c84fb5800fc550f96474597c6dd144 by Aleix Pol. Committed on 31/01/2019 at 17:55. Pushed by apol into branch 'qt5.12lts'. Add missing quotes M +1 -1 os-release https://commits.kde.org/flatpak-kde-runtime/5abb6e1aa6c84fb5800fc550f96474597c6dd144
Thanks, we're almost there! The quotes need to be around the contents of the VERSION variable.
Git commit 5e216f64522ddbf93853cebd1ceff244f1a317f5 by Aleix Pol. Committed on 31/01/2019 at 18:18. Pushed by apol into branch 'qt5.12lts'. Add missing quotes M +1 -1 os-release https://commits.kde.org/flatpak-kde-runtime/5e216f64522ddbf93853cebd1ceff244f1a317f5
And here ^ is the reason for review requests :)