feat(scan): Support RHEL8 (#813)

* feat(scan): Support RHEL8

* fix(scan): check if `dnf-uils` is installed
This commit is contained in:
Kota Kanbe
2019-06-14 12:28:16 +09:00
committed by GitHub
parent eb9f9680ec
commit 75fea79ac1
3 changed files with 27 additions and 6 deletions

View File

@@ -363,7 +363,11 @@ func (o *redhatBase) scanUpdatablePackages() (models.Packages, error) {
return nil, xerrors.Errorf("Failed to `yum makecache`: %w", err)
}
cmd := `repoquery --all --pkgnarrow=updates --qf="%{NAME} %{EPOCH} %{VERSION} %{RELEASE} %{REPO}"`
isDnf := o.exec(util.PrependProxyEnv(`repoquery --version | grep dnf`), o.sudo.repoquery()).isSuccess()
cmd := `repoquery --all --pkgnarrow=updates --qf='%{NAME} %{EPOCH} %{VERSION} %{RELEASE} %{REPO}'`
if isDnf {
cmd = `repoquery --upgrades --qf='%{NAME} %{EPOCH} %{VERSION} %{RELEASE} %{REPONAME}' -q`
}
for _, repo := range o.getServerInfo().Enablerepo {
cmd += " --enablerepo=" + repo
}