Commit f48d72fe authored by Florian Hölzl's avatar Florian Hölzl
Browse files

bugfix

refs 812
parent 0d17d148
......@@ -31,7 +31,7 @@ import java.util.Set;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 0377214461B79DD84348AEFAC3A69C4F
* @ConQAT.Rating GREEN Hash: 18B4C3BE5E61B215A80550DE4B47FD77
*/
public final class SourcePackage {
......@@ -116,21 +116,6 @@ public final class SourcePackage {
}
for(SourceUnitBase sub : sourceUnits) {
File sourceFile = new File(rootLocation, sub.unitName);
// Issue https://af3.fortiss.org/issues/628
//
// The following seems not to work until Java 7.
//
// sourceFile.setExecutable(sub.isExecutable(), false);
//
// We use the following workaround to set the file's
// executable flag at least on some *X-Systems.
if(System.getProperty("os.name").toLowerCase().contains("linux") ||
System.getProperty("os.name").toLowerCase().contains("mac os x")) {
String posixCommand = "chmod 755 " + sourceFile.getAbsolutePath();
Runtime.getRuntime().exec(posixCommand);
}
// Write the file.
FileWriter writer = new FileWriter(sourceFile);
String content = sub.toString();
......@@ -139,6 +124,22 @@ public final class SourcePackage {
}
writer.write(content);
writer.close();
if(sub.isExecutable()) {
// Issue https://af3.fortiss.org/issues/628
//
// The following seems not to work until Java 7.
//
// sourceFile.setExecutable(sub.isExecutable(), false);
//
// We use the following workaround to set the file's
// executable flag at least on some *X-Systems.
if(System.getProperty("os.name").toLowerCase().contains("linux") ||
System.getProperty("os.name").toLowerCase().contains("mac os x")) {
String posixCommand = "chmod 755 " + sourceFile.getAbsolutePath();
Runtime.getRuntime().exec(posixCommand);
}
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment