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

Handle package cache in secondary locations. #856

Merged
merged 3 commits into from
Apr 19, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Ignore missing package cache when unlinking.
wenjuno committed Apr 16, 2021
commit cdbe9c2b18ea292209355ebb49686b00f1a5e5f3
13 changes: 8 additions & 5 deletions src/core/transaction.cpp
Original file line number Diff line number Diff line change
@@ -576,11 +576,13 @@ namespace mamba
Console::stream()
<< "Changing " << PackageInfo(s).str() << " ==> " << PackageInfo(s2).str();
PackageInfo p_unlink(s);
const fs::path ul_cache_path(m_multi_cache.first_cache_path(p_unlink, false));
const fs::path ul_cache_path(m_multi_cache.first_cache_path(p_unlink));
PackageInfo p_link(s2);
const fs::path l_cache_path(m_multi_cache.first_cache_path(p_link, false));

UnlinkPackage up(p_unlink, ul_cache_path, &m_transaction_context);
UnlinkPackage up(p_unlink,
ul_cache_path.empty() ? m_cache_path : ul_cache_path,
&m_transaction_context);
up.execute();
rollback.record(up);

@@ -596,9 +598,10 @@ namespace mamba
case SOLVER_TRANSACTION_ERASE:
{
PackageInfo p(s);
const fs::path cache_path(m_multi_cache.first_cache_path(p, false));
Console::stream() << "Unlinking " << p.str();
UnlinkPackage up(p, cache_path, &m_transaction_context);
const fs::path cache_path(m_multi_cache.first_cache_path(p));
UnlinkPackage up(
p, cache_path.empty() ? m_cache_path : cache_path, &m_transaction_context);
up.execute();
rollback.record(up);
m_history_entry.unlink_dists.push_back(p.long_str());
@@ -607,8 +610,8 @@ namespace mamba
case SOLVER_TRANSACTION_INSTALL:
{
PackageInfo p(s);
const fs::path cache_path(m_multi_cache.first_cache_path(p, false));
Console::stream() << "Linking " << p.str();
const fs::path cache_path(m_multi_cache.first_cache_path(p, false));
LinkPackage lp(p, cache_path, &m_transaction_context);
lp.execute();
rollback.record(lp);