Skip to content

Commit c5f0d9a

Browse files
committed
determine env-lockfile packages missing urls before earlier
1 parent 9b20515 commit c5f0d9a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

libmamba/src/core/transaction.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,6 +1485,20 @@ namespace mamba
14851485
LOG_DEBUG << "pip package to install: " << package.name;
14861486
}
14871487

1488+
// Make sure package urls are set for conda packages if a channel is specified
1489+
for (auto& package : conda_packages)
1490+
{
1491+
if (package.package_url.empty() and not package.channel.empty())
1492+
{
1493+
using Credentials = typename specs::CondaURL::Credentials;
1494+
auto channels = channel_context.make_channel(package.channel);
1495+
assert(channels.size() == 1); // A URL can only resolve to one channel
1496+
const auto& channel = channels.front();
1497+
1498+
package.package_url = package.url_for_channel(channel.url().str(Credentials::Show));
1499+
}
1500+
}
1501+
14881502
return MTransaction{ ctx, database, std::move(conda_packages), package_caches };
14891503
}
14901504

0 commit comments

Comments
 (0)