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.
i18n
Fries 2 years ago committed by fries1234
parent 48ee44531f
commit bf34b975d2

@ -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,
}
}

@ -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;

Loading…
Cancel
Save