Last active
June 14, 2025 11:01
-
-
Save natefoo/814c5bf936922dad97ff to your computer and use it in GitHub Desktop.
Revisions
-
natefoo revised this gist
Jan 7, 2017 . 2 changed files with 51 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,10 +14,10 @@ If you have a Linux distribution or version of a listed distribution not in this - The contents of any other `/etc/*-release` files - Any other reliable way to determine the flavor and version of your Linux distribution, especially if none of the above exist And finally, you can test the platform detection on your platform by downloading and installing (e.g. in a virtualenv) [lionshead](https://bitbucket.org/natefoo/lionshead/) and running: ```console % python -c 'import lionshead; print lionshead.get_specific_platform()' ``` e.g.: This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,49 @@ Amazon Linux ============ Amazon Linux 2016.09 -------------------- ### /etc/os-release ``` NAME="Amazon Linux AMI" VERSION="2016.09" ID="amzn" ID_LIKE="rhel fedora" VERSION_ID="2016.09" PRETTY_NAME="Amazon Linux AMI 2016.09" ANSI_COLOR="0;33" CPE_NAME="cpe:/o:amazon:linux:2016.09:ga" HOME_URL="http://aws.amazon.com/amazon-linux-ami/" ``` ### lsb-release -a `lsb_release` is not installed as part of a base system, but is available in the `redhat-lsb-core` package. ``` LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch Distributor ID: AmazonAMI Description: Amazon Linux AMI release 2016.09 Release: 2016.09 Codename: n/a ``` ### /etc/lsb-release Does not exist ### Distro-specific files */etc/system-release*: ``` Amazon Linux AMI release 2016.09 ``` ### get_specific_platform() ``` SpecificPlatform(dist='amzn', major_vers='2016.09', full_vers='2016.09', stability='stable') ``` -
natefoo revised this gist
Feb 3, 2016 . 1 changed file with 61 additions and 16 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,57 @@ Scientific Linux Scientific Linux 7 ------------------ ### /etc/os-release ``` NAME="Scientific Linux" VERSION="7.1 (Nitrogen)" ID="rhel" ID_LIKE="fedora" VERSION_ID="7.1" PRETTY_NAME="Scientific Linux 7.1 (Nitrogen)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:redhat:enterprise_linux:7.1:GA" HOME_URL="http://www.scientificlinux.org//" BUG_REPORT_URL="[email protected]" REDHAT_BUGZILLA_PRODUCT="Scientific Linux 7" REDHAT_BUGZILLA_PRODUCT_VERSION=7.1 REDHAT_SUPPORT_PRODUCT="Scientific Linux" REDHAT_SUPPORT_PRODUCT_VERSION=7.1 ``` ### lsb-release -a `lsb_release` is not installed as part of a base system, but is available in the `redhat-lsb-core` package. ``` LSB Version: :core-4.1-amd64:core-4.1-noarch Distributor ID: Scientific Description: Scientific Linux release 7.1 (Nitrogen) Release: 7.1 Codename: Nitrogen ``` ### /etc/lsb-release Does not exist ### Distro-specific files */etc/redhat-release*: ``` Scientific Linux release 7.1 (Nitrogen) ``` `/etc/sl-release` and `/etc/system-release` are symlinks to `/etc/redhat-release`. ### get_platforms() ``` ['linux_x86_64_rhel_7_1', 'linux_x86_64_rhel_7', 'linux_x86_64', 'any'] ``` Scientific Linux 6 ------------------ @@ -18,38 +68,33 @@ Does not exist `lsb_release` is not installed as part of a base system, but is available in the `redhat-lsb-core` package. ``` LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch Distributor ID: Scientific Description: Scientific Linux release 6.7 (Carbon) Release: 6.7 Codename: Carbon ``` ### /etc/lsb-release ``` LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch ``` ### Distro-specific files */etc/redhat-release*: ``` Scientific Linux release 6.7 (Carbon) ``` `/etc/system-release` is a symlink to `/etc/redhat-release`. ### get_platforms() Both with and without `lsb_release` installed: ``` ['linux_x86_64_scientific_6_7', 'linux_x86_64_scientific_6', 'linux_x86_64', 'any'] ``` -
natefoo revised this gist
Feb 3, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,7 @@ Does not exist ### lsb-release -a `lsb_release` is not installed as part of a base system, but is available in the `redhat-lsb-core` package. ``` Distributor ID: Scientific -
natefoo revised this gist
Feb 3, 2016 . 1 changed file with 55 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,55 @@ Scientific Linux ================ Scientific Linux 7 ------------------ ??? Scientific Linux 6 ------------------ ### /etc/os-release Does not exist ### lsb-release -a `lsb_release` is can be installed, I do not know if it is installed as part of a base system, but I assume that like CentOS 6, it is not. ``` Distributor ID: Scientific Description: Scientific Linux release 6.6 (Carbon) Release: 6.6 Codename: Carbon ``` ### /etc/lsb-release ``` :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch ``` ### Distro-specific files */etc/redhat-release*: ``` Scientific Linux release 6.6 (Carbon) ``` Not sure if (like CentOS) `/etc/system-release` or `/etc/centos-release` exist ### get_platforms() With `lsb_release` installed: ``` ['linux_x86_64_scientific_6_6', 'linux_x86_64_scientific_6', 'linux_x86_64', 'any'] ``` Without: ``` ['linux_x86_64_centos_6_7', 'linux_x86_64_centos_6', 'linux_x86_64', 'any'] ``` -
natefoo revised this gist
Aug 26, 2015 . 1 changed file with 57 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,57 @@ Fedora ====== Fedora 22 --------- ### /etc/os-release ``` NAME=Fedora VERSION="22 (Twenty Two)" ID=fedora VERSION_ID=22 PRETTY_NAME="Fedora 22 (Twenty Two)" ANSI_COLOR="0;34" CPE_NAME="cpe:/o:fedoraproject:fedora:22" HOME_URL="https://fedoraproject.org/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Fedora" REDHAT_BUGZILLA_PRODUCT_VERSION=22 REDHAT_SUPPORT_PRODUCT="Fedora" REDHAT_SUPPORT_PRODUCT_VERSION=22 PRIVACY_POLICY_URL=https://fedoraproject.org/wiki/Legal:PrivacyPolicy ``` ### lsb-release -a `lsb_release` is not installed as part of a base system, but is available in the `redhat-lsb-core` package. ``` Distributor ID: Fedora Description: Fedora release 22 (Twenty Two) Release: 22 Codename: TwentyTwo ``` ### /etc/lsb-release Does not exist ### Distro-specific files */etc/fedora-release*: ``` Fedora release 22 (Twenty Two) ``` `/etc/redhat-release` and `/etc/system-release` are symlinks to `/etc/fedora-release`. ### get_platforms() Tested through all 3 paths: ``` ['linux_x86_64_fedora_22', 'linux_x86_64', 'any'] ``` -
natefoo revised this gist
Aug 25, 2015 . 1 changed file with 70 additions and 24 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,63 +1,109 @@ openSUSE ======== openSUSE Tumbleweed ------------------- As of 2014-08-25 ### /etc/os-release ``` NAME=openSUSE VERSION="20150725 (Tumbleweed)" VERSION_ID="20150725" PRETTY_NAME="openSUSE 20150725 (Tumbleweed) (x86_64)" ID=opensuse ANSI_COLOR="0;32" CPE_NAME="cpe:/o:opensuse:opensuse:20150725" BUG_REPORT_URL="https://bugs.opensuse.org" HOME_URL="https://opensuse.org/" ID_LIKE="suse" ``` ### lsb_release -a `lsb_release` is not installed as part of a base system, but is available in the `lsb-release` package. It's worth noting that `lsb_release` on modern versions of openSUSE just read from `/etc/os-release`. ``` Distributor ID: openSUSE project Description: openSUSE 20150725 (Tumbleweed) (x86_64) Release: 20150725 Codename: n/a ``` ### /etc/lsb-release Does not exist ### Distro-specific files */etc/SuSE-release*: ``` openSUSE 20150725 (x86_64) VERSION = 20150725 CODENAME = Tumbleweed # /etc/SuSE-release is deprecated and will be removed in the future, use /etc/os-release instead ``` ### get_platforms() Tested via all three paths: ``` ['linux_x86_64_opensuse_20150725', 'linux_x86_64', 'any'] ``` openSUSE 13.2 ------------- ### /etc/os-release Per the [SLES 11 Release Notes](https://www.suse.com/releasenotes/x86_64/SUSE-SLES/11-SP4/), it was added in SLES 11, which I assume means it should also be in openSUSE 11+ ``` NAME=openSUSE VERSION="13.2 (Harlequin)" VERSION_ID="13.2" PRETTY_NAME="openSUSE 13.2 (Harlequin) (x86_64)" ID=opensuse ANSI_COLOR="0;32" CPE_NAME="cpe:/o:opensuse:opensuse:13.2" BUG_REPORT_URL="https://bugs.opensuse.org" HOME_URL="https://opensuse.org/" ID_LIKE="suse" ``` ### lsb_release -a `lsb_release` is not installed as part of a base system, but is available in the `lsb-release` package. ``` Distributor ID: openSUSE project Description: openSUSE 13.2 (Harlequin) (x86_64) Release: 13.2 Codename: Harlequin ``` ### /etc/lsb-release Does not exist ### Distro-specific files */etc/SuSE-release*: ``` openSUSE 13.2 (x86_64) VERSION = 13.2 CODENAME = Harlequin # /etc/SuSE-release is deprecated and will be removed in the future, use /etc/os-release instead ``` ### get_platforms() Tested via all three paths: ``` ['linux_x86_64_opensuse_13_2', 'linux_x86_64_opensuse_13', 'linux_x86_64', 'any'] ``` -
natefoo revised this gist
Aug 25, 2015 . 1 changed file with 32 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -44,4 +44,36 @@ Slackware 14.1 ``` ['linux_x86_64_slackware_14_1', 'linux_x86_64_slackware_14', 'linux_x86_64', 'any'] ``` Slackware 13.37 -------------- ### /etc/os-release Does not exist ### lsb_release -a It is not installed on (at least) a base Slackware 13.37 system. I do not know if it's available. ### /etc/lsb-release Does not exist ### Distro-specific files */etc/slackware-version*: ``` Slackware 13.37.0 ``` ### get_platforms() **Untested**, on 13.37 it should be: ``` ['linux_x86_64_slackware_13_37_0', 'linux_x86_64_slackware_13', 'linux_x86_64', 'any'] ``` -
natefoo revised this gist
Aug 25, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,7 +23,7 @@ BUG_REPORT_URL="http://www.linuxquestions.org/questions/slackware-14/" ### lsb_release -a It is not installed on (at least) a base Slackware 14.1 system. I do not know if it's available. ### /etc/lsb-release -
natefoo revised this gist
Aug 25, 2015 . 1 changed file with 47 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ Slackware ========= Slackware 14.1 -------------- ### /etc/os-release From this thread on [Slackware's linuxquestions.org forum](http://www.linuxquestions.org/questions/slackware-14/any-chance-of-slackware-including-etc-os-release-4175423210/), it's included since Slackware 14.0 ``` NAME=Slackware VERSION="14.1" ID=slackware VERSION_ID=14.1 PRETTY_NAME="Slackware 14.1" ANSI_COLOR="0;34" CPE_NAME="cpe:/o:slackware:slackware_linux:14.1" HOME_URL="http://slackware.com/" SUPPORT_URL="http://www.linuxquestions.org/questions/slackware-14/" BUG_REPORT_URL="http://www.linuxquestions.org/questions/slackware-14/" ``` ### lsb_release -a It is not installed on a base Slackware 13 system, I do not know if it's available. ### /etc/lsb-release Does not exist ### Distro-specific files */etc/slackware-version*: ``` Slackware 14.1 ``` ### get_platforms() **Untested**, on 14.1 it should be: ``` ['linux_x86_64_slackware_14_1', 'linux_x86_64_slackware_14', 'linux_x86_64', 'any'] ``` -
natefoo revised this gist
Aug 25, 2015 . 2 changed files with 63 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ I am working on adding support for building and distributing (via PyPI) Python W ## How you can help If you have a Linux distribution or version of a listed distribution not in this gist, or one of the ones I have not directly verified, I could use the following: - The contents of `/etc/os-release`, if it exists - Whether or not the `lsb_release` program is installed, and whether it's part of a "default" install This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,62 @@ SLES ==== **I have not verified this information on a SLES install, I gathered the information from the web.** SLES ---- ### /etc/os-release Per the [SLES 11 Release Notes](https://www.suse.com/releasenotes/x86_64/SUSE-SLES/11-SP4/), it was added in SLES 11. Contents for 12 from [saltstack/salt#24019](https://github.com/saltstack/salt/issues/24019): ``` NAME="SLES" VERSION="12" VERSION_ID="12" PRETTY_NAME="SUSE Linux Enterprise Server 12" ID="sles" ANSI_COLOR="0;32" CPE_NAME="cpe:/o:suse:sles:12" ``` ### lsb_release -a I do not know if `lsb_release` is part of the base system. It is available from the [lsb-release](https://www.suse.com/LinuxPackages/packageRouter.jsp?product=server&version=11&service_pack=sp1&architecture=i386&package_name=lsb-release) package. Again from salt#24019: ``` Distributor ID: SUSE LINUX Description: SUSE Linux Enterprise Server 12 Release: 12 Codename: 12 ``` ### /etc/lsb-release ??? ### Distro-specific files */etc/SuSE-release*: Again from salt#24019: ``` SUSE Linux Enterprise Server 12 (x86_64) VERSION = 12 PATCHLEVEL = 0 # This file is deprecated and will be removed in a future service pack or release. # Please check /etc/os-release for details about this release. ``` ### get_platforms() Untested, on 12 it should be: ``` ['linux_x86_64_sles_12', 'linux_x86_64', 'any'] ``` -
natefoo revised this gist
Aug 25, 2015 . 1 changed file with 63 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,63 @@ openSUSE ======== **I have not verified this information on an openSUSE install, I gathered the information from the web.** openSUSE -------- ### /etc/os-release Per the [SLES 11 Release Notes](https://www.suse.com/releasenotes/x86_64/SUSE-SLES/11-SP4/), it was added in SLES 11, which I assume means it should also be in openSUSE 11+ Contents for 13.1 from [openSUSE forums](https://forums.opensuse.org/showthread.php/492084-openSUSE-13-1-etc-SuSE-release-is-deprecated): ``` NAME=openSUSE VERSION="13.1 (Bottle)" VERSION_ID="13.1" PRETTY_NAME="openSUSE 13.1 (Bottle) (x86_64)" ID=opensuse ANSI_COLOR="0;32" CPE_NAME="cpe:/o:opensuse:opensuse:13.1" BUG_REPORT_URL="https://bugs.opensuse.org" HOME_URL="https://opensuse.org/" ID_LIKE="suse" ``` ### lsb_release -a I do not know if `lsb_release` is part of the base system. It is available from the [lsb-release](https://software.opensuse.org/package/lsb-release) package. Output on 12.1 from [openSUSE forums](https://forums.opensuse.org/showthread.php/474292-What-does-quot-lsb_release-sr-quot-return-under-Tumbleweed): ``` Distributor ID: SUSE LINUX Description: openSUSE 12.1 (x86_64) Release: 12.1 Codename: Asparagus ``` ### /etc/lsb-release ??? ### Distro-specific files */etc/SuSE-release*: From the thread on openSUSE forums about os-release: ``` openSUSE 13.1 (x86_64) VERSION = 13.1 CODENAME = Bottle ``` ### get_platforms() Untested, on 13.1 it should be: ``` ['linux_x86_64_opensuse_13_1', 'linux_x86_64_opensuse_13', 'linux_x86_64', 'any'] ``` -
natefoo revised this gist
Aug 25, 2015 . 1 changed file with 59 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,59 @@ Arch ==== **I have not verified this information on an Arch install, I gathered the information from the web.** Arch ---- ### /etc/os-release Via the [filesystem package](https://projects.archlinux.org/svntogit/packages.git/tree/trunk/os-release?h=packages/filesystem) ``` NAME="Arch Linux" ID=arch PRETTY_NAME="Arch Linux" ANSI_COLOR="0;36" HOME_URL="https://www.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://bugs.archlinux.org/" ``` ### lsb-release -a `lsb_release` is not installed as part of the base system, but is available in the [lsb-release](https://www.archlinux.org/packages/community/any/lsb-release/) package. Just guessing based on looking at the package source: ``` Distributor ID: Arch Description: Arch Linux Release: rolling Codename: ???? ``` ### /etc/lsb-release /etc/lsb-release is installed with the `lsb-release` package. I believe these would be its contents: ``` LSB_VERSION=1.4-14 DISTRIB_ID=Arch DISTRIB_RELEASE=rolling DISTRIB_DESCRIPTION="Arch Linux" ``` ### Distro-specific files */etc/arch-version*: It is an empty file, but its existence indicates that the distro is Arch. ### get_platforms() Untested, should be: ``` ['linux_x86_64_arch_rolling', 'linux_x86_64', 'any'] ``` -
natefoo revised this gist
Aug 25, 2015 . 2 changed files with 50 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,7 +27,7 @@ REDHAT_SUPPORT_PRODUCT_VERSION="7" ### lsb-release -a `lsb_release` is not installed as part of a base system, but is available in the `redhat-lsb-core` package. ``` Distributor ID: CentOS @@ -65,7 +65,7 @@ Does not exist ### lsb-release -a `lsb_release` is not installed as part of a base system, but is available in the `redhat-lsb-core` package. ``` Distributor ID: CentOS @@ -102,4 +102,48 @@ Without: ``` ['linux_x86_64_centos_6_7', 'linux_x86_64_centos_6', 'linux_x86_64', 'any'] ``` CentOS 5 -------- ### /etc/os-release Does not exist ### lsb-release -a `lsb_release` is not installed as part of a base system, but is available in the `redhat-lsb` package. ``` Distributor ID: CentOS Description: CentOS release 5.11 (Final) Release: 5.11 Codename: Final ``` ### /etc/lsb-release Does not exist ### Distro-specific files */etc/redhat-release*: ``` CentOS release 5.11 (Final) ``` ### get_platforms() With `lsb_release` installed: ``` ['linux_x86_64_centos_5_11', 'linux_x86_64_centos_5', 'linux_x86_64', 'any'] ``` Without: ``` ['linux_x86_64_centos_5_11', 'linux_x86_64_centos_5', 'linux_x86_64', 'any'] ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ BUG_REPORT_URL="https://bugs.debian.org/" ### lsb-release -a `lsb_release` is not installed as part of a base system, but is available in the `lsb-release` package. ``` Distributor ID: Debian @@ -64,7 +64,7 @@ BUG_REPORT_URL="https://bugs.debian.org/" ### lsb-release -a `lsb_release` is not installed as part of a base system, but is available in the `lsb-release` package. ``` Distributor ID: Debian @@ -110,7 +110,7 @@ BUG_REPORT_URL="http://bugs.debian.org/" ### lsb-release -a `lsb_release` is not installed as part of a base system, but is available in the `lsb-release` package. ``` Distributor ID: Debian @@ -146,7 +146,7 @@ Does not exist ### lsb-release -a `lsb_release` is not installed as part of a base system, but is available in the `lsb-release` package. ``` Distributor ID: Debian -
natefoo revised this gist
Aug 25, 2015 . 1 changed file with 105 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,105 @@ CentOS ====== CentOS 7 -------- ### /etc/os-release ``` NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:7" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/" CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7" ``` ### lsb-release -a `lsb_release` is not installed as part of a base system, and is included in the `redhat-lsb-core` package. ``` Distributor ID: CentOS Description: CentOS Linux release 7.1.1503 (Core) Release: 7.1.1503 Codename: Core ``` ### /etc/lsb-release Does not exist ### Distro-specific files */etc/centos-release*: ``` CentOS Linux release 7.1.1503 (Core) ``` `/etc/redhat-release` and `/etc/system-release` are symlinks to `/etc/centos-release`. ### get_platforms() ``` ['linux_x86_64_centos_7', 'linux_x86_64', 'any'] ``` CentOS 6 -------- ### /etc/os-release Does not exist ### lsb-release -a `lsb_release` is not installed as part of a base system, via the `redhat-lsb-core` package. ``` Distributor ID: CentOS Description: CentOS release 6.7 (Final) Release: 6.7 Codename: Final ``` ### /etc/lsb-release ``` LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch ``` ### Distro-specific files */etc/centos-release*: ``` CentOS release 6.7 (Final) ``` `/etc/redhat-release` and `/etc/system-release` are symlinks to `/etc/centos-release`. ### get_platforms() With `lsb_release` installed: ``` ['linux_x86_64_centos_6_7', 'linux_x86_64_centos_6', 'linux_x86_64', 'any'] ``` Without: ``` ['linux_x86_64_centos_6_7', 'linux_x86_64_centos_6', 'linux_x86_64', 'any'] ``` -
natefoo revised this gist
Aug 25, 2015 . 1 changed file with 94 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1,95 @@ Ubuntu ====== Ubuntu 14.04 (trusty) --------------------- ### /etc/os-release ``` NAME="Ubuntu" VERSION="14.04, Trusty Tahr" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 14.04 LTS" VERSION_ID="14.04" HOME_URL="http://www.ubuntu.com/" SUPPORT_URL="http://help.ubuntu.com/" BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/" ``` ### lsb-release -a `lsb_release` is installed as part of a base system, via the `lsb-release` package. ``` Distributor ID: Ubuntu Description: Ubuntu 14.04 LTS Release: 14.04 Codename: trusty ``` ### /etc/lsb-release ``` DISTRIB_ID=Ubuntu DISTRIB_RELEASE=14.04 DISTRIB_CODENAME=trusty DISTRIB_DESCRIPTION="Ubuntu 14.04 LTS" ``` ### Distro-specific files */etc/debian_version*: ``` jessie/sid ``` ### get_platforms() ``` ['linux_x86_64_ubuntu_14_04', 'linux_x86_64', 'any'] ``` Ubuntu 12.04 (precise) ---------------------- ### /etc/os-release Does not exist ### lsb-release -a `lsb_release` is installed as part of a base system, via the `lsb-release` package. ``` Distributor ID: Ubuntu Description: Ubuntu 12.04 LTS Release: 12.04 Codename: precise ``` ### /etc/lsb-release ``` DISTRIB_ID=Ubuntu DISTRIB_RELEASE=12.04 DISTRIB_CODENAME=precise DISTRIB_DESCRIPTION="Ubuntu 12.04 LTS" ``` ### Distro-specific files */etc/debian_version*: ``` wheezy/sid ``` ### get_platforms() ``` ['linux_x86_64_ubuntu_12_04', 'linux_x86_64', 'any'] ``` -
natefoo revised this gist
Aug 25, 2015 . 2 changed files with 2 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ Ubuntu ====== -
natefoo created this gist
Aug 25, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,182 @@ Debian ====== Debian stretch -------------- ### /etc/os-release Doesn't include a version or version_id, so this results in reading the distro name from `/etc/os-release` but version detection falls through to the "legacy" method of reading from `/etc/debian_version`. ``` PRETTY_NAME="Debian GNU/Linux stretch/sid" NAME="Debian GNU/Linux" ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support/" BUG_REPORT_URL="https://bugs.debian.org/" ``` ### lsb-release -a `lsb_release` is not installed as part of a base system, and is included in the `lsb-release` package. ``` Distributor ID: Debian Description: Debian GNU/Linux testing (stretch) Release: testing Codename: stretch ``` ### /etc/lsb-release Does not exist ### Distro-specific files */etc/debian_version*: ``` stretch/sid ``` ### get_platforms() ``` ['linux_x86_64_debian_stretch_sid', 'linux_x86_64', 'any'] ``` Debian 8 (jessie) ----------------- ### /etc/os-release ``` PRETTY_NAME="Debian GNU/Linux 8 (jessie)" NAME="Debian GNU/Linux" VERSION_ID="8" VERSION="8 (jessie)" ID=debian HOME_URL="http://www.debian.org/" SUPPORT_URL="http://www.debian.org/support/" BUG_REPORT_URL="https://bugs.debian.org/" ``` ### lsb-release -a `lsb_release` is not installed as part of a base system, and is included in the `lsb-release` package. ``` Distributor ID: Debian Description: Debian GNU/Linux 8.1 (jessie) Release: 8.1 Codename: jessie ``` ### /etc/lsb-release Does not exist ### Distro-specific files */etc/debian_version*: ``` 8.1 ``` ### get_platforms() ``` ['linux_x86_64_debian_8', 'linux_x86_64', 'any'] ``` Debian 7 (wheezy) ----------------- ### /etc/os-release ``` PRETTY_NAME="Debian GNU/Linux 7 (wheezy)" NAME="Debian GNU/Linux" VERSION_ID="7" VERSION="7 (wheezy)" ID=debian ANSI_COLOR="1;31" HOME_URL="http://www.debian.org/" SUPPORT_URL="http://www.debian.org/support/" BUG_REPORT_URL="http://bugs.debian.org/" ``` ### lsb-release -a `lsb_release` is not installed as part of a base system, and is included in the `lsb-release` package. ``` Distributor ID: Debian Description: Debian GNU/Linux 7.8 (wheezy) Release: 7.8 Codename: wheezy ``` ### /etc/lsb-release Does not exist ### Distro-specific files */etc/debian_version*: ``` 7.8 ``` ### get_platforms() ``` ['linux_x86_64_debian_7', 'linux_x86_64', 'any'] ``` Debian 6 (squeeze) ------------------ ### /etc/os-release Does not exist ### lsb-release -a `lsb_release` is not installed as part of a base system, and is included in the `lsb-release` package. ``` Distributor ID: Debian Description: Debian GNU/Linux 6.0.10 (squeeze) Release: 6.0.10 Codename: squeeze ``` ### /etc/lsb-release Does not exist ### Distro-specific files */etc/debian_version*: ``` 6.0.10 ``` ### get_platforms() With `lsb_release` installed: ``` ['linux_x86_64_debian_6_0_10', 'linux_x86_64_debian_6', 'linux_x86_64', 'any'] ``` Without: ``` ['linux_x86_64_debian_6_0_10', 'linux_x86_64_debian_6', 'linux_x86_64', 'any'] ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ Distribution Detection ====================== I am working on adding support for building and distributing (via PyPI) Python Wheels with C Extensions to the Python [wheel](https://wheel.readthedocs.org/) and [pip](https://pip.pypa.io/) packages. The discussion on Distutils-SIG continues, but I believe it is fairly certain that some [effort to correctly identify Linux distributions will need to be made](https://mail.python.org/pipermail/distutils-sig/2015-August/026719.html). I've begun [efforts to add this support to wheel](https://bitbucket.org/natefoo/wheel/src/tip/wheel/platform/linux.py). ## How you can help If you have a Linux distribution or version of a listed distribution not in this gist, I could use the following: - The contents of `/etc/os-release`, if it exists - Whether or not the `lsb_release` program is installed, and whether it's part of a "default" install - The output of `lsb_release -a` if installed - The contents of `/etc/lsb-release`, if it exists - The contents of any other `/etc/*-release` files - Any other reliable way to determine the flavor and version of your Linux distribution, especially if none of the above exist And finally, you can test the platform detection on your platform by downloading and installing (e.g. in a virtualenv) [my changes to wheel](https://bitbucket.org/natefoo/wheel/) and running: ```console % python -c 'import wheel.pep425tags; print wheel.pep425tags.get_platforms()' ``` e.g.: ```console % pip install -e 'hg+https://bitbucket.org/natefoo/wheel#egg=wheel' % python -c 'import wheel.pep425tags; print wheel.pep425tags.get_platforms()' ['linux_x86_64_ubuntu_14_04', 'linux_x86_64', 'any'] ``` If `lsb_release` is optional on your system and especially if `/etc/os-release` does not exist, it'd be even more helpful to run the above prior to installing `lsb_release`, and again afterward.