1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-16 11:21:18 +03:00

HostDependentDownloadableContribution better handles Macosx

This commit is contained in:
Federico Fissore
2015-03-10 17:42:14 +01:00
parent a98240bc58
commit e5e5880a15
4 changed files with 123 additions and 23 deletions

View File

@ -30,8 +30,7 @@ package cc.arduino.packages.contributions;
import java.util.Properties;
public abstract class HostDependentDownloadableContribution extends
DownloadableContribution {
public abstract class HostDependentDownloadableContribution extends DownloadableContribution {
public abstract String getHost();
@ -53,25 +52,21 @@ public abstract class HostDependentDownloadableContribution extends
if (osName.contains("Linux")) {
if (osArch.contains("amd64")) {
// os.arch = amd64
return host.matches("x86_64-.*linux-gnu");
} else {
// 32 bit systems
return host.matches("i[3456]86-.*linux-gnu");
}
}
if (osName.contains("Windows")) {
if (host.matches("i[3456]86-.*mingw32"))
return true;
if (host.matches("i[3456]86-.*cygwin"))
return true;
return host.matches("i[3456]86-.*mingw32") || host.matches("i[3456]86-.*cygwin");
}
if (osName.contains("Mac")) {
if (osArch.contains("86")) {
if (host.matches("i[3456]86-apple-darwin.*"))
return true;
if (osArch.contains("x86_64")) {
return host.matches("x86_64-apple-darwin.*") || host.matches("i[3456]86-apple-darwin.*");
} else {
return host.matches("i[3456]86-apple-darwin.*");
}
}