Skip to content

Commit 9ad464b

Browse files
AntoinePrvjjerphan
andauthored
Simplify SubdirData (#3926)
Co-authored-by: Julien Jerphanion <[email protected]>
1 parent 1b3b9e1 commit 9ad464b

File tree

11 files changed

+458
-284
lines changed

11 files changed

+458
-284
lines changed

libmamba/include/mamba/core/context.hpp

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include "mamba/core/common_types.hpp"
1616
#include "mamba/core/palette.hpp"
17+
#include "mamba/core/subdir_parameters.hpp"
1718
#include "mamba/core/tasksync.hpp"
1819
#include "mamba/download/mirror_map.hpp"
1920
#include "mamba/download/parameters.hpp"
@@ -174,6 +175,14 @@ namespace mamba
174175
// micromamba only
175176
bool shell_completion = true;
176177

178+
OutputParams output_params;
179+
GraphicsParams graphics_params;
180+
SrcParams src_params;
181+
CommandParams command_params;
182+
ThreadsParams threads_params;
183+
PrefixParams prefix_params;
184+
ValidationParams validation_params;
185+
177186
download::RemoteFetchParams remote_fetch_params = {
178187
/* .ssl_verify */ { "" },
179188
/* .ssl_no_revoke */ false,
@@ -196,13 +205,15 @@ namespace mamba
196205
};
197206
}
198207

199-
OutputParams output_params;
200-
GraphicsParams graphics_params;
201-
SrcParams src_params;
202-
CommandParams command_params;
203-
ThreadsParams threads_params;
204-
PrefixParams prefix_params;
205-
ValidationParams validation_params;
208+
SubdirParams subdir_params() const
209+
{
210+
return {
211+
/* .local_repodata_ttl */ this->local_repodata_ttl,
212+
/* .offline */ this->offline,
213+
/* .use_index_cache */ this->use_index_cache,
214+
/* .repodata_use_zst */ this->repodata_use_zst,
215+
};
216+
}
206217

207218
std::size_t lock_timeout = 0;
208219
bool use_lockfiles = true;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (c) 2025, QuantStack and Mamba Contributors
2+
//
3+
// Distributed under the terms of the BSD 3-Clause License.
4+
//
5+
// The full license is in the file LICENSE, distributed with this software.
6+
7+
#ifndef MAMBA_CORE_SUBDIR_PARAMETERS_HPP
8+
#define MAMBA_CORE_SUBDIR_PARAMETERS_HPP
9+
10+
#include <cstddef>
11+
12+
namespace mamba
13+
{
14+
struct SubdirParams
15+
{
16+
std::size_t local_repodata_ttl = 1;
17+
bool offline = false;
18+
bool use_index_cache = true;
19+
bool repodata_use_zst = true;
20+
};
21+
}
22+
23+
#endif

0 commit comments

Comments
 (0)