1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-17 22:23:10 +03:00

Getting rid of native stuff. Avoid native stuff: it will break. Fixes #2828, #2829, #2830

This commit is contained in:
Federico Fissore
2015-03-30 09:30:03 +02:00
parent 3788128385
commit b65b576eb0
11 changed files with 44 additions and 300 deletions

View File

@ -582,7 +582,7 @@ public class BaseNoGui {
if (!indexFile.isFile() || !(avrCoreFolder.exists() && avrCoreFolder.isDirectory())) {
File distFile = findDefaultPackageFile();
if (distFile != null) {
ArchiveExtractor.extract(distFile, BaseNoGui.getSettingsFolder(), 0, true);
new ArchiveExtractor(getPlatform()).extract(distFile, BaseNoGui.getSettingsFolder(), 0, true);
} else if (!indexFile.isFile()) {
// Otherwise create an empty packages index
FileOutputStream out = null;

View File

@ -244,4 +244,19 @@ public class Platform {
public String getOsArch() {
return System.getProperty("os.arch");
}
public void symlink(File something, File somewhere) throws IOException, InterruptedException {
Process process = Runtime.getRuntime().exec(new String[]{"ln", "-s", something.getAbsolutePath(), somewhere.getAbsolutePath()}, null, null);
process.waitFor();
}
public void link(File something, File somewhere) throws IOException, InterruptedException {
Process process = Runtime.getRuntime().exec(new String[]{"ln", something.getAbsolutePath(), somewhere.getAbsolutePath()}, null, null);
process.waitFor();
}
public void chmod(File file, int mode) throws IOException, InterruptedException {
Process process = Runtime.getRuntime().exec(new String[]{"chmod", Integer.toOctalString(mode), file.getAbsolutePath()}, null, null);
process.waitFor();
}
}

View File

@ -362,4 +362,13 @@ public class Platform extends processing.app.Platform {
scripts.add(new File(folder, "post_install.bat"));
return scripts;
}
public void symlink(File something, File somewhere) throws IOException, InterruptedException {
}
public void link(File something, File somewhere) throws IOException, InterruptedException {
}
public void chmod(File file, int mode) throws IOException, InterruptedException {
}
}