Bug 313079 - DrKonqi should use /etc/os-release as another way of getting Linux distribution information in addition to lsb_release
Summary: DrKonqi should use /etc/os-release as another way of getting Linux distributi...
Status: RESOLVED FIXED
Alias: None
Product: drkonqi
Classification: Applications
Component: general (show other bugs)
Version: 2.1.5
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: Jekyll Wu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-11 14:22 UTC by Jekyll Wu
Modified: 2013-05-26 21:51 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.11.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jekyll Wu 2013-01-11 14:22:42 UTC
Currently Drkonqi relies on running "lsb_release -sd" to guess the Linux distribution and thus fill the "Hardward" (confusing name) field on bugs.kde.org .

There are some problems with relying on lsb_release available on runtime :

    * Some major Linux distributions don't install lsb_release by default, or even don't provide it in official repos. Examples are Arch(in the [community] repo), Fedora(not installed by default), Gentoo(not installed by default) and Slackware (seemingly not provided at all).  That is a bit ironical considering the name and intention of lsb_release.

    * Even on distributions where lsb_release are installed by default, they are usually not considered as essential part of the system, so users can remove the package easily.

So in practice, there are enough chances that lsb_release is unavailable when DrKonqi runs. 

On the other hand, /etc/os-release[1][2], although being one new thing, has been adopted by all major Linux distributions in their latest versions AFAIK.  /etc/os-release is also seen as the essential part of the system, so users basically can't remove the package containing /etc/os-release.  That means /etc/os-release can be seen as one/the reliable source of Linux distribution information.

So I would propose adding /etc/os-release as *another* way of getting Linux distribution information in addition to the lsb_release script. It should be considered only when lsb_release is unavailable or doesn't  give useful information.

Some related links:


[1] http://www.freedesktop.org/software/systemd/man/os-release.html
[2] http://0pointer.de/blog/projects/os-release.html
[3] https://bugs.kde.org/buglist.cgi?f1=longdesc&list_id=385551&bug_severity=crash&o1=notsubstring&op_sys=Linux&query_format=advanced&rep_platform=unspecified&bug_status=UNCONFIRMED&bug_status=CONFIRMED&bug_status=ASSIGNED&bug_status=REOPENED&longdesc=Drkonqi%20&v1=Mint&longdesc_type=allwordssubstr


Reproducible: Always
Comment 1 Jekyll Wu 2013-01-11 14:27:18 UTC
Extra note: 

Although /etc/os-release is proposed by systemd, some non-systemd distributions (debian, gentoo, slackware) also have adopted it. I'm not a fan of systemd, but I agree /etc/os-release is a good idea.
Comment 2 George Kiagiadakis 2013-01-11 14:31:49 UTC
(In reply to comment #0)
> So I would propose adding /etc/os-release as *another* way of getting Linux
> distribution information in addition to the lsb_release script. It should be
> considered only when lsb_release is unavailable or doesn't  give useful
> information.

Don't propose. Implement it!
I'll be waiting for the review request... ;)
Comment 3 Jekyll Wu 2013-01-11 14:39:19 UTC
(In reply to comment #2)
> (In reply to comment #0)
> > So I would propose adding /etc/os-release as *another* way of getting Linux
> > distribution information in addition to the lsb_release script. It should be
> > considered only when lsb_release is unavailable or doesn't  give useful
> > information.
> 
> Don't propose. Implement it!
> I'll be waiting for the review request... ;)

Of course I will also start implementing it :)

Write this report so that the proposal can be easily tracked.
Comment 4 Jekyll Wu 2013-01-27 02:26:41 UTC
Git commit 215d23ea129804488dc0b8f08b6455a5840ea454 by Jekyll Wu.
Committed on 27/01/2013 at 03:23.
Pushed by jekyllwu into branch 'master'.

Use /etc/os-release as another source for Linux distribution information

This will not replace lsb_release. /etc/os-release will only be referred
to when lsb_release is not available or doesn't return good result at
runtime.

REVIEW: 108352

FIXED-IN: 4.11.0

M  +89   -38   drkonqi/systeminformation.cpp
M  +3    -0    drkonqi/systeminformation.h

http://commits.kde.org/kde-runtime/215d23ea129804488dc0b8f08b6455a5840ea454