fix
This commit is contained in:
1
.idea/workspace.xml
generated
1
.idea/workspace.xml
generated
@@ -9,6 +9,7 @@
|
|||||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/RemoteInitialiseUser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/RemoteInitialiseUser.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/RemoteInitialiseUser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/RemoteInitialiseUser.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/files/Planner.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/src/files/planner.cpp" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
|||||||
@@ -39,12 +39,27 @@ public class RemoteInitialiseUser extends ConnectionPass_2023<RemoteFile> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
String getPlannerFlags() throws Exception{
|
String getPlannerFlags() throws Exception{
|
||||||
|
String res = "";
|
||||||
String command = "g++ -v --help 2> /dev/null | sed -n '/^ *-std=\\([^<][^ ]\\+\\).*/ {s//\\1/p}' | grep c++";
|
String command = "g++ -v --help 2> /dev/null | sed -n '/^ *-std=\\([^<][^ ]\\+\\).*/ {s//\\1/p}' | grep c++";
|
||||||
System.out.println(command);
|
System.out.println(command);
|
||||||
Pair<RemoteFile, RemoteFile> res = user.connection.performScript(modulesDirectory, command);
|
Pair<RemoteFile, RemoteFile> oe = user.connection.performScript(modulesDirectory, command);
|
||||||
RemoteFile out = res.getKey();
|
RemoteFile outFile = oe.getKey();
|
||||||
System.out.println(user.connection.readFromFile(out));
|
String out = user.connection.readFromFile(outFile);
|
||||||
return "";
|
String [] data = out.split("\n");
|
||||||
|
for (String version: data){
|
||||||
|
System.out.println(Utils.Brackets(version));
|
||||||
|
if (version.equals("c++17")){
|
||||||
|
res = "-std=c++17";
|
||||||
|
break;
|
||||||
|
}else if (version.equals("c++11")){
|
||||||
|
res="-std=c++11";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println(Utils.Brackets(res));
|
||||||
|
if (res.isEmpty())
|
||||||
|
throw new PassException("На целевой машине отсутствуют с++17 и с++11!");
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void ServerAction() throws Exception {
|
protected void ServerAction() throws Exception {
|
||||||
@@ -71,7 +86,7 @@ public class RemoteInitialiseUser extends ConnectionPass_2023<RemoteFile> {
|
|||||||
"CompilationTask.h",
|
"CompilationTask.h",
|
||||||
"File.h",
|
"File.h",
|
||||||
"Global.h",
|
"Global.h",
|
||||||
"Planner.cpp",
|
"planner.cpp",
|
||||||
"RunSupervisor.h",
|
"RunSupervisor.h",
|
||||||
"RunTask.h",
|
"RunTask.h",
|
||||||
"String.h",
|
"String.h",
|
||||||
@@ -91,21 +106,7 @@ public class RemoteInitialiseUser extends ConnectionPass_2023<RemoteFile> {
|
|||||||
ShowMessage1("Сборка модулей...");
|
ShowMessage1("Сборка модулей...");
|
||||||
compileModule("launcher","");
|
compileModule("launcher","");
|
||||||
compileModule("starter","");
|
compileModule("starter","");
|
||||||
getPlannerFlags();
|
compileModule("planner", getPlannerFlags());
|
||||||
//compileModule("planner", getPlannerFlags());
|
|
||||||
/*
|
|
||||||
|
|
||||||
//канал на исполнение независим, поэтому переход в папку отдельный
|
|
||||||
Command(
|
|
||||||
"cd " + Utils.DQuotes(sftpChannel.pwd()), //нужны ли тут кавычки?
|
|
||||||
"g++ " + starter_code + " -o " + starter,
|
|
||||||
"g++ " + launcher_code + " -o " + launcher,
|
|
||||||
"g++ -O3 -std=c++17 Planner.cpp -o " + planner,
|
|
||||||
"chmod 0777 " + starter,
|
|
||||||
"chmod 0777 " + launcher,
|
|
||||||
"chmod 0777 " + planner
|
|
||||||
);
|
|
||||||
*/
|
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
RemoteFile info = new RemoteFile(target, Current.getAccount().email);
|
RemoteFile info = new RemoteFile(target, Current.getAccount().email);
|
||||||
user.connection.writeToFile("", info);
|
user.connection.writeToFile("", info);
|
||||||
|
|||||||
Reference in New Issue
Block a user