From 32bb74573420ac925e793da5e63390f57f9db376 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Thu, 8 May 2014 17:11:19 +0200 Subject: [PATCH] Force LANG=C before appending rest of environment, as only first occurence is used --- builder/amazon/chroot/communicator.go | 2 +- builder/parallels/iso/host_ip_ifconfig.go | 3 +-- builder/vmware/iso/host_ip_ifconfig.go | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/builder/amazon/chroot/communicator.go b/builder/amazon/chroot/communicator.go index b6db9340b..b670d7320 100644 --- a/builder/amazon/chroot/communicator.go +++ b/builder/amazon/chroot/communicator.go @@ -89,8 +89,8 @@ func (c *Communicator) UploadDir(dst string, src string, exclude []string) error var stderr bytes.Buffer cmd := ShellCommand(cpCmd) - cmd.Env = append(cmd.Env, os.Environ()...) cmd.Env = append(cmd.Env, "LANG=C") + cmd.Env = append(cmd.Env, os.Environ()...) cmd.Stderr = &stderr err = cmd.Run() if err == nil { diff --git a/builder/parallels/iso/host_ip_ifconfig.go b/builder/parallels/iso/host_ip_ifconfig.go index bb756cec3..97b622ef2 100644 --- a/builder/parallels/iso/host_ip_ifconfig.go +++ b/builder/parallels/iso/host_ip_ifconfig.go @@ -34,11 +34,10 @@ func (f *IfconfigIPFinder) HostIP() (string, error) { stdout := new(bytes.Buffer) cmd := exec.Command(ifconfigPath, device) - cmd.Env = append(cmd.Env, os.Environ()...) - // Force LANG=C so that the output is what we expect it to be // despite the locale. cmd.Env = append(cmd.Env, "LANG=C") + cmd.Env = append(cmd.Env, os.Environ()...) cmd.Stdout = stdout cmd.Stderr = new(bytes.Buffer) diff --git a/builder/vmware/iso/host_ip_ifconfig.go b/builder/vmware/iso/host_ip_ifconfig.go index 31243fafa..300107007 100644 --- a/builder/vmware/iso/host_ip_ifconfig.go +++ b/builder/vmware/iso/host_ip_ifconfig.go @@ -33,11 +33,10 @@ func (f *IfconfigIPFinder) HostIP() (string, error) { stdout := new(bytes.Buffer) cmd := exec.Command(ifconfigPath, f.Device) - cmd.Env = append(cmd.Env, os.Environ()...) - // Force LANG=C so that the output is what we expect it to be // despite the locale. cmd.Env = append(cmd.Env, "LANG=C") + cmd.Env = append(cmd.Env, os.Environ()...) cmd.Stdout = stdout cmd.Stderr = new(bytes.Buffer)