Query os-release for distro name
ClosedPublic

Authored by arojas on Jan 18 2018, 10:53 AM.

Details

Summary

Look for the distro name in /etc/os-release and /usr/lib/os-release instead of relying on the external lsb-release tool, which may not be installed on the system (it is not in Arch by default). The lsb-release method is kept as a fallback.

Test Plan

Distro name is displayed correctly in the sources list in Arch Linux without lsb-release installed

Diff Detail

Repository
R134 Discover Software Store
Lint
Lint Skipped
Unit
Unit Tests Skipped
arojas created this revision.Jan 18 2018, 10:53 AM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 18 2018, 10:53 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
arojas requested review of this revision.Jan 18 2018, 10:53 AM
apol added a comment.Jan 18 2018, 12:19 PM

Works for me.
Maybe use PRETTY_NAME? It's supposed to be prettier and it's used to display after all.

apol accepted this revision.Jan 18 2018, 12:20 PM

Please Plasma/5.12

This revision is now accepted and ready to land.Jan 18 2018, 12:20 PM
In D9960#192840, @apol wrote:

Works for me.
Maybe use PRETTY_NAME? It's supposed to be prettier and it's used to display after all.

According to https://www.freedesktop.org/software/systemd/man/os-release.html both NAME and PRETTY_NAME should be suitable for presentation to the user, the difference being that PRETTY_NAME may contain the distro version and codename. IMO NAME fits better here, but I don't mind changing it if you'd rather use PRETTY_NAME.

apol added a comment.Jan 18 2018, 1:50 PM

Then leave it as is.

This revision was automatically updated to reflect the committed changes.