mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
updater: do not show dialog for creation new file(s) with changes only in upper/lower case name.
This commit is contained in:
@@ -39,7 +39,7 @@ public class CreateAction extends PatchAction {
|
||||
ValidationResult result = doValidateAccess(toFile, ValidationResult.Action.CREATE);
|
||||
if (result != null) return result;
|
||||
|
||||
if (toFile.exists()) {
|
||||
if (toFile.exists() && Runner.isPlatformCaseSensitive()) {
|
||||
ValidationResult.Option[] options = myPatch.isStrict()
|
||||
? new ValidationResult.Option[]{ValidationResult.Option.REPLACE}
|
||||
: new ValidationResult.Option[]{ValidationResult.Option.REPLACE, ValidationResult.Option.KEEP};
|
||||
|
||||
@@ -31,7 +31,8 @@ import java.util.zip.ZipInputStream;
|
||||
|
||||
public class Runner {
|
||||
public static Logger logger = null;
|
||||
|
||||
private static String updaterLogFileName;
|
||||
private static boolean platformCaseSensitive;
|
||||
private static final String PATCH_FILE_NAME = "patch-file.zip";
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
@@ -46,6 +47,7 @@ public class Runner {
|
||||
String newFolder = args[4];
|
||||
String patchFile = args[5];
|
||||
initLogger();
|
||||
checkIfPlatformCaseSensitive();
|
||||
|
||||
// See usage for an explanation of these flags
|
||||
boolean binary = Arrays.asList(args).contains("--zip_as_binary");
|
||||
@@ -83,6 +85,7 @@ public class Runner {
|
||||
else if (args.length >= 2 && ("install".equals(args[0]) || "apply".equals(args[0]))) {
|
||||
String destFolder = args[1];
|
||||
initLogger();
|
||||
checkIfPlatformCaseSensitive();
|
||||
logger.info("destFolder: " + destFolder);
|
||||
|
||||
if ("install".equals(args[0])) {
|
||||
@@ -126,13 +129,24 @@ public class Runner {
|
||||
return dir;
|
||||
}
|
||||
|
||||
private static void checkIfPlatformCaseSensitive() throws Exception {
|
||||
platformCaseSensitive = new File(updaterLogFileName.toLowerCase()).exists() &&
|
||||
new File(updaterLogFileName.toUpperCase()).exists() ?
|
||||
false : true;
|
||||
}
|
||||
|
||||
public static boolean isPlatformCaseSensitive() {
|
||||
return platformCaseSensitive;
|
||||
}
|
||||
|
||||
public static void initLogger() {
|
||||
if (logger == null) {
|
||||
long requiredFreeSpace = 1000000;
|
||||
String logFolder = getDir(requiredFreeSpace);
|
||||
updaterLogFileName = new File(logFolder, "idea_updater.log").getAbsolutePath();
|
||||
FileAppender update = new FileAppender();
|
||||
update.setFile(updaterLogFileName);
|
||||
|
||||
update.setFile(new File(logFolder, "idea_updater.log").getAbsolutePath());
|
||||
update.setLayout(new PatternLayout("%d{dd MMM yyyy HH:mm:ss} %-5p %C{1}.%M - %m%n"));
|
||||
update.setThreshold(Level.ALL);
|
||||
update.setAppend(true);
|
||||
|
||||
Reference in New Issue
Block a user