Re: how to detect Atomic Rawhide?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Di, 16.10.18 16:03, Miroslav Suchý (msuchy@xxxxxxxxxx) wrote:

> Hi,
> in DNF's Copr plugin we are detecting whether you are running in Rawhide or not, so we can enable you rawhide chroot (or
> numbered).
> 
> We use this code:
> 
>   import distro
>   distro.linux_distribution(full_distribution_name=False)
> 
> which returns triplet:
>   ('Fedora', '30', 'Rawhide')
>   ('Fedora', '29', 'Workstation Edition')
> 
> where the third string is taken from /etc/os-release
>   VERSION="30 (Rawhide)"
>   VERSION="29 (Workstation Edition)"
> 
> it is the string in parentheses. If there is a rawhide, we think that the system is rawhide. But...
> 
> Apparently Cloud edition contains:
>   VERSION="30 (Cloud Edition)"
>   REDHAT_BUGZILLA_PRODUCT="Fedora"
>   REDHAT_BUGZILLA_PRODUCT_VERSION=rawhide
>   VARIANT="Cloud Edition"
> 
> and Atomic has:
>   VERSION="30 (Atomic Host)"
>   REDHAT_BUGZILLA_PRODUCT="Fedora"
>   REDHAT_BUGZILLA_PRODUCT_VERSION=rawhide
>   VARIANT="Atomic Host"
> 
> The documentaion of os-release is very tolerant. Quoting from
> https://www.freedesktop.org/software/systemd/man/os-release.html
> 
> VERSION=
>     A string identifying the operating system version, excluding any OS name information, possibly including a release
> code name, and suitable for presentation to the user. This field is optional. Example: "VERSION=17" or "VERSION="17
> (Beefy Miracle)"".

Quite frankly, you are doing it wrong. $VERSION is for display
purposes. $VERSION_ID is for processing by code.

Similar, $VARIANT is for display purposes, and $VARIANT_ID for
processing by code.

The man page is pretty explicit about this, no? How can we make this clearer?

Lennart

-- 
Lennart Poettering, Red Hat
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux