Skip to content

Commit

Permalink
modules: Change module dependency string to be the same as in dnf4
Browse files Browse the repository at this point in the history
Add ":[]" when any stream is required instead of keeping only the
module name. This makes it consistent with `modulemd_stream` yaml and
with dnf4 output of the module info command.
  • Loading branch information
pkratoch authored and kontura committed Dec 14, 2023
1 parent f07d22b commit 699221f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions libdnf5/module/module_dependency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ namespace libdnf5::module {


std::string ModuleDependency::to_string() {
if (streams.empty()) {
return module_name;
}
std::sort(streams.begin(), streams.end());
return fmt::format("{}:[{}]", module_name, utils::string::join(streams, ","));
}
Expand Down
2 changes: 1 addition & 1 deletion test/libdnf5/module/test_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void ModuleTest::test_load() {
"spends writing or debugging build definitions is a second wasted. So is every second spent "
"waiting for the build system to actually start compiling code."),
meson.get_description());
CPPUNIT_ASSERT_EQUAL(std::string("ninja;platform:[f29,f30,f31]"), meson.get_module_dependencies_string());
CPPUNIT_ASSERT_EQUAL(std::string("ninja:[];platform:[f29,f30,f31]"), meson.get_module_dependencies_string());
CPPUNIT_ASSERT_EQUAL((size_t)1, meson.get_profiles().size());
CPPUNIT_ASSERT_EQUAL(std::string("default"), meson.get_profiles()[0].get_name());
CPPUNIT_ASSERT_EQUAL(false, meson.get_profiles()[0].is_default());
Expand Down

0 comments on commit 699221f

Please sign in to comment.