Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer the VERSION_CODENAME field of os-release to parsing it from VERSION #230

Merged
merged 1 commit into from
Feb 2, 2019

Conversation

abadger
Copy link
Contributor

@abadger abadger commented Dec 12, 2018

Preferring the codename field lets distributions accurately encode their
codename preferences instead of us having to parse them from the VERSION
in ways that may be error prone.

This came up in two known instances:

  • Ubuntu 16.04 has a VERSION string of "16.04.1 LTS (Xenial Xerces)"
    and a VERSION_CODENAME (Actually UBUNTU_CODENAME because this was before Ubuntu adopted the standard) of "xenial". distro was mistakenly returning
    "xenial xerces" because of the way the VERSION string was formatted.
  • Fedora 21+ do not have a code name. Our parser was returning the
    variant because Fedora sticks the variant in parenthesis in the
    VERSION field. Fedora 30+28+ will add an empty VERSION_CODENAME field so
    that we can recognize they do not have a code name.

@sgallagher
Copy link

Fedora 30+ will add an empty VERSION_CODENAME field so that we can recognize they do not have a code name.

Just for the record, we also merged this for F28 and F29, so anyone with a fully up-to-date system will have the correct empty VERSION_CODENAME as well.

…RSION

Preferring the codename field lets distributions accurately encode their
codename preferences instead of us having to parse them from the VERSION
in ways that may be error prone.

This came up in two known instances:
* Ubuntu 16.04 has a VERSION string of "16.04.1 LTS (Xenial Xerces)"
  and a VERSION_CODENAME of "xenial".  distro was mistakenly returning
  "xenial xerces" because of the way the VERSION string was formatted.
* Fedora 21+ do not have a code name.  Our parser was returning the
  variant because Fedora sticks the variant in parenthesis in the
  VERSION field.  Fedora 28+ will add an empty VERSION_CODENAME field so
  that we can recognize they do not have a code name:
  https://src.fedoraproject.org/rpms/fedora-release/pull-request/58#
@abadger
Copy link
Contributor Author

abadger commented Dec 12, 2018

Updated the commit message to reflect that this PR will correct the codename on Fedora 28 and greater.

@nir0s
Copy link
Collaborator

nir0s commented Feb 2, 2019

This is wonderful. Thanks @abadger. Thing is, I'd rather have the ubuntu_codename specific handling a part of #186. I'm trying to avoid handling distribution specific inconsistencies within the main code.

@nir0s
Copy link
Collaborator

nir0s commented Feb 2, 2019

Hmm. Having given it some more thought, it seems like merging #186 will take a while. I'll merge this, and once the inconsistencies framework is in, we'll move this.

@nir0s nir0s merged commit 3892f32 into python-distro:master Feb 2, 2019
@abadger
Copy link
Contributor Author

abadger commented Feb 2, 2019

Cool. Makes sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants