Skip to content

Commit 87e7dce

Browse files
Guillem CANALWilliam Blankenship
Guillem CANAL
authored and
William Blankenship
committed
fix: os-release should be checked last because it's mostly present in every Linux distribution (#88)
1 parent c58eef6 commit 87e7dce

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

os.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"/etc/debian_version" : ["Debian"],
88
"/etc/debian_release" : ["Debian"],
99
"/etc/arch-release" : ["Arch Linux"],
10-
"/etc/os-release": ["Raspbian"],
1110
"/etc/NIXOS": ["NixOS"],
1211
"/etc/annvix-release" : ["Annvix"],
1312
"/etc/arklinux-release" : ["Arklinux"],
@@ -50,5 +49,6 @@
5049
"/etc/va-release" : ["VA-Linux/RH-VALE"],
5150
"/etc/yellowdog-release" : ["Yellow Dog"],
5251
"/etc/alpine-release": ["Alpine Linux"],
53-
"/etc/system-release": ["Amazon Linux"]
52+
"/etc/system-release": ["Amazon Linux"],
53+
"/etc/os-release": ["Raspbian"]
5454
}

tests/mockdata.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
, { "desc": "RHEL 6.6", "platform": "linux", "file": { "/etc/redhat-release": "Red Hat Enterprise Linux Server release 6.6 (Santiago)\n" }, "expected": { "codename": "santiago", "dist": "Red Hat Linux", "os": "linux", "release": "6.6" } }
1313
, { "desc": "RHEL 7.0", "platform": "linux", "file": { "/etc/redhat-release": "Red Hat Enterprise Linux Server release 7.0 (Maipo)\n" }, "expected": { "codename": "maipo", "dist": "Red Hat Linux", "os": "linux", "release": "7.0" } }
1414
, { "desc": "SUSE Linux", "platform": "linux", "file": { "/etc/SuSE-release": "SUSE Linux Enterprise Server 11 (x86_64)\nVERSION = 11\nPATCHLEVEL = 4\n" }, "expected": { "dist": "SUSE Linux", "os": "linux", "release": "11" } }
15-
, { "desc": "Alpine Linux", "platform": "linux", "file": { "/etc/alpine-release": "3.3\n" }, "expected": { "dist": "Alpine Linux", "os": "linux", "release": "3.3" } }
15+
, { "desc": "Alpine Linux", "platform": "linux", "file": { "/etc/alpine-release": "3.3\n", "/etc/os-release": "NAME=\"Alpine Linux\"\nID=alpine\nVERSION_ID=3.9.2\nPRETTY_NAME=\"Alpine Linux v3.9\"\nHOME_URL=\"https://alpinelinux.org/\"\nBUG_REPORT_URL=\"https://bugs.alpinelinux.org/\"\n" }, "expected": { "dist": "Alpine Linux", "os": "linux", "release": "3.3" } }
1616
, { "desc": "Amazon Linux", "platform": "linux", "file": { "/etc/system-release": "Amazon Linux AMI release 2016.03"}, "expected": {"dist": "Amazon Linux", "os": "linux", "release": "2016.03"}}
1717
, { "desc": "Arch Linux", "platform": "linux", "file": { "/etc/lsb-release": "LSB_VERSION=1.4\nDISTRIB_ID=Arch\nDISTRIB_RELEASE=rolling\nDISTRIB_DESCRIPTION=\"Arch Linux\""}, "expected": {"dist": "Arch Linux", "os": "linux", "release": "rolling"}}
1818
, { "desc": "Linux Mint", "platform": "linux", "file": { "/etc/lsb-release": "DISTRIB_ID=LinuxMint\nDISTRIB_RELEASE=18\nDISTRIB_CODENAME=sarah\nDISTRIB_DESCRIPTION=\"Linux Mint 18 Sarah\""}, "expected": {"dist": "Linux Mint", "os": "linux", "codename": "sarah", "release": "18"}}

0 commit comments

Comments
 (0)