diff --git a/config.example.toml b/config.example.toml index b3f13f85..512a2267 100644 --- a/config.example.toml +++ b/config.example.toml @@ -67,6 +67,7 @@ #arch_package_manager = "pacman" # Arguments to pass yay (or paru) when updating packages #yay_arguments = "--nodevel" +#show_arch_news = true #trizen_arguments = "--devel" #enable_tlmgr = true #emerge_sync_flags = "-q" diff --git a/src/config.rs b/src/config.rs index bfb97920..556feada 100644 --- a/src/config.rs +++ b/src/config.rs @@ -195,6 +195,7 @@ pub enum ArchPackageManager { pub struct Linux { yay_arguments: Option, arch_package_manager: Option, + show_arch_news: Option, trizen_arguments: Option, dnf_arguments: Option, apt_arguments: Option, @@ -641,6 +642,16 @@ impl Config { .unwrap_or("") } + /// Show news on Arch Linux + #[allow(dead_code)] + pub fn show_arch_news(&self) -> bool { + self.config_file + .linux + .as_ref() + .and_then(|s| s.show_arch_news) + .unwrap_or(true) + } + /// Extra yay arguments #[allow(dead_code)] pub fn arch_package_manager(&self) -> ArchPackageManager { diff --git a/src/steps/os/archlinux.rs b/src/steps/os/archlinux.rs index ed2ae244..76eaa9dc 100644 --- a/src/steps/os/archlinux.rs +++ b/src/steps/os/archlinux.rs @@ -25,11 +25,13 @@ pub struct YayParu { impl ArchPackageManager for YayParu { fn upgrade(&self, ctx: &ExecutionContext) -> Result<()> { - Command::new(&self.executable) - .arg("-Pw") - .spawn() - .and_then(|mut p| p.wait()) - .ok(); + if ctx.config().show_arch_news() { + Command::new(&self.executable) + .arg("-Pw") + .spawn() + .and_then(|mut p| p.wait()) + .ok(); + } let mut command = ctx.run_type().execute(&self.executable);