diff --git a/Cargo.lock b/Cargo.lock index ced56bd..d4d8ea9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,22 +13,10 @@ dependencies = [ "native-tls", "regex", "rm_rf", - "rusqlite", "serde", "ureq", ] -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - [[package]] name = "atty" version = "0.2.14" @@ -143,18 +131,6 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" -[[package]] -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - -[[package]] -name = "fallible-streaming-iterator" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" - [[package]] name = "fastrand" version = "1.7.0" @@ -189,41 +165,12 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "getrandom" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] - [[package]] name = "hashbrown" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3" -[[package]] -name = "hashlink" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" -dependencies = [ - "hashbrown 0.11.2", -] - [[package]] name = "heck" version = "0.4.0" @@ -257,7 +204,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", - "hashbrown 0.12.1", + "hashbrown", ] [[package]] @@ -296,16 +243,6 @@ dependencies = [ "cc", ] -[[package]] -name = "libsqlite3-sys" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cafc7c74096c336d9d27145f7ebd4f4b6f95ba16aa5a282387267e6925cb58" -dependencies = [ - "pkg-config", - "vcpkg", -] - [[package]] name = "log" version = "0.4.17" @@ -321,12 +258,6 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - [[package]] name = "mimalloc" version = "0.1.29" @@ -516,21 +447,6 @@ dependencies = [ "stacker", ] -[[package]] -name = "rusqlite" -version = "0.26.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ba4d3462c8b2e4d7f4fcfcf2b296dc6b65404fbbc7b63daa37fd485c149daf7" -dependencies = [ - "bitflags", - "fallible-iterator", - "fallible-streaming-iterator", - "hashlink", - "libsqlite3-sys", - "memchr", - "smallvec", -] - [[package]] name = "ryu" version = "1.0.10" @@ -601,12 +517,6 @@ dependencies = [ "serde", ] -[[package]] -name = "smallvec" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" - [[package]] name = "stacker" version = "0.1.15" @@ -755,12 +665,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - [[package]] name = "winapi" version = "0.3.9" diff --git a/Cargo.toml b/Cargo.toml index fb56b2e..6802784 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,6 @@ codegen-units = 1 mimalloc = { version = "0.1.29", default-features = false } clap = { version = "3.2.8", features = [ "derive", "wrap_help" ] } regex = { version = "1.5.6", default-features = false, features = [ "std", "unicode-perl" ] } -rusqlite = { version = "0.26.3", default-features = false } colored = "2.0.0" ureq = { version = "2.4.0", default-features = false, features = [ "native-tls", "json" ] } serde = { version = "1.0.138", default-features = false, features = [ "derive", "serde_derive" ] } diff --git a/src/internal/exit_code.rs b/src/internal/exit_code.rs index aa34dff..e04fde3 100644 --- a/src/internal/exit_code.rs +++ b/src/internal/exit_code.rs @@ -1,12 +1,10 @@ pub enum AppExitCode { RunAsRoot = 1, - FailedAddingPkg = 2, - FailedInitDb = 3, - FailedCreatingPaths = 4, - MissingDeps = 5, - UserCancellation = 6, - PacmanError = 7, - GitError = 8, - MakePkgError = 9, - Other = 102, + FailedCreatingPaths = 2, + MissingDeps = 3, + UserCancellation = 4, + PacmanError = 5, + GitError = 6, + MakePkgError = 7, + Other = 63, } diff --git a/src/internal/initialise.rs b/src/internal/initialise.rs index 42cdbbd..bfafcbd 100644 --- a/src/internal/initialise.rs +++ b/src/internal/initialise.rs @@ -1,6 +1,5 @@ use std::env; use std::path::Path; -use std::process::Command; use crate::{crash, internal::exit_code::AppExitCode, log, Options}; @@ -11,6 +10,9 @@ pub fn init(options: Options) { // Initialise stateful directory if !Path::new(&format!("{}/.local/share/ame", homedir)).exists() { + if verbosity >= 1 { + log!("Initialising stateful directory"); + } std::fs::create_dir_all(format!("{}/.local/share/ame", homedir)).unwrap_or_else(|e| { crash!( AppExitCode::FailedCreatingPaths, @@ -22,6 +24,9 @@ pub fn init(options: Options) { // If cache path doesn't exist, create it, if it does, delete it and recreate it if !Path::new(&format!("{}/.cache/ame/", homedir)).exists() { + if verbosity >= 1 { + log!("Initialising cache directory"); + } std::fs::create_dir_all(format!("{}/.cache/ame", homedir)).unwrap_or_else(|e| { crash!( AppExitCode::FailedCreatingPaths, @@ -31,6 +36,9 @@ pub fn init(options: Options) { ); }); } else { + if verbosity >= 1 { + log!("Deleting cache directory"); + } rm_rf::remove(format!("{}/.cache/ame", homedir)).unwrap_or_else(|e| { crash!( AppExitCode::FailedCreatingPaths, @@ -39,6 +47,9 @@ pub fn init(options: Options) { e ) }); + if verbosity >= 1 { + log!("Creating cache directory"); + } std::fs::create_dir_all(format!("{}/.cache/ame", homedir)).unwrap_or_else(|e| { crash!( AppExitCode::FailedCreatingPaths, diff --git a/src/main.rs b/src/main.rs index f3772f2..dda3fb1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,5 @@ -#![warn(clippy::all, clippy::pedantic, clippy::nursery, clippy::cargo)] -#![allow(clippy::too_many_lines)] +// #![warn(clippy::all, clippy::pedantic, clippy::nursery, clippy::cargo)] +// #![allow(clippy::too_many_lines)] use args::Args; use clap::Parser; diff --git a/src/operations/upgrade.rs b/src/operations/upgrade.rs index 1ed3ed7..a30cd8e 100644 --- a/src/operations/upgrade.rs +++ b/src/operations/upgrade.rs @@ -53,7 +53,7 @@ pub fn upgrade(options: Options) { } // List non-native packages using `pacman -Qm` and collect to a Vec - let mut non_native = ShellCommand::pacman() + let non_native = ShellCommand::pacman() .arg("-Qm") .args(&["--color", "never"]) .wait_with_output()