From bf34b975d2a92333ee63d1a2c0e350b03c5ac0ff Mon Sep 17 00:00:00 2001 From: Fries Date: Sun, 18 Sep 2022 09:01:54 -0700 Subject: [PATCH] operations/clean: make sure paccache keeps 3 pkgs looks like .pacnew files don't generate properly unless theres like 3 packages in the pacman cache. why is pacman so confusing i swear nobody knows how it works. well anyways this commit also removes the config keys `paccache_keep` and `paccache_keep_ins_pkgs` as they shouldnt be able to be changed. --- src/internal/config.rs | 4 ---- src/operations/clean.rs | 10 ++++------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/internal/config.rs b/src/internal/config.rs index dcdcd47..78600c0 100644 --- a/src/internal/config.rs +++ b/src/internal/config.rs @@ -17,8 +17,6 @@ pub struct Config { #[derive(Debug, Deserialize, Serialize)] pub struct ConfigBase { pub pacdiff_warn: bool, - pub paccache_keep: i32, - pub paccache_keep_ins_pkgs: bool, pub aur_verification_prompt: bool, } @@ -37,8 +35,6 @@ impl Default for ConfigBase { fn default() -> Self { Self { pacdiff_warn: true, - paccache_keep: 0, - paccache_keep_ins_pkgs: true, aur_verification_prompt: true, } } diff --git a/src/operations/clean.rs b/src/operations/clean.rs index 2c5f92f..85858a8 100644 --- a/src/operations/clean.rs +++ b/src/operations/clean.rs @@ -83,14 +83,12 @@ pub async fn clean(options: Options) { let clear_pacman_cache = noconfirm || prompt!(default no, "Also clear pacman's package cache?"); if clear_pacman_cache { - let conf = Config::read(); - // Clear pacman's cache - // keeps 0 versions of the package in the cache by default - // keeps installed packages in the cache by default + // keeps 3 versions of the package in the cache + // keeps installed packages in the cache let result = PaccacheBuilder::default() - .set_keep(conf.base.paccache_keep) - .keep_ins_pkgs(conf.base.paccache_keep_ins_pkgs) + .set_keep(3) + .keep_ins_pkgs(true) .quiet_output(quiet) .remove() .await;