Skip to content

Commit

Permalink
Fixed channel output in umamba list (#3486)
Browse files Browse the repository at this point in the history
Fixed channel output in umamba list
  • Loading branch information
JohanMabille authored Sep 30, 2024
1 parent b23a079 commit f8bfd11
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions libmamba/src/api/list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,17 @@ namespace mamba

if (regex.empty() || std::regex_search(pkg_info.name, spec_pat))
{
auto channels = channel_context.make_channel(pkg_info.package_url);
assert(channels.size() == 1); // A URL can only resolve to one channel
obj["base_url"] = channels.front().url().str(specs::CondaURL::Credentials::Remove
auto display_channels = channel_context.make_channel(pkg_info.channel);
auto url_channels = channel_context.make_channel(pkg_info.package_url);
assert(display_channels.size() == 1); // A URL can only resolve to one
// channel
assert(url_channels.size() == 1); // A URL can only resolve to one channel
obj["base_url"] = url_channels.front().url().str(
specs::CondaURL::Credentials::Remove
);
obj["build_number"] = pkg_info.build_number;
obj["build_string"] = pkg_info.build_string;
obj["channel"] = channels.front().display_name();
obj["channel"] = display_channels.front().display_name();
obj["dist_name"] = pkg_info.str();
obj["name"] = pkg_info.name;
obj["platform"] = pkg_info.platform;
Expand Down Expand Up @@ -113,7 +117,7 @@ namespace mamba
}
else
{
auto channels = channel_context.make_channel(package.second.package_url);
auto channels = channel_context.make_channel(package.second.channel);
assert(channels.size() == 1); // A URL can only resolve to one channel
formatted_pkgs.channel = channels.front().display_name();
}
Expand Down

0 comments on commit f8bfd11

Please sign in to comment.