Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed channel output in umamba list #3486

Merged
merged 3 commits into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading