Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 47382ef

Browse files
committedNov 24, 2022
disallow .dylib in downloader
1 parent e3a679b commit 47382ef

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
 

‎download_dependencies.d

+17
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ bool downloadTool(string name, string output, TargetPlatform target, bool requir
130130
fs.rename(unverifiedOutput, output ~ target.archiveExtension);
131131
extractAndDelete(output ~ target.archiveExtension);
132132
markExecutable(output);
133+
foreach (del; target.forbiddenFiles)
134+
if (fs.exists(del))
135+
fs.remove(del);
133136
return true;
134137
}
135138
}
@@ -234,6 +237,20 @@ struct TargetPlatform
234237
else
235238
throw new Exception("unsupported platform for cliname");
236239
}
240+
241+
/// Files that are auto-deleted after download if they exist
242+
string[] forbiddenFiles() const @property
243+
{
244+
// list of forbidden files for this platform
245+
if (platforms.canFind("linux"))
246+
return ["librorm.so"];
247+
else if (platforms.canFind("osx"))
248+
return ["librorm.dylib"];
249+
else if (platforms.canFind("windows"))
250+
return ["rorm.dll"];
251+
else
252+
throw new Exception("unsupported platform for libname");
253+
}
237254
}
238255

239256
TargetPlatform determinePlatforms(string[] archs, string[] platforms)

0 commit comments

Comments
 (0)
Please sign in to comment.