depot_query: add support for bin and dbg archives

Fixes #5110
This commit is contained in:
Christian Prochaska 2024-02-02 16:15:53 +01:00 committed by Christian Helmuth
parent 0bc2e240bf
commit a1b5ebeb09
3 changed files with 31 additions and 3 deletions

View File

@ -30,7 +30,7 @@ struct Depot::Archive
typedef String<80> Name; typedef String<80> Name;
typedef String<40> Version; typedef String<40> Version;
enum Type { PKG, RAW, SRC, IMAGE }; enum Type { PKG, RAW, SRC, BIN, DBG, IMAGE };
struct Unknown_archive_type : Exception { }; struct Unknown_archive_type : Exception { };
@ -84,6 +84,8 @@ struct Depot::Archive
if (name == "src") return SRC; if (name == "src") return SRC;
if (name == "pkg") return PKG; if (name == "pkg") return PKG;
if (name == "raw") return RAW; if (name == "raw") return RAW;
if (name == "bin") return BIN;
if (name == "dbg") return DBG;
if (name == "image") return IMAGE; if (name == "image") return IMAGE;
throw Unknown_archive_type(); throw Unknown_archive_type();
@ -113,8 +115,22 @@ struct Depot::Archive
return _path_element<Name>(path, 1) == "image" && name(path) != "index"; return _path_element<Name>(path, 1) == "image" && name(path) != "index";
} }
static Name name (Path const &path) { return _path_element<Name> (path, 2); } static Name name (Path const &path)
static Version version (Path const &path) { return _path_element<Version>(path, 3); } {
if ((type(path) == BIN) || (type(path) == DBG))
return _path_element<Name> (path, 3);
return _path_element<Name> (path, 2);
}
static Version version (Path const &path)
{
if ((type(path) == BIN) || (type(path) == DBG))
return _path_element<Version>(path, 4);
return _path_element<Version>(path, 3);
}
static Version index_version(Path const &path) { return _path_element<Version>(path, 2); } static Version index_version(Path const &path) { return _path_element<Version>(path, 2); }
/** /**

View File

@ -151,6 +151,7 @@ set fd [open [run_dir]/genode/installation w]
puts $fd { puts $fd {
<installation arch="x86_64"> <installation arch="x86_64">
<archive path="genodelabs/pkg/wm/2019-03-17"/> <archive path="genodelabs/pkg/wm/2019-03-17"/>
<archive path="genodelabs/bin/x86_64/backdrop/2019-03-17"/>
<index path="genodelabs/index/19.02"/> <index path="genodelabs/index/19.02"/>
<index path="genodelabs/index/19.03"/> <index path="genodelabs/index/19.03"/>
</installation>} </installation>}
@ -173,6 +174,7 @@ append_qemu_nic_args
# watch the state reports generated by the depot-download manager # watch the state reports generated by the depot-download manager
set expected_pattern {} set expected_pattern {}
append expected_pattern {.*path="genodelabs/pkg/wm/2019-03-17" state="done".*} append expected_pattern {.*path="genodelabs/pkg/wm/2019-03-17" state="done".*}
append expected_pattern {.*path="genodelabs/bin/x86_64/backdrop/2019-03-17" state="done".*}
append expected_pattern {.*path="genodelabs/index/19.02" state="done".*} append expected_pattern {.*path="genodelabs/index/19.02" state="done".*}
append expected_pattern {.*path="genodelabs/index/19.03" state="failed".*} append expected_pattern {.*path="genodelabs/index/19.03" state="failed".*}

View File

@ -65,6 +65,8 @@ Depot_query::Main::_find_rom_in_pkg(File_content const &archives,
}); });
break; break;
case Archive::BIN:
case Archive::DBG:
case Archive::IMAGE: case Archive::IMAGE:
break; break;
} }
@ -221,6 +223,12 @@ void Depot_query::Main::_collect_source_dependencies(Archive::Path const &path,
break; break;
} }
case Archive::BIN:
case Archive::DBG:
dependencies.record(Archive::Path(Archive::user(path), "/src/",
Archive::name(path), "/",
Archive::version(path)), require_verify);
break;
case Archive::RAW: case Archive::RAW:
case Archive::IMAGE: case Archive::IMAGE:
break; break;
@ -258,6 +266,8 @@ void Depot_query::Main::_collect_binary_dependencies(Archive::Path const &path,
break; break;
case Archive::RAW: case Archive::RAW:
case Archive::BIN:
case Archive::DBG:
dependencies.record(path, require_verify); dependencies.record(path, require_verify);
break; break;