@@ -12,29 +12,26 @@ sysreqs2_cmds <- utils::read.table(
1212header = TRUE ,
1313 textConnection(
1414"
15- name os distribution version update_command install_command query_command
16- 'Ubuntu Linux' linux ubuntu * 'apt-get -y update' 'apt-get -y install' dpkg-query
17- 'Debian Linux' linux debian * 'apt-get -y update' 'apt-get -y install' dpkg-query
18- 'CentOS Linux' linux centos * NA 'yum install -y' rpm
19- 'Rocky Linux' linux rockylinux * NA 'dnf install -y' rpm
20- 'Red Hat Enterprise Linux' linux redhat 6 NA 'yum install -y' rpm
21- 'Red Hat Enterprise Linux' linux redhat 7 NA 'yum install -y' rpm
22- 'Red Hat Enterprise Linux' linux redhat * NA 'dnf install -y' rpm
23- 'Red Hat Enterprise Linux' linux rhel 7.0 NA 'yum install -y' rpm
24- 'Red Hat Enterprise Linux' linux rhel 7.1 NA 'yum install -y' rpm
25- 'Red Hat Enterprise Linux' linux rhel 7.2 NA 'yum install -y' rpm
26- 'Red Hat Enterprise Linux' linux rhel 7.3 NA 'yum install -y' rpm
27- 'Red Hat Enterprise Linux' linux rhel 7.4 NA 'yum install -y' rpm
28- 'Red Hat Enterprise Linux' linux rhel 7.5 NA 'yum install -y' rpm
29- 'Red Hat Enterprise Linux' linux rhel 7.6 NA 'yum install -y' rpm
30- 'Red Hat Enterprise Linux' linux rhel 7.7 NA 'yum install -y' rpm
31- 'Red Hat Enterprise Linux' linux rhel 7.8 NA 'yum install -y' rpm
32- 'Red Hat Enterprise Linux' linux rhel 7.9 NA 'yum install -y' rpm
33- 'Red Hat Enterprise Linux' linux rhel * NA 'dnf install -y' rpm
34- 'Fedora Linux' linux fedora * NA 'dnf install -y' rpm
35- 'openSUSE Linux' linux opensuse * NA 'zypper --non-interactive install' rpm
36- 'SUSE Linux Enterprise' linux sle * NA 'zypper --non-interactive install' rpm
37- 'Alpine Linux' linux alpine * NA 'apk add --no-cache' apk
15+ name os id distribution version version_match update_command install_command query_command
16+ 'Ubuntu Linux' linux ubuntu ubuntu * NA 'apt-get -y update' 'apt-get -y install' dpkg-query
17+ 'Debian Linux' linux debian debian * NA 'apt-get -y update' 'apt-get -y install' dpkg-query
18+ 'CentOS Linux' linux centos centos * NA NA 'yum install -y' rpm
19+ 'Rocky Linux' linux rocky rockylinux * NA NA 'dnf install -y' rpm
20+ 'Rocky Linux' linux rockylinux rockylinux * NA NA 'dnf install -y' rpm
21+ 'AlmaLinux' linux almalinux almalinux * NA NA 'dnf install -y' rpm
22+ 'Red Hat Enterprise Linux' linux rhel redhat 6 major NA 'yum install -y' rpm
23+ 'Red Hat Enterprise Linux' linux rhel redhat 7 major NA 'yum install -y' rpm
24+ 'Red Hat Enterprise Linux' linux rhel redhat * NA NA 'dnf install -y' rpm
25+ 'Red Hat Enterprise Linux' linux redhat redhat 6 major NA 'yum install -y' rpm
26+ 'Red Hat Enterprise Linux' linux redhat redhat 7 major NA 'yum install -y' rpm
27+ 'Red Hat Enterprise Linux' linux redhat redhat * NA NA 'dnf install -y' rpm
28+ 'Fedora Linux' linux fedora fedora * NA NA 'dnf install -y' rpm
29+ 'openSUSE Linux' linux opensuse opensuse * NA NA 'zypper --non-interactive install' rpm
30+ 'openSUSE Linux' linux opensuse-leap opensuse * NA NA 'zypper --non-interactive install' rpm
31+ 'openSUSE Linux' linux opensuse-tumbleweed opensuse * NA NA 'zypper --non-interactive install' rpm
32+ 'SUSE Linux Enterprise' linux sles sle * NA NA 'zypper --non-interactive install' rpm
33+ 'SUSE Linux Enterprise' linux sle sle * NA NA 'zypper --non-interactive install' rpm
34+ 'Alpine Linux' linux alpine alpine * NA NA 'apk add --no-cache' apk
3835"
3936 )
4037)
@@ -43,10 +40,14 @@ find_sysreqs_platform <- function(sysreqs_platform = NULL) {
4340sysreqs_platform <- sysreqs_platform %|| %
4441 current_config()$ get(" sysreqs_platform" )
4542plt <- parse_sysreqs_platform(sysreqs_platform )
46- idx <- which(
43+ plt $ version_major <- sub(" [.].*$" ," " ,plt $ version )
44+ which(
4745sysreqs2_cmds $ os == plt $ os &
48- sysreqs2_cmds $ distribution == plt $ distribution &
49- sysreqs2_cmds $ version %in% c(" *" ,plt $ version )
46+ sysreqs2_cmds $ id == plt $ distribution &
47+ (sysreqs2_cmds $ version %in%
48+ c(" *" ,plt $ version )|
49+ sysreqs2_cmds $ version_match == " major" &
50+ sysreqs2_cmds $ version == plt $ version_major )
5051 )[1 ]
5152}
5253