Compare commits

...

5 Commits
main ... v4.0.1

Author SHA1 Message Date
Fries 4f63f62a29 amethyst: bump to version v4.0.1 2 years ago
Fries 0a30bb99ae operations/clean: remove unused import 2 years ago
Fries 41b150227c amethyst: add my name to the authors 2 years ago
Fries bf2b9fb39a 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.
2 years ago
mrshmllow c65331d527 Update docs url 2 years ago

2
Cargo.lock generated

@ -4,7 +4,7 @@ version = 3
[[package]]
name = "Amethyst"
version = "4.0.0"
version = "4.0.1"
dependencies = [
"alpm",
"alpm-utils",

@ -1,7 +1,7 @@
[package]
name = "Amethyst"
version = "4.0.0"
authors = ["Michal S. <michal@tar.black>", "axtlos <axtlos@tar.black>", "trivernis <trivernis@protonmail.com>"]
version = "4.0.1"
authors = ["Michal S. <michal@tar.black>", "axtlos <axtlos@tar.black>", "trivernis <trivernis@protonmail.com>", "Fries <fries@tar.black>"]
description = "A fast and efficient AUR helper"
repository = "https://github.com/crystal-linux/amethyst"
license-file = "LICENSE"

@ -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 }
}
}
@ -65,7 +59,7 @@ impl Config {
} else {
let default_conf = Config::default();
let toml_string = toml::ser::to_string_pretty(&default_conf).unwrap();
fs::write(config_path, format!("{}\n\n{}", "# See https://github.com/crystal-linux/docs/blob/main/Amethyst/config.mdx for more information on config keys", toml_string)).unwrap();
fs::write(config_path, format!("{}\n\n{}", "# See https://getcryst.al/docs/amethyst/config for more information on config keys", toml_string)).unwrap();
default_conf
}
}

@ -4,7 +4,6 @@ use crate::builder::pacman::PacmanUninstallBuilder;
use crate::builder::rm::RmBuilder;
use crate::crash;
use crate::internal::config::Config;
use crate::internal::exit_code::AppExitCode;
use crate::internal::utils::get_cache_dir;
@ -83,14 +82,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