Set the BLENDER_USER_CONFIG env variable to not use the local blender conf

This commit is contained in:
Laurent Clouet
2015-01-16 17:51:50 +01:00
parent c117bc40e6
commit b61df37034
5 changed files with 26 additions and 5 deletions

View File

@@ -122,7 +122,7 @@ public class Linux extends OS {
}
@Override
public Process exec(String[] command) throws IOException {
public Process exec(String[] command, Map<String, String> env_overight) throws IOException {
// the renderer have a lib directory so add to the LD_LIBRARY_PATH
// (even if we are not sure that it is the renderer who is launch
@@ -155,6 +155,9 @@ public class Linux extends OS {
builder.redirectErrorStream(true);
Map<String, String> env = builder.environment();
env.putAll(new_env);
if (env_overight != null) {
env.putAll(env_overight);
}
return builder.start();
}

View File

@@ -22,6 +22,7 @@ import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Map;
import com.sheepit.client.Log;
import com.sheepit.client.Utils;
@@ -140,7 +141,7 @@ public class Mac extends OS {
}
@Override
public Process exec(String[] command) throws IOException {
public Process exec(String[] command, Map<String, String> env) throws IOException {
String[] actual_command = command;
if (this.hasNiceBinary == null) {
this.checkNiceAvailability();
@@ -154,6 +155,9 @@ public class Mac extends OS {
}
ProcessBuilder builder = new ProcessBuilder(actual_command);
builder.redirectErrorStream(true);
if (env != null) {
builder.environment().putAll(env);
}
return builder.start();
}

View File

@@ -19,6 +19,7 @@
package com.sheepit.client.os;
import java.io.IOException;
import java.util.Map;
import com.sheepit.client.hardware.cpu.CPU;
@@ -37,9 +38,12 @@ public abstract class OS {
return null;
}
public Process exec(String[] command) throws IOException {
public Process exec(String[] command, Map<String, String> env) throws IOException {
ProcessBuilder builder = new ProcessBuilder(command);
builder.redirectErrorStream(true);
if (env != null) {
builder.environment().putAll(env);
}
return builder.start();
}

View File

@@ -19,6 +19,7 @@
package com.sheepit.client.os;
import java.io.IOException;
import java.util.Map;
import com.sheepit.client.hardware.cpu.CPU;
import com.sheepit.client.os.windows.Kernel32Lib;
@@ -106,7 +107,7 @@ public class Windows extends OS {
}
@Override
public Process exec(String[] command) throws IOException {
public Process exec(String[] command, Map<String, String> env) throws IOException {
// disable a popup because the renderer might crash (seg fault)
Kernel32Lib kernel32lib = null;
try {
@@ -125,6 +126,9 @@ public class Windows extends OS {
ProcessBuilder builder = new ProcessBuilder(command);
builder.redirectErrorStream(true);
if (env != null) {
builder.environment().putAll(env);
}
Process p = builder.start();
WinProcess wproc = new WinProcess(p);
wproc.setPriority(WinProcess.PRIORITY_BELOW_NORMAL);