Add -skip-broken option [CentOS only] #245

This commit is contained in:
Kota Kanbe
2016-11-07 21:22:38 +09:00
parent f95af9897b
commit 18a92fa1ca
5 changed files with 25 additions and 6 deletions

View File

@@ -126,11 +126,9 @@ func (o *redhat) checkDependencies() error {
return fmt.Errorf("Not implemented yet: %s", o.Distro)
}
var name = ""
var name = "yum-plugin-changelog"
if majorVersion < 6 {
name = "yum-changelog"
} else {
name = "yum-plugin-changelog"
}
cmd := "rpm -q " + name
@@ -548,7 +546,13 @@ func (o *redhat) getAllChangelog(packInfoList models.PackageInfoList) (stdout st
}
// yum update --changelog doesn't have --color option.
command += fmt.Sprintf(" LANGUAGE=en_US.UTF-8 yum update --changelog %s", packageNames)
if config.Conf.SkipBroken {
command += fmt.Sprintf(
" LANGUAGE=en_US.UTF-8 yum --skip-broken update --changelog %s", packageNames)
} else {
command += fmt.Sprintf(
" LANGUAGE=en_US.UTF-8 yum update --changelog %s", packageNames)
}
r := o.ssh(command, sudo)
if !r.isSuccess(0, 1) {