summaryrefslogtreecommitdiff
path: root/src/buildtool/main/main.cpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2022-07-08 10:29:05 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2022-07-08 17:18:20 +0200
commitb9880e8ecdce02f047dfb1d19de5f1ed07a82ac6 (patch)
tree15590ac7a8ac0c5fbf052e47ae80c9382f88e489 /src/buildtool/main/main.cpp
parentbf159b19daf72627de01987cfbb12461705a5f22 (diff)
downloadjustbuild-b9880e8ecdce02f047dfb1d19de5f1ed07a82ac6.tar.gz
In install-cas be more liberal in parsing artifact identifiers
Diffstat (limited to 'src/buildtool/main/main.cpp')
-rw-r--r--src/buildtool/main/main.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp
index e3c1385a..4c977955 100644
--- a/src/buildtool/main/main.cpp
+++ b/src/buildtool/main/main.cpp
@@ -1160,32 +1160,28 @@ void ReportTaintedness(const AnalysisResult& result) {
[[nodiscard]] auto FetchAndInstallArtifacts(
gsl::not_null<IExecutionApi*> const& api,
FetchArguments const& clargs) -> bool {
- auto object_info = Artifact::ObjectInfo::FromString(clargs.object_id);
- if (not object_info) {
- Logger::Log(
- LogLevel::Error, "failed to parse object id {}.", clargs.object_id);
- return false;
- }
+ auto object_info =
+ Artifact::ObjectInfo::LiberalFromString(clargs.object_id);
if (clargs.output_path) {
auto output_path = (*clargs.output_path / "").parent_path();
if (FileSystemManager::IsDirectory(output_path)) {
- output_path /= object_info->digest.hash();
+ output_path /= object_info.digest.hash();
}
if (not FileSystemManager::CreateDirectory(output_path.parent_path()) or
- not api->RetrieveToPaths({*object_info}, {output_path})) {
+ not api->RetrieveToPaths({object_info}, {output_path})) {
Logger::Log(LogLevel::Error, "failed to retrieve artifact.");
return false;
}
Logger::Log(LogLevel::Info,
"artifact {} was installed to {}",
- object_info->ToString(),
+ object_info.ToString(),
output_path.string());
}
else { // dump to stdout
- if (not api->RetrieveToFds({*object_info}, {dup(fileno(stdout))})) {
+ if (not api->RetrieveToFds({object_info}, {dup(fileno(stdout))})) {
Logger::Log(LogLevel::Error, "failed to dump artifact.");
return false;
}