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.
Fries 2 years ago
parent c65331d527
commit bf2b9fb39a

@ -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,
}
#[derive(Debug, Deserialize, Serialize, Default)]
@ -34,11 +32,7 @@ pub struct ConfigBin {
impl Default for ConfigBase {
fn default() -> Self {
Self {
pacdiff_warn: true,
paccache_keep: 0,
paccache_keep_ins_pkgs: true,
}
Self { pacdiff_warn: 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