Skip to content

Commit

Permalink
Modify condition for OCI
Browse files Browse the repository at this point in the history
  • Loading branch information
Hind-M committed Jan 3, 2025
1 parent 14208d3 commit c16e54c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions libmamba/src/core/package_fetcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,15 @@ namespace mamba
std::string PackageFetcher::channel() const
{
// Note that in the oci case, the pkg url also implicitly starts with "https://"
// but should be included in the first case (with the url containing "ghcr" condition)
// but should be included in the first case
// (with the url starting with "https://pkg-containers.githubusercontent.com/" condition)
// TODO We should maybe think of a cleaner way of differentiating all this
if (!util::starts_with(m_package_info.package_url, "file://")
&& (!util::starts_with(m_package_info.package_url, "https://")
|| util::contains(m_package_info.package_url, "ghcr")))
|| util::starts_with(
m_package_info.package_url,
"https://pkg-containers.githubusercontent.com/"
)))
{
return m_package_info.channel;
}
Expand All @@ -345,11 +349,15 @@ namespace mamba
std::string PackageFetcher::url_path() const
{
// Note that in the oci case, the pkg url also implicitly starts with "https://"
// but should be included in the first case (with the url containing "ghcr" condition)
// but should be included in the first case
// (with the url starting with "https://pkg-containers.githubusercontent.com/" condition)
// TODO We should maybe think of a cleaner way of differentiating all this
if (!util::starts_with(m_package_info.package_url, "file://")
&& (!util::starts_with(m_package_info.package_url, "https://")
|| util::contains(m_package_info.package_url, "ghcr")))
|| util::starts_with(
m_package_info.package_url,
"https://pkg-containers.githubusercontent.com/"
)))
{
return util::concat(m_package_info.platform, '/', m_package_info.filename);
}
Expand Down

0 comments on commit c16e54c

Please sign in to comment.