Enable distro-sync in Fedora (fix #587) (#590)

This commit is contained in:
Roey Darwish Dror
2020-12-26 09:17:54 +02:00
committed by GitHub
parent cdbcd7be7a
commit a519bc5475
3 changed files with 18 additions and 2 deletions

View File

@@ -69,6 +69,7 @@
#enable_tlmgr = true #enable_tlmgr = true
#emerge_sync_flags = "-q" #emerge_sync_flags = "-q"
#emerge_update_flags = "-uDNa --with-bdeps=y world" #emerge_update_flags = "-uDNa --with-bdeps=y world"
#redhat_disrto_sync = false
[windows] [windows]
# Manually select Windows updates # Manually select Windows updates

View File

@@ -153,6 +153,7 @@ pub struct Linux {
trizen_arguments: Option<String>, trizen_arguments: Option<String>,
dnf_arguments: Option<String>, dnf_arguments: Option<String>,
enable_tlmgr: Option<bool>, enable_tlmgr: Option<bool>,
redhat_distro_sync: Option<bool>,
emerge_sync_flags: Option<String>, emerge_sync_flags: Option<String>,
emerge_update_flags: Option<String>, emerge_update_flags: Option<String>,
} }
@@ -627,7 +628,7 @@ impl Config {
.and_then(|vagrant| vagrant.always_suspend) .and_then(|vagrant| vagrant.always_suspend)
} }
/// Extra yay arguments /// Enable tlmgr on Linux
#[allow(dead_code)] #[allow(dead_code)]
pub fn enable_tlmgr_linux(&self) -> bool { pub fn enable_tlmgr_linux(&self) -> bool {
self.config_file self.config_file
@@ -637,6 +638,16 @@ impl Config {
.unwrap_or(false) .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 /// Should we ignore failures for this step
pub fn ignore_failure(&self, step: Step) -> bool { pub fn ignore_failure(&self, step: Step) -> bool {
self.config_file self.config_file

View File

@@ -249,7 +249,11 @@ fn upgrade_redhat(ctx: &ExecutionContext) -> Result<()> {
.if_exists() .if_exists()
.unwrap_or_else(|| Path::new("/usr/bin/yum")), .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() { if let Some(args) = ctx.config().dnf_arguments() {
command.args(args.split_whitespace()); command.args(args.split_whitespace());