mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-20 21:01:25 +03:00
ArchiveExtractor was not making symlinks the right way
This commit is contained in:
@ -112,7 +112,7 @@ public class ArchiveExtractor {
|
|||||||
|
|
||||||
Map<File, File> hardLinks = new HashMap<File, File>();
|
Map<File, File> hardLinks = new HashMap<File, File>();
|
||||||
Map<File, Integer> hardLinksMode = new HashMap<File, Integer>();
|
Map<File, Integer> hardLinksMode = new HashMap<File, Integer>();
|
||||||
Map<File, File> symLinks = new HashMap<File, File>();
|
Map<File, String> symLinks = new HashMap<File, String>();
|
||||||
Map<File, Long> symLinksModifiedTimes = new HashMap<File, Long>();
|
Map<File, Long> symLinksModifiedTimes = new HashMap<File, Long>();
|
||||||
|
|
||||||
// Cycle through all the archive entries
|
// Cycle through all the archive entries
|
||||||
@ -227,7 +227,7 @@ public class ArchiveExtractor {
|
|||||||
hardLinks.put(outputFile, outputLinkedFile);
|
hardLinks.put(outputFile, outputLinkedFile);
|
||||||
hardLinksMode.put(outputFile, mode);
|
hardLinksMode.put(outputFile, mode);
|
||||||
} else if (isSymLink) {
|
} else if (isSymLink) {
|
||||||
symLinks.put(outputFile, outputLinkedFile);
|
symLinks.put(outputFile, linkName);
|
||||||
symLinksModifiedTimes.put(outputFile, modifiedTime);
|
symLinksModifiedTimes.put(outputFile, modifiedTime);
|
||||||
} else {
|
} else {
|
||||||
// Create the containing folder if not exists
|
// Create the containing folder if not exists
|
||||||
@ -255,7 +255,7 @@ public class ArchiveExtractor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Map.Entry<File, File> entry : symLinks.entrySet()) {
|
for (Map.Entry<File, String> entry : symLinks.entrySet()) {
|
||||||
if (entry.getKey().exists() && overwrite) {
|
if (entry.getKey().exists() && overwrite) {
|
||||||
entry.getKey().delete();
|
entry.getKey().delete();
|
||||||
}
|
}
|
||||||
|
@ -216,8 +216,8 @@ public class Platform {
|
|||||||
return System.getProperty("os.arch");
|
return System.getProperty("os.arch");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void symlink(File something, File somewhere) throws IOException, InterruptedException {
|
public void symlink(String something, File somewhere) throws IOException, InterruptedException {
|
||||||
Process process = Runtime.getRuntime().exec(new String[]{"ln", "-s", something.getAbsolutePath(), somewhere.getAbsolutePath()}, null, null);
|
Process process = Runtime.getRuntime().exec(new String[]{"ln", "-s", something, somewhere.getAbsolutePath()}, null, somewhere.getParentFile());
|
||||||
process.waitFor();
|
process.waitFor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user