Commit 1cd913b0 authored by Cristian Maglie's avatar Cristian Maglie

Fixed tool flavor detection for 32-bits systems

Fixes #20
Fixes #25
parent 3396c78b
...@@ -163,17 +163,17 @@ func (f *Flavour) isCompatibleWith(osName, osArch string) bool { ...@@ -163,17 +163,17 @@ func (f *Flavour) isCompatibleWith(osName, osArch string) bool {
return regexpArmLinux.MatchString(f.OS) return regexpArmLinux.MatchString(f.OS)
case "linux,amd64": case "linux,amd64":
return regexpAmd64.MatchString(f.OS) return regexpAmd64.MatchString(f.OS)
case "linux,i386": case "linux,386":
return regexpi386.MatchString(f.OS) return regexpi386.MatchString(f.OS)
case "windows,i386", "windows,amd64": case "windows,386", "windows,amd64":
return regexpWindows.MatchString(f.OS) return regexpWindows.MatchString(f.OS)
case "darwin,amd64": case "darwin,amd64":
return regexpmac32Bit.MatchString(f.OS) || regexpMac64Bit.MatchString(f.OS) return regexpmac32Bit.MatchString(f.OS) || regexpMac64Bit.MatchString(f.OS)
case "darwin,i386": case "darwin,386":
return regexpmac32Bit.MatchString(f.OS) return regexpmac32Bit.MatchString(f.OS)
case "freebsd,arm": case "freebsd,arm":
return regexpArmBSD.MatchString(f.OS) return regexpArmBSD.MatchString(f.OS)
case "freebsd,i386", "freebsd,amd64": case "freebsd,386", "freebsd,amd64":
genericFreeBSDexp := regexp.MustCompile(osArch + "%s-freebsd[0-9]*") genericFreeBSDexp := regexp.MustCompile(osArch + "%s-freebsd[0-9]*")
return genericFreeBSDexp.MatchString(f.OS) return genericFreeBSDexp.MatchString(f.OS)
} }
......
...@@ -28,15 +28,15 @@ func TestFlavorCompatibility(t *testing.T) { ...@@ -28,15 +28,15 @@ func TestFlavorCompatibility(t *testing.T) {
Os string Os string
Arch string Arch string
} }
windowsi386 := &os{"windows", "i386"} windowsi386 := &os{"windows", "386"}
windowsx8664 := &os{"windows", "amd64"} windowsx8664 := &os{"windows", "amd64"}
linuxi386 := &os{"linux", "i386"} linuxi386 := &os{"linux", "386"}
linuxamd64 := &os{"linux", "amd64"} linuxamd64 := &os{"linux", "amd64"}
linuxarm := &os{"linux", "arm"} linuxarm := &os{"linux", "arm"}
linuxarmbe := &os{"linux", "armbe"} linuxarmbe := &os{"linux", "armbe"}
darwini386 := &os{"darwin", "i386"} darwini386 := &os{"darwin", "386"}
darwinamd646 := &os{"darwin", "amd64"} darwinamd646 := &os{"darwin", "amd64"}
freebsdi386 := &os{"freebsd", "i386"} freebsdi386 := &os{"freebsd", "386"}
freebsdamd64 := &os{"freebsd", "amd64"} freebsdamd64 := &os{"freebsd", "amd64"}
oses := []*os{ oses := []*os{
windowsi386, windowsi386,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment