feat: new step Lensfun's database update (#839)
* feat: new step Lensfun's database update * refactor: take 1 as a success exit code
This commit is contained in:
@@ -101,6 +101,7 @@ pub enum Step {
|
||||
Helix,
|
||||
Krew,
|
||||
Lure,
|
||||
Lensfun,
|
||||
Macports,
|
||||
Mamba,
|
||||
Miktex,
|
||||
@@ -396,6 +397,12 @@ pub struct Misc {
|
||||
log_filters: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Default, Debug, Merge)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct Lensfun {
|
||||
use_sudo: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Default, Debug, Merge)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
/// Configuration file
|
||||
@@ -456,6 +463,9 @@ pub struct ConfigFile {
|
||||
|
||||
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
|
||||
distrobox: Option<Distrobox>,
|
||||
|
||||
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
|
||||
lensfun: Option<Lensfun>,
|
||||
}
|
||||
|
||||
fn config_directory() -> PathBuf {
|
||||
@@ -1523,6 +1533,14 @@ impl Config {
|
||||
|
||||
self.opt.custom_commands.iter().any(|s| s == name)
|
||||
}
|
||||
|
||||
pub fn lensfun_use_sudo(&self) -> bool {
|
||||
self.config_file
|
||||
.lensfun
|
||||
.as_ref()
|
||||
.and_then(|lensfun| lensfun.use_sudo)
|
||||
.unwrap_or(false)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user