Skip to content

Commit

Permalink
Merge pull request #215 from future-architect/lang-to-language
Browse files Browse the repository at this point in the history
Fix locale env var LANG to LANGUAGE
  • Loading branch information
kotakanbe authored Oct 12, 2016
2 parents 738ccf7 + cf7990d commit b964d19
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions scan/debian.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func (o *debian) fillCandidateVersion(before models.PackageInfoList) (filled []m
for _, p := range before {
names = append(names, p.Name)
}
cmd := fmt.Sprintf("LANG=en_US.UTF-8 apt-cache policy %s", strings.Join(names, " "))
cmd := fmt.Sprintf("LANGUAGE=en_US.UTF-8 apt-cache policy %s", strings.Join(names, " "))
r := o.ssh(cmd, sudo)
if !r.isSuccess() {
return nil, fmt.Errorf("Failed to SSH: %s.", r)
Expand All @@ -323,7 +323,7 @@ func (o *debian) fillCandidateVersion(before models.PackageInfoList) (filled []m
}

func (o *debian) GetUpgradablePackNames() (packNames []string, err error) {
cmd := util.PrependProxyEnv("LANG=en_US.UTF-8 apt-get upgrade --dry-run")
cmd := util.PrependProxyEnv("LANGUAGE=en_US.UTF-8 apt-get upgrade --dry-run")
r := o.ssh(cmd, sudo)
if r.isSuccess(0, 1) {
return o.parseAptGetUpgrade(r.Stdout)
Expand Down
6 changes: 3 additions & 3 deletions scan/redhat.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func (o *redhat) scanUnsecurePackages() ([]CvePacksInfo, error) {

// For CentOS
func (o *redhat) scanUnsecurePackagesUsingYumCheckUpdate() (CvePacksList, error) {
cmd := "LANG=en_US.UTF-8 yum --color=never check-update"
cmd := "LANGUAGE=en_US.UTF-8 yum --color=never check-update"
r := o.ssh(util.PrependProxyEnv(cmd), sudo)
if !r.isSuccess(0, 100) {
//returns an exit code of 100 if there are available updates.
Expand Down Expand Up @@ -547,7 +547,7 @@ func (o *redhat) getAllChangelog(packInfoList models.PackageInfoList) (stdout st
}

// yum update --changelog doesn't have --color option.
command += fmt.Sprintf(" LANG=en_US.UTF-8 yum update --changelog %s", packageNames)
command += fmt.Sprintf(" LANGUAGE=en_US.UTF-8 yum update --changelog %s", packageNames)

r := o.ssh(command, sudo)
if !r.isSuccess(0, 1) {
Expand Down Expand Up @@ -589,7 +589,7 @@ func (o *redhat) scanUnsecurePackagesUsingYumPluginSecurity() (CvePacksList, err

// get package name, version, rel to be upgrade.
// cmd = "yum check-update --security"
cmd = "LANG=en_US.UTF-8 yum --color=never check-update"
cmd = "LANGUAGE=en_US.UTF-8 yum --color=never check-update"
r = o.ssh(util.PrependProxyEnv(cmd), o.sudo())
if !r.isSuccess(0, 100) {
//returns an exit code of 100 if there are available updates.
Expand Down

0 comments on commit b964d19

Please sign in to comment.