Obsolete CentOS5

This commit is contained in:
Kota Kanbe
2017-03-13 16:50:47 +09:00
parent a5c4c682f5
commit cc7d3dc2aa
3 changed files with 18 additions and 6 deletions

View File

@@ -151,7 +151,6 @@ func (o *redhat) checkIfSudoNoPasswd() error {
return nil
}
// CentOS 5 ... yum-changelog
// CentOS 6, 7 ... yum-plugin-changelog
// RHEL 5 ... yum-security
// RHEL 6, 7 ... -
@@ -169,12 +168,25 @@ func (o *redhat) checkDependencies() error {
return fmt.Errorf(msg)
}
if o.Distro.Family == "centos" {
if majorVersion < 6 {
msg := fmt.Sprintf("CentOS %s is not supported", o.Distro.Release)
o.log.Errorf(msg)
return fmt.Errorf(msg)
}
// --assumeno option of yum is needed.
cmd := "yum -h | grep assumeno"
if r := o.exec(cmd, noSudo); !r.isSuccess() {
msg := fmt.Sprintf("Installed yum is old. Please update yum and then retry")
o.log.Errorf(msg)
return fmt.Errorf(msg)
}
}
switch o.Distro.Family {
case "centos":
packName = "yum-plugin-changelog"
if majorVersion < 6 {
packName = "yum-changelog"
}
case "rhel":
if majorVersion < 6 {
packName = "yum-security"