From 0ffa9af2953ea35bd6a4edf52a9549cd49b6c747 Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Mon, 30 Sep 2024 19:37:55 +0200 Subject: [PATCH 1/3] Fixed channel output in umamba list --- libmamba/src/api/list.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmamba/src/api/list.cpp b/libmamba/src/api/list.cpp index 28006b2c65..ddec71b0ad 100644 --- a/libmamba/src/api/list.cpp +++ b/libmamba/src/api/list.cpp @@ -73,7 +73,7 @@ namespace mamba if (regex.empty() || std::regex_search(pkg_info.name, spec_pat)) { - auto channels = channel_context.make_channel(pkg_info.package_url); + auto channels = channel_context.make_channel(pkg_info.channel); assert(channels.size() == 1); // A URL can only resolve to one channel obj["base_url"] = channels.front().url().str(specs::CondaURL::Credentials::Remove ); @@ -113,7 +113,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(); } From 9040cfb974fdbce01fd9687e6c7fa2af1884de20 Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Mon, 30 Sep 2024 20:00:41 +0200 Subject: [PATCH 2/3] Dirty fix done dirt cheap! --- libmamba/src/api/list.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libmamba/src/api/list.cpp b/libmamba/src/api/list.cpp index ddec71b0ad..66c26c6b56 100644 --- a/libmamba/src/api/list.cpp +++ b/libmamba/src/api/list.cpp @@ -73,13 +73,14 @@ namespace mamba if (regex.empty() || std::regex_search(pkg_info.name, spec_pat)) { - auto channels = channel_context.make_channel(pkg_info.channel); + auto display_channels = channel_context.make_channel(pkg_info.channel); + auto url_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 + 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; From a1d2976944a33ffbf631d0944aa48ee8c01bcb6b Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Mon, 30 Sep 2024 20:04:08 +0200 Subject: [PATCH 3/3] .. --- libmamba/src/api/list.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libmamba/src/api/list.cpp b/libmamba/src/api/list.cpp index 66c26c6b56..f28594e114 100644 --- a/libmamba/src/api/list.cpp +++ b/libmamba/src/api/list.cpp @@ -75,8 +75,11 @@ namespace mamba { auto display_channels = channel_context.make_channel(pkg_info.channel); auto url_channels = channel_context.make_channel(pkg_info.package_url); - assert(channels.size() == 1); // A URL can only resolve to one channel - obj["base_url"] = url_channels.front().url().str(specs::CondaURL::Credentials::Remove + 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;