diff --git a/config.example.toml b/config.example.toml index 778efe1d..e3b6dece 100644 --- a/config.example.toml +++ b/config.example.toml @@ -69,6 +69,7 @@ #enable_tlmgr = true #emerge_sync_flags = "-q" #emerge_update_flags = "-uDNa --with-bdeps=y world" +#redhat_disrto_sync = false [windows] # Manually select Windows updates diff --git a/src/config.rs b/src/config.rs index bc3186ac..6dc2c95f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -153,6 +153,7 @@ pub struct Linux { trizen_arguments: Option, dnf_arguments: Option, enable_tlmgr: Option, + redhat_distro_sync: Option, emerge_sync_flags: Option, emerge_update_flags: Option, } @@ -627,7 +628,7 @@ impl Config { .and_then(|vagrant| vagrant.always_suspend) } - /// Extra yay arguments + /// Enable tlmgr on Linux #[allow(dead_code)] pub fn enable_tlmgr_linux(&self) -> bool { self.config_file @@ -637,6 +638,16 @@ impl Config { .unwrap_or(false) } + /// Use distro-sync in Red Hat based distrbutions + #[allow(dead_code)] + pub fn redhat_distro_sync(&self) -> bool { + self.config_file + .linux + .as_ref() + .and_then(|linux| linux.redhat_distro_sync) + .unwrap_or(false) + } + /// Should we ignore failures for this step pub fn ignore_failure(&self, step: Step) -> bool { self.config_file diff --git a/src/steps/os/linux.rs b/src/steps/os/linux.rs index 90906e81..b51d3401 100644 --- a/src/steps/os/linux.rs +++ b/src/steps/os/linux.rs @@ -249,7 +249,11 @@ fn upgrade_redhat(ctx: &ExecutionContext) -> Result<()> { .if_exists() .unwrap_or_else(|| Path::new("/usr/bin/yum")), ) - .arg("upgrade"); + .arg(if ctx.config().redhat_distro_sync() { + "distro-sync" + } else { + "upgrade" + }); if let Some(args) = ctx.config().dnf_arguments() { command.args(args.split_whitespace());