Skip to content

Commit

Permalink
Adds detection for CentOS Stream, improves detection for CentOS, Roku…
Browse files Browse the repository at this point in the history
… OS (matomo-org#7070)

* Improves detection for Roku OS
* Adds detection for CentOS Stream
* Improves version detection for CentOS
  • Loading branch information
liviuconcioiu authored Mar 30, 2022
1 parent 4aa8610 commit 1eb1fcf
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Parser/OperatingSystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class OperatingSystem extends AbstractParser
'BMP' => 'Brew',
'CAI' => 'Caixa Mágica',
'CES' => 'CentOS',
'CST' => 'CentOS Stream',
'CLR' => 'ClearOS Mobile',
'COS' => 'Chrome OS',
'CRS' => 'Chromium OS',
Expand Down Expand Up @@ -191,7 +192,7 @@ class OperatingSystem extends AbstractParser
'RHT', 'VLN', 'MDR', 'GNT', 'SAB', 'SLW', 'SSE', 'CES', 'BTR', 'SAF',
'ORD', 'TOS', 'RSO', 'DEE', 'FRE', 'MAG', 'FEN', 'CAI', 'PCL', 'HAS',
'LOS', 'DVK', 'ROK', 'OWR', 'OTV', 'KTV', 'PUR', 'PLA', 'FUC', 'PAR',
'FOR', 'MON', 'KAN', 'ZEN', 'LND', 'LNS', 'CHN', 'AMZ', 'TEN',
'FOR', 'MON', 'KAN', 'ZEN', 'LND', 'LNS', 'CHN', 'AMZ', 'TEN', 'CST',
],
'Mac' => ['MAC'],
'Mobile Gaming Console' => ['PSP', 'NDS', 'XBX'],
Expand Down
36 changes: 34 additions & 2 deletions Tests/Parser/fixtures/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3365,13 +3365,45 @@
name: TencentOS
short_name: TEN
version: 4.14.105
platform: ""
platform:
family: GNU/Linux
-
user_agent: Mozilla/5.0 (Linux; Android 10; bliss_maple) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.58 Mobile Safari/537.36
os:
name: Bliss OS
short_name: BOS
version: "12"
platform: ""
platform:
family: Android
-
user_agent: Roku/DVP (297.70E04154A)
os:
name: Roku OS
short_name: ROK
version:
platform:
family: GNU/Linux
-
user_agent: libdnf (CentOS Stream 8; generic; Linux.x86_64)
os:
name: CentOS Stream
short_name: CST
version: "8"
platform: x64
family: GNU/Linux
-
user_agent: libdnf (CentOS Stream 9; generic; Linux.x86_64)
os:
name: CentOS Stream
short_name: CST
version: "9"
platform: x64
family: GNU/Linux
-
user_agent: libdnf (CentOS Linux 8; generic; Linux.x86_64)
os:
name: CentOS
short_name: CES
version: "8"
platform: x64
family: GNU/Linux
10 changes: 9 additions & 1 deletion regexes/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@
name: 'Roku OS'
version: '$1'

- regex: 'Roku(?:OS)?/(?:DVP|Pluto)?-?(\d+[\.\d]+)'
- regex: 'Roku(?:OS)?/(?:DVP|Pluto)?-?(\d+[\.\d]+)?'
name: 'Roku OS'
version: '$1'

Expand Down Expand Up @@ -435,10 +435,18 @@
name: 'VectorLinux'
version: '$1'

- regex: 'CentOS Stream (\d)'
name: 'CentOS Stream'
version: '$1'

- regex: '.+.el(\d+(?:[_\.]\d+)*).(?:centos|x86_64)'
name: 'CentOS'
version: '$1'

- regex: 'CentOS Linux (\d)'
name: 'CentOS'
version: '$1'

- regex: 'Linux; .*((?:Debian|Knoppix|Mint|Ubuntu|Kubuntu|Xubuntu|Lubuntu|Fedora|Red Hat|Mandriva|Gentoo|Sabayon|Slackware|SUSE|CentOS|BackTrack))[ /](\d+[\.\d]+)'
name: '$1'
version: '$2'
Expand Down

0 comments on commit 1eb1fcf

Please sign in to comment.