depot_query: catch exceptions for missing directories

Ref #2742
This commit is contained in:
Emery Hemingway 2018-04-13 10:49:21 +02:00 committed by Christian Helmuth
parent 82a683eccc
commit fde056506e

View File

@ -474,21 +474,18 @@ void Depot_query::Main::_collect_source_dependencies(Archive::Path const &path,
dependencies.record(path); dependencies.record(path);
switch (Archive::type(path)) { try { switch (Archive::type(path)) {
case Archive::PKG: case Archive::PKG: {
try {
File_content archives(_heap, Directory(_depot_dir, path), File_content archives(_heap, Directory(_depot_dir, path),
"archives", File_content::Limit{16*1024}); "archives", File_content::Limit{16*1024});
archives.for_each_line<Archive::Path>([&] (Archive::Path const &path) { archives.for_each_line<Archive::Path>([&] (Archive::Path const &path) {
_collect_source_dependencies(path, dependencies, recursion_limit); }); _collect_source_dependencies(path, dependencies, recursion_limit); });
}
catch (File_content::Nonexistent_file) { }
break; break;
}
case Archive::SRC: case Archive::SRC: {
try {
File_content used_apis(_heap, Directory(_depot_dir, path), File_content used_apis(_heap, Directory(_depot_dir, path),
"used_apis", File_content::Limit{16*1024}); "used_apis", File_content::Limit{16*1024});
@ -496,13 +493,14 @@ void Depot_query::Main::_collect_source_dependencies(Archive::Path const &path,
used_apis.for_each_line<Archive::Path>([&] (Api const &api) { used_apis.for_each_line<Archive::Path>([&] (Api const &api) {
dependencies.record(Archive::Path(Archive::user(path), "/api/", api)); dependencies.record(Archive::Path(Archive::user(path), "/api/", api));
}); });
}
catch (File_content::Nonexistent_file) { }
break; break;
}
case Archive::RAW: case Archive::RAW:
break; break;
}; }; }
catch (File_content::Nonexistent_file) { }
catch (Directory::Nonexistent_directory) { }
} }
@ -528,7 +526,9 @@ void Depot_query::Main::_collect_binary_dependencies(Archive::Path const &path,
archives.for_each_line<Archive::Path>([&] (Archive::Path const &archive_path) { archives.for_each_line<Archive::Path>([&] (Archive::Path const &archive_path) {
_collect_binary_dependencies(archive_path, dependencies, recursion_limit); }); _collect_binary_dependencies(archive_path, dependencies, recursion_limit); });
} catch (File_content::Nonexistent_file) { } }
catch (File_content::Nonexistent_file) { }
catch (Directory::Nonexistent_directory) { }
break; break;
case Archive::SRC: case Archive::SRC: