mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-16 11:21:18 +03:00
Removing previously installed platform on upgrade
This commit is contained in:
@ -66,7 +66,6 @@ public class LibrariesIndexer {
|
||||
|
||||
public void parseIndex() throws JsonParseException, IOException {
|
||||
parseIndex(indexFile);
|
||||
System.out.println(index);
|
||||
|
||||
index.fillCategories();
|
||||
// TODO: resolve libraries inner references
|
||||
|
@ -60,8 +60,9 @@ public class ContributionInstaller {
|
||||
}
|
||||
|
||||
public void install(ContributedPlatform platform) throws Exception {
|
||||
if (platform.isInstalled())
|
||||
if (platform.isInstalled()) {
|
||||
throw new Exception("Platform is already installed!");
|
||||
}
|
||||
|
||||
// Do not download already installed tools
|
||||
List<ContributedTool> tools = new LinkedList<ContributedTool>(platform.getResolvedTools());
|
||||
@ -111,13 +112,11 @@ public class ContributionInstaller {
|
||||
File toolsFolder = new File(packageFolder, "tools");
|
||||
int i = 1;
|
||||
for (ContributedTool tool : platform.getResolvedTools()) {
|
||||
progress.setStatus(format(_("Installing tools ({0}/{1})..."), i,
|
||||
tools.size()));
|
||||
progress.setStatus(format(_("Installing tools ({0}/{1})..."), i, tools.size()));
|
||||
onProgress(progress);
|
||||
i++;
|
||||
DownloadableContribution toolContrib = tool.getDownloadableContribution();
|
||||
File destFolder = new File(toolsFolder, tool.getName() + File.separator +
|
||||
tool.getVersion());
|
||||
File destFolder = new File(toolsFolder, tool.getName() + File.separator + tool.getVersion());
|
||||
|
||||
destFolder.mkdirs();
|
||||
ArchiveExtractor.extract(toolContrib.getDownloadedFile(), destFolder, 1);
|
||||
@ -129,8 +128,7 @@ public class ContributionInstaller {
|
||||
// Unpack platform on the correct location
|
||||
progress.setStatus(_("Installing boards..."));
|
||||
onProgress(progress);
|
||||
File platformFolder = new File(packageFolder, "hardware" + File.separator +
|
||||
platform.getArchitecture());
|
||||
File platformFolder = new File(packageFolder, "hardware" + File.separator + platform.getArchitecture());
|
||||
File destFolder = new File(platformFolder, platform.getVersion());
|
||||
destFolder.mkdirs();
|
||||
ArchiveExtractor.extract(platform.getDownloadedFile(), destFolder, 1);
|
||||
|
@ -612,7 +612,6 @@ public class BaseNoGui {
|
||||
}
|
||||
indexer.parseIndex();
|
||||
indexer.syncWithFilesystem();
|
||||
System.out.println(indexer);
|
||||
|
||||
packages = new HashMap<String, TargetPackage>();
|
||||
loadHardware(getHardwareFolder());
|
||||
|
Reference in New Issue
Block a user