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

No Storing Channel* and MRepo* in Solvables #2409

Merged
merged 9 commits into from
Apr 11, 2023
Merged
Prev Previous commit
Next Next commit
Remove MRepo::p_channel and Repo::appdata
  • Loading branch information
AntoinePrv committed Apr 4, 2023
commit 3249cc9bd6d8e7e8af42aaa0331dc0ac617fc212
2 changes: 0 additions & 2 deletions libmamba/include/mamba/core/repo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ namespace mamba
bool write() const;
const std::string& url() const;
Repo* repo() const;
const Channel* channel() const;
std::tuple<int, int> priority() const;
std::size_t size() const;

Expand Down Expand Up @@ -152,7 +151,6 @@ namespace mamba
::Id m_real_repo_key = 0;
::Id m_mrepo_key = 0;
::Id m_noarch_repo_key = 0;
const Channel* p_channel = nullptr;
};

} // namespace mamba
Expand Down
13 changes: 0 additions & 13 deletions libmamba/src/core/repo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ namespace mamba
m_repo = repo_create(pool, m_url.c_str());
init(pool);
read_file(index);
p_channel = &channel;
}

MRepo::MRepo(MPool& pool, const std::string& name, const std::string& index, const std::string& url)
Expand All @@ -60,7 +59,6 @@ namespace mamba
{
init(pool);
read_file(index);
p_channel = &ChannelBuilder::make_cached_channel(m_url);
}

MRepo::MRepo(MPool& pool, const std::string& name, const std::vector<PackageInfo>& package_infos)
Expand Down Expand Up @@ -101,7 +99,6 @@ namespace mamba

void MRepo::init(MPool& pool)
{
m_repo->appdata = this;
m_real_repo_key = pool_str2id(pool, "solvable:real_repo_url", 1);
m_mrepo_key = pool_str2id(pool, "solvable:mrepo_url", 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference between repo and real_repo ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to know too! This is a mechanical operation that stores the value of MRepo::url for retrival.
I tried to merge real_repo_url and mrepo_url but it was significantly more tricky than the scope of this PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also m_metadata.url/"mamba:url" in the mix

m_noarch_repo_key = pool_str2id(pool, "solvable:noarch_type", 1);
Expand Down Expand Up @@ -142,11 +139,8 @@ namespace mamba
, m_real_repo_key(rhs.m_real_repo_key)
, m_mrepo_key(rhs.m_mrepo_key)
, m_noarch_repo_key(rhs.m_noarch_repo_key)
, p_channel(rhs.p_channel)
{
rhs.m_repo = nullptr;
rhs.p_channel = nullptr;
m_repo->appdata = this;
}

MRepo& MRepo::operator=(MRepo&& rhs)
Expand All @@ -157,8 +151,6 @@ namespace mamba
swap(m_url, rhs.m_url);
swap(m_metadata, rhs.m_metadata);
swap(m_repo, rhs.m_repo);
swap(p_channel, rhs.p_channel);
m_repo->appdata = this;
swap(m_real_repo_key, rhs.m_real_repo_key);
swap(m_mrepo_key, rhs.m_mrepo_key);
swap(m_noarch_repo_key, rhs.m_noarch_repo_key);
Expand Down Expand Up @@ -257,11 +249,6 @@ namespace mamba
return m_repo;
}

const Channel* MRepo::channel() const
{
return p_channel;
}

std::tuple<int, int> MRepo::priority() const
{
return std::make_tuple(m_repo->priority, m_repo->subpriority);
Expand Down