Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 7 additions & 5 deletions src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,11 @@ pub fn arg_to_backend(ba: BackendArg) -> Option<ABackend> {
}
}

/// Returns install-time-only option keys for a backend type.
/// These are options that only affect installation/download, not post-install behavior.
/// Used to filter cached options when config provides its own options.
/// Returns backend option keys whose cached values should be replaced by current config.
///
/// Most keys affect installation/download identity, but backend-specific lists may also
/// include layout options that are stored in the install manifest and should not be
/// reused from stale cached options when config provides its own options.
pub fn install_time_option_keys_for_type(backend_type: &BackendType) -> Vec<String> {
match backend_type {
BackendType::Http => http::install_time_option_keys(),
Expand All @@ -385,12 +387,12 @@ pub fn install_time_option_keys_for_type(backend_type: &BackendType) -> Vec<Stri
BackendType::Npm => npm::install_time_option_keys(),
BackendType::Pipx => pipx::install_time_option_keys(),
BackendType::Aqua => aqua::install_time_option_keys(),
BackendType::Spm => spm::install_time_option_keys(),
_ => vec![],
}
}

/// Returns true if a backend option only affects installation/download.
/// Used to filter cached options when config provides its own options.
/// Returns true if a backend option's cached value should be replaced by current config.
pub fn is_install_time_option_key_for_type(backend_type: &BackendType, key: &str) -> bool {
if matches!(backend_type, BackendType::Aqua) {
return aqua::is_install_time_option_key(key);
Expand Down
Loading
Loading