distro icon indicating copy to clipboard operation
distro copied to clipboard

the distro.id() report different id other than lsb_release on CentosStream

Open braindevices opened this issue 5 years ago • 1 comments

version: 1.4.0 lsb_release -i -s is CentOSStream. But distro.id() is centos. The distro.version() is report as 8. There seems no way to distinguish the centos8-stream and centos8, except using the distro.name().

braindevices avatar Jan 09 '21 14:01 braindevices

Hi @braindevices, sorry for the delay.

I don't want to answer for the whole team, but here are my thoughts on this issue :

  • distro prefers (normalized) OS-RELEASE identifier shipped by distribution, and only falls back on lsb_release when the former is not available (see Background) ;
  • this might be an upstream issue if distribution ids differ between OS-RELEASE and lsb_release output ;
  • the underlying question is : Do CentOS developers consider CentOS Stream as a different distribution from CentOS (in OS-RELEASE terms) ?

Below is a short Python snippet developers may use to handle CentOS Stream if they need to :

import distro

is_centos_stream = distro.id() == "centos" and distro.version() >= "8"
if is_centos_stream:
    # ...

Thanks for your time, tell us if we could close this issue or not. Bye :wave:

HorlogeSkynet avatar Feb 06 '22 10:02 HorlogeSkynet

Closing here due to age, please re-open if distro is actually failing to do its job/this is not an upstream issue 🙏

HorlogeSkynet avatar Oct 09 '22 16:10 HorlogeSkynet