From f1f41a86e042a37c912cb3a7d3a5eb5344c2bd23 Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 4 Jul 2022 13:56:25 +0000 Subject: [PATCH 01/19] Fixed Cargo.toml & flake.nix, solved issue #6, added new warn(); helper function. --- .envrc | 1 + .gitignore | 1 + Cargo.toml | 1 + flake.nix | 4 ++-- src/internal/strings.rs | 8 ++++++++ src/main.rs | 3 ++- src/operations/upgrade.rs | 17 ++++++++++++++--- 7 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 .envrc diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..8392d15 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4c72f7e..b7f9a44 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ ame.exe .idea result .DS_Store +.direnv \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 53dc266..4be0d1c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,7 @@ authors = ["michal ", "axtlos "] edition = "2021" description = "A fast and efficient AUR helper" license-file = "LICENSE.md" +default-run = "ame" [features] pkg-warner = [] diff --git a/flake.nix b/flake.nix index 293d992..f3e5eff 100644 --- a/flake.nix +++ b/flake.nix @@ -22,7 +22,7 @@ ]; }; - defaultPackage = packages.amethyst; + packages.default = packages.amethyst; apps.amethyst = utils.lib.mkApp { drv = packages.amethyst; @@ -30,7 +30,7 @@ apps.default = apps.amethyst; - devShell = pkgs.mkShell { + devShells.default = pkgs.mkShell { nativeBuildInputs = with pkgs; [ rustc cargo diff --git a/src/internal/strings.rs b/src/internal/strings.rs index 3ffe71d..b2340c2 100644 --- a/src/internal/strings.rs +++ b/src/internal/strings.rs @@ -13,6 +13,14 @@ pub fn info(msg: S) { println!("\x1b[2;22;35m❖\x1b[0m \x1b[1;37m{}\x1b[0m", a) } +#[allow(dead_code)] +pub fn warn(msg: S) { + let a = msg.to_string(); + let a = if internal::uwu_enabled() { uwu!(&a) } else { a }; + + println!("\x1b[2;22;33m!\x1b[0m \x1b[1;37m{}\x1b[0m", a) +} + pub fn crash(msg: S, exit_code: AppExitCode) -> ! { let a = msg.to_string(); let a = if internal::uwu_enabled() { uwu!(&a) } else { a }; diff --git a/src/main.rs b/src/main.rs index a9742b5..466c150 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,7 +6,8 @@ use internal::commands::ShellCommand; use internal::error::SilentUnwrap; use crate::internal::exit_code::AppExitCode; -use crate::internal::{crash, info, init, log, sort, structs::Options}; +#[allow(unused_imports)] +use crate::internal::{crash, warn, prompt, info, init, log, sort, structs::Options}; #[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; diff --git a/src/operations/upgrade.rs b/src/operations/upgrade.rs index f03d20d..582a121 100644 --- a/src/operations/upgrade.rs +++ b/src/operations/upgrade.rs @@ -3,7 +3,7 @@ use crate::internal::error::SilentUnwrap; use crate::internal::exit_code::AppExitCode; use crate::internal::rpc::rpcinfo; use crate::operations::aur_install::aur_install; -use crate::{info, log, Options}; +use crate::{info, log, prompt, Options}; pub fn upgrade(options: Options) { let verbosity = options.verbosity; @@ -18,12 +18,23 @@ pub fn upgrade(options: Options) { log("Upgrading repo packages".to_string()); } - ShellCommand::pacman() + let pacman_result = ShellCommand::pacman() .elevated() .args(pacman_args) - .wait_success() + .wait() .silent_unwrap(AppExitCode::PacmanError); + if pacman_result.success() { + info("Successfully upgraded repo packages".to_string()); + } else { + let cont = prompt("Failed to upgrade repo packages, continue to upgrading AUR packages?".to_string(), false); + if !cont { + info("Exiting".to_string()); + std::process::exit(AppExitCode::PacmanError as i32); + } + } + + if verbosity >= 1 { log("Upgrading AUR packages".to_string()); } From 92b7829fe15206981387ed5a3274694c2feda890 Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 4 Jul 2022 14:12:30 +0000 Subject: [PATCH 02/19] Initial implementation of new clean subcommand --- src/args.rs | 4 ++ src/main.rs | 6 ++- src/operations/clean.rs | 79 +++++++++++++++++++++++++++++++++++++++ src/operations/mod.rs | 2 + src/operations/upgrade.rs | 6 ++- 5 files changed, 94 insertions(+), 3 deletions(-) create mode 100644 src/operations/clean.rs diff --git a/src/args.rs b/src/args.rs index a2815cd..c8c2a73 100644 --- a/src/args.rs +++ b/src/args.rs @@ -36,6 +36,10 @@ pub enum Operation { /// Upgrades locally installed packages to their latest versions #[clap(name="upgrade", aliases=&["upg", "up", "u", "-Syu"])] Upgrade, + + /// Removes all orphaned packages + #[clap(name="clean", aliases=&["cln", "cl", "-Sc"])] + Clean, } impl Default for Operation { diff --git a/src/main.rs b/src/main.rs index 466c150..b3eabae 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,7 @@ use internal::error::SilentUnwrap; use crate::internal::exit_code::AppExitCode; #[allow(unused_imports)] -use crate::internal::{crash, warn, prompt, info, init, log, sort, structs::Options}; +use crate::internal::{crash, info, init, log, prompt, sort, structs::Options, warn}; #[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; @@ -44,6 +44,10 @@ fn main() { info("Performing system upgrade".to_string()); operations::upgrade(options); } + Operation::Clean => { + info("Removing orphaned packages".to_string()); + operations::clean(options); + } } } diff --git a/src/operations/clean.rs b/src/operations/clean.rs new file mode 100644 index 0000000..f71663d --- /dev/null +++ b/src/operations/clean.rs @@ -0,0 +1,79 @@ +use crate::crash; +use crate::info; +use crate::internal::commands::ShellCommand; +use crate::internal::error::SilentUnwrap; +use crate::internal::exit_code::AppExitCode; +use crate::log; +use crate::prompt; +use crate::Options; + +pub fn clean(options: Options) { + let verbosity = options.verbosity; + let noconfirm = options.noconfirm; + + let orphaned_packages = ShellCommand::pacman() + .arg("-Qdt") + .wait_with_output() + .silent_unwrap(AppExitCode::PacmanError); + + info(format!( + "Removing orphans would uninstall the following packages: \n{}", + &orphaned_packages.stdout + )); + let cont = prompt("Continue?".to_string(), false); + if !cont { + info("Exiting".to_string()); + std::process::exit(AppExitCode::PacmanError as i32); + } + + let mut pacman_args = vec!["-Rns"]; + if noconfirm { + pacman_args.push("--noconfirm"); + } + + if verbosity >= 1 { + log("Removing orphans".to_string()); + } + + let pacman_result = ShellCommand::pacman() + .elevated() + .args(pacman_args) + .wait() + .silent_unwrap(AppExitCode::PacmanError); + + if pacman_result.success() { + info("Successfully removed orphans".to_string()); + } else { + crash( + "Failed to remove orphans".to_string(), + AppExitCode::PacmanError, + ); + } + + let clear_cache = prompt("Also clear pacman's package cache?".to_string(), false); + if clear_cache { + let mut pacman_args = vec!["-Scc"]; + if noconfirm { + pacman_args.push("--noconfirm"); + } + + if verbosity >= 1 { + log("Clearing package cache".to_string()); + } + + let pacman_result = ShellCommand::pacman() + .elevated() + .args(pacman_args) + .wait() + .silent_unwrap(AppExitCode::PacmanError); + + if pacman_result.success() { + info("Successfully cleared package cache".to_string()); + } else { + crash( + "Failed to clear package cache".to_string(), + AppExitCode::PacmanError, + ); + } + } +} diff --git a/src/operations/mod.rs b/src/operations/mod.rs index 7782641..6966d43 100644 --- a/src/operations/mod.rs +++ b/src/operations/mod.rs @@ -1,10 +1,12 @@ mod aur_install; +mod clean; mod install; mod search; mod uninstall; mod upgrade; pub use aur_install::*; +pub use clean::*; pub use install::*; pub use search::{aur_search, repo_search as search}; pub use uninstall::*; diff --git a/src/operations/upgrade.rs b/src/operations/upgrade.rs index 582a121..c3542ef 100644 --- a/src/operations/upgrade.rs +++ b/src/operations/upgrade.rs @@ -27,14 +27,16 @@ pub fn upgrade(options: Options) { if pacman_result.success() { info("Successfully upgraded repo packages".to_string()); } else { - let cont = prompt("Failed to upgrade repo packages, continue to upgrading AUR packages?".to_string(), false); + let cont = prompt( + "Failed to upgrade repo packages, continue to upgrading AUR packages?".to_string(), + false, + ); if !cont { info("Exiting".to_string()); std::process::exit(AppExitCode::PacmanError as i32); } } - if verbosity >= 1 { log("Upgrading AUR packages".to_string()); } From ab5e337012b63c307efa2f81824d36d95b85d3a4 Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 4 Jul 2022 14:35:19 +0000 Subject: [PATCH 03/19] Amethyst now checks for .pacnew and .pacsave files and prompts the user to run pacdiff if necessary --- src/internal/commands.rs | 4 ++++ src/internal/detect.rs | 29 +++++++++++++++++++++++------ src/internal/mod.rs | 2 ++ src/main.rs | 3 +++ 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/internal/commands.rs b/src/internal/commands.rs index 6020912..09cba04 100644 --- a/src/internal/commands.rs +++ b/src/internal/commands.rs @@ -28,6 +28,10 @@ impl ShellCommand { } } + pub fn pacdiff() -> Self { + Self::new("pacdiff") + } + pub fn makepkg() -> Self { Self::new("makepkg") } diff --git a/src/internal/detect.rs b/src/internal/detect.rs index 28166c2..189c03f 100644 --- a/src/internal/detect.rs +++ b/src/internal/detect.rs @@ -1,9 +1,26 @@ -use crate::internal::strings::info; +use crate::internal::strings::prompt; +use crate::internal::error::SilentUnwrap; +use crate::internal::exit_code::AppExitCode; +use crate::internal::commands::ShellCommand; -pub fn detect(a: String) { - if a.contains(".pacnew") || a.contains(".new") { - info("It appears that a program you have installed / upgraded has installed a .new/.pacnew config file. Please read over the pacman output and act on it accordingly".to_string()); - } else if a.contains(".old") { - info("It appears that a program you have installed / upgraded has installed a .old config file. Please read over the pacman output and act on it accordingly".to_string()); +pub fn detect() { + let mut pacnew = vec![]; + + for entry in std::fs::read_dir("/etc").unwrap() { + let entry = entry.unwrap(); + let path = entry.path(); + if path.to_str().unwrap().contains(".pacnew") || path.to_str().unwrap().contains(".pacsave") { + pacnew.push(path); + } + } + + if !pacnew.is_empty() { + let choice = prompt("It appears that at least one program you have installed / upgraded has installed a .pacnew/.pacsave config file. Would you like to run pacdiff to deal with this?".to_string(), true); + if choice { + ShellCommand::pacdiff() + .elevated() + .wait() + .silent_unwrap(AppExitCode::PacmanError); + } } } diff --git a/src/internal/mod.rs b/src/internal/mod.rs index 5f8be49..7f491d9 100644 --- a/src/internal/mod.rs +++ b/src/internal/mod.rs @@ -7,12 +7,14 @@ pub mod rpc; mod sort; mod strings; pub mod structs; +mod detect; pub use clean::*; pub use initialise::*; pub use sort::*; use std::env; pub use strings::*; +pub use detect::*; #[macro_export] macro_rules! uwu { diff --git a/src/main.rs b/src/main.rs index b3eabae..6002edf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,6 +8,7 @@ use internal::error::SilentUnwrap; use crate::internal::exit_code::AppExitCode; #[allow(unused_imports)] use crate::internal::{crash, info, init, log, prompt, sort, structs::Options, warn}; +use crate::internal::detect; #[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; @@ -49,6 +50,8 @@ fn main() { operations::clean(options); } } + + detect(); } fn cmd_install(args: InstallArgs, options: Options) { From 468d7027e337b3b0a7b545df981105c2b5d0d50d Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 4 Jul 2022 14:36:00 +0000 Subject: [PATCH 04/19] Cargo fmt --- src/internal/detect.rs | 7 ++++--- src/internal/mod.rs | 4 ++-- src/main.rs | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/internal/detect.rs b/src/internal/detect.rs index 189c03f..621475c 100644 --- a/src/internal/detect.rs +++ b/src/internal/detect.rs @@ -1,7 +1,7 @@ -use crate::internal::strings::prompt; +use crate::internal::commands::ShellCommand; use crate::internal::error::SilentUnwrap; use crate::internal::exit_code::AppExitCode; -use crate::internal::commands::ShellCommand; +use crate::internal::strings::prompt; pub fn detect() { let mut pacnew = vec![]; @@ -9,7 +9,8 @@ pub fn detect() { for entry in std::fs::read_dir("/etc").unwrap() { let entry = entry.unwrap(); let path = entry.path(); - if path.to_str().unwrap().contains(".pacnew") || path.to_str().unwrap().contains(".pacsave") { + if path.to_str().unwrap().contains(".pacnew") || path.to_str().unwrap().contains(".pacsave") + { pacnew.push(path); } } diff --git a/src/internal/mod.rs b/src/internal/mod.rs index 7f491d9..ca87eca 100644 --- a/src/internal/mod.rs +++ b/src/internal/mod.rs @@ -1,5 +1,6 @@ mod clean; pub mod commands; +mod detect; pub mod error; pub mod exit_code; mod initialise; @@ -7,14 +8,13 @@ pub mod rpc; mod sort; mod strings; pub mod structs; -mod detect; pub use clean::*; +pub use detect::*; pub use initialise::*; pub use sort::*; use std::env; pub use strings::*; -pub use detect::*; #[macro_export] macro_rules! uwu { diff --git a/src/main.rs b/src/main.rs index 6002edf..063209d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,10 +5,10 @@ use args::Args; use internal::commands::ShellCommand; use internal::error::SilentUnwrap; +use crate::internal::detect; use crate::internal::exit_code::AppExitCode; #[allow(unused_imports)] use crate::internal::{crash, info, init, log, prompt, sort, structs::Options, warn}; -use crate::internal::detect; #[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; From d26e6f1a1ea5c879316a1f7cfa61bb0a9ab7fd96 Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 4 Jul 2022 14:43:17 +0000 Subject: [PATCH 05/19] Fixed up PKGBUILD and bumped ver --- Cargo.toml | 2 +- PKGBUILD | 36 +++++++++++++++++++++++------------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4be0d1c..7a31cd3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "Amethyst" -version = "3.2.0" +version = "3.3.0" authors = ["michal ", "axtlos "] edition = "2021" description = "A fast and efficient AUR helper" diff --git a/PKGBUILD b/PKGBUILD index 8dfe1cf..11c5ea3 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,27 +1,37 @@ -# Maintainer: Matt C -# Developer: axtlos -# Developer: jnats +# Maintainer: Matt C +# Developer: axtlos +# Developer: Michal S pkgname=amethyst -pkgver=3.2.0 +pkgver=3.3.0 pkgrel=1 -pkgdesc="Fast, efficient and lightweight AUR helper/pacman wrapper" -arch=('any') -url="https://git.tar.black/crystal/ame" +pkgdesc="A fast and efficient AUR helper" +arch=('$CARCH') +url="https://github.com/crystal-linux/amethyst" license=('GPL3') -source=("git+https://git.tar.black/crystal/ame") +source=("git+$url") sha256sums=('SKIP') depends=('git' 'binutils' 'fakeroot') makedepends=('cargo' 'make') conflicts=('ame') +prepare() { + cd "$srcdir/$pkgname" + cargo fetch --locked --target "$CARCH-unknown-linux-gnu" +} + build() { - cd ${srcdir}/ame - cargo build --release --all-features + cd "$srcdir/$pkgname" + export RUSTUP_TOOLCHAIN=stable + export CARGO_TARGET_DIR=target + cargo build --frozen --release --all-features } package() { - mkdir -p $pkgdir/usr/bin - chmod +x ${srcdir}/ame/target/release/{ame,apt,apt-get,dnf,eopkg,yum,zypper} - cp ${srcdir}/ame/target/release/{ame,apt,apt-get,dnf,eopkg,yum,zypper} $pkgdir/usr/bin/. + cd "$srcdir/$pkgname" + find target/release \ + -maxdepth 1 \ + -executable \ + -type f \ + -exec install -Dm0755 {} "${pkgdir}/usr/bin/" {} + } From 393e3969cb0614473bcb5211ee56b59bc7978391 Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 4 Jul 2022 14:47:05 +0000 Subject: [PATCH 06/19] Fixed depends and makedepends in PKGBUILD --- PKGBUILD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 11c5ea3..1dc3a7e 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -11,8 +11,8 @@ url="https://github.com/crystal-linux/amethyst" license=('GPL3') source=("git+$url") sha256sums=('SKIP') -depends=('git' 'binutils' 'fakeroot') -makedepends=('cargo' 'make') +depends=('git' 'binutils' 'fakeroot' 'pacman-contrib') +makedepends=('cargo') conflicts=('ame') prepare() { From 62652b3459b4b68e62fcf5a12e78a01784fdab73 Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 4 Jul 2022 15:46:20 +0000 Subject: [PATCH 07/19] Import optimisation --- Cargo.lock | 2 +- src/args.rs | 14 +++++++------- src/database/add.rs | 3 +-- src/database/initialise.rs | 3 +-- src/database/mod.rs | 10 +++++----- src/database/query.rs | 3 +-- src/database/remove.rs | 3 +-- src/internal/commands.rs | 5 +++-- src/internal/error.rs | 5 +++-- src/internal/initialise.rs | 2 +- src/internal/mod.rs | 14 +++++++------- src/main.rs | 5 ++--- src/operations/mod.rs | 14 +++++++------- 13 files changed, 40 insertions(+), 43 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 38d087d..0e8ab9d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "Amethyst" -version = "3.2.0" +version = "3.3.0" dependencies = [ "clap", "libc", diff --git a/src/args.rs b/src/args.rs index c8c2a73..9205c9a 100644 --- a/src/args.rs +++ b/src/args.rs @@ -1,7 +1,7 @@ use clap::{Parser, Subcommand}; #[derive(Debug, Clone, Parser)] -#[clap(name="Amethyst", version=env!("CARGO_PKG_VERSION"), about=env!("CARGO_PKG_DESCRIPTION"))] +#[clap(name = "Amethyst", version = env ! ("CARGO_PKG_VERSION"), about = env ! ("CARGO_PKG_DESCRIPTION"))] pub struct Args { #[clap(subcommand)] pub subcommand: Option, @@ -18,27 +18,27 @@ pub struct Args { #[derive(Debug, Clone, Subcommand)] pub enum Operation { /// Installs a package from either the AUR or the PacMan-defined repositories - #[clap(name="install", aliases=&["ins", "in", "i", "-S"])] + #[clap(name = "install", aliases = & ["ins", "in", "i", "-S"])] Install(InstallArgs), /// Removes a previously installed package - #[clap(name="remove", aliases=&["rm", "r", "-R", "-Rs"])] + #[clap(name = "remove", aliases = & ["rm", "r", "-R", "-Rs"])] Remove(RemoveArgs), /// Searches for the relevant packages in both the AUR and repos - #[clap(name="search", aliases=&["sea", "se", "s", "-Ss"])] + #[clap(name = "search", aliases = & ["sea", "se", "s", "-Ss"])] Search(SearchArgs), /// Queries installed packages - #[clap(name="query", aliases=&["ls", "l", "-Q"])] + #[clap(name = "query", aliases = & ["ls", "l", "-Q"])] Query(QueryArgs), /// Upgrades locally installed packages to their latest versions - #[clap(name="upgrade", aliases=&["upg", "up", "u", "-Syu"])] + #[clap(name = "upgrade", aliases = & ["upg", "up", "u", "-Syu"])] Upgrade, /// Removes all orphaned packages - #[clap(name="clean", aliases=&["cln", "cl", "-Sc"])] + #[clap(name = "clean", aliases = & ["cln", "cl", "-Sc"])] Clean, } diff --git a/src/database/add.rs b/src/database/add.rs index 07cbd9a..b722099 100644 --- a/src/database/add.rs +++ b/src/database/add.rs @@ -1,8 +1,7 @@ +use rusqlite::Connection; use std::env; use std::path::Path; -use rusqlite::Connection; - use crate::internal::exit_code::AppExitCode; use crate::internal::rpc::Package; use crate::{crash, log, Options}; diff --git a/src/database/initialise.rs b/src/database/initialise.rs index 89105d7..b0e272a 100644 --- a/src/database/initialise.rs +++ b/src/database/initialise.rs @@ -1,8 +1,7 @@ +use rusqlite::Connection; use std::env; use std::path::Path; -use rusqlite::Connection; - use crate::internal::exit_code::AppExitCode; use crate::{crash, log, Options}; diff --git a/src/database/mod.rs b/src/database/mod.rs index 705843c..bbdfd08 100644 --- a/src/database/mod.rs +++ b/src/database/mod.rs @@ -1,9 +1,9 @@ -mod add; -mod initialise; -mod query; -mod remove; - pub use add::*; pub use initialise::*; pub use query::*; pub use remove::*; + +mod add; +mod initialise; +mod query; +mod remove; diff --git a/src/database/query.rs b/src/database/query.rs index d12470d..112db3a 100644 --- a/src/database/query.rs +++ b/src/database/query.rs @@ -1,8 +1,7 @@ +use rusqlite::Connection; use std::env; use std::path::Path; -use rusqlite::Connection; - use crate::internal::rpc::Package; use crate::{log, Options}; diff --git a/src/database/remove.rs b/src/database/remove.rs index c213e3b..3b5de42 100644 --- a/src/database/remove.rs +++ b/src/database/remove.rs @@ -1,8 +1,7 @@ +use rusqlite::Connection; use std::env; use std::path::Path; -use rusqlite::Connection; - use crate::{log, Options}; pub fn remove(pkg: &str, options: Options) { diff --git a/src/internal/commands.rs b/src/internal/commands.rs index 09cba04..660e314 100644 --- a/src/internal/commands.rs +++ b/src/internal/commands.rs @@ -1,8 +1,9 @@ -use crate::internal::error::{AppError, AppResult}; -use crate::internal::is_tty; use std::ffi::{OsStr, OsString}; use std::process::{Child, Command, ExitStatus, Stdio}; +use crate::internal::error::{AppError, AppResult}; +use crate::internal::is_tty; + pub struct StringOutput { pub stdout: String, pub stderr: String, diff --git a/src/internal/error.rs b/src/internal/error.rs index 02e3010..957603c 100644 --- a/src/internal/error.rs +++ b/src/internal/error.rs @@ -1,9 +1,10 @@ -use crate::crash; -use crate::internal::exit_code::AppExitCode; use std::error::Error; use std::fmt::{Debug, Display, Formatter}; use std::io; +use crate::crash; +use crate::internal::exit_code::AppExitCode; + pub type AppResult = Result; #[derive(Debug)] diff --git a/src/internal/initialise.rs b/src/internal/initialise.rs index 200f14a..71a9df5 100644 --- a/src/internal/initialise.rs +++ b/src/internal/initialise.rs @@ -1,8 +1,8 @@ -use crate::internal::exit_code::AppExitCode; use std::env; use std::path::Path; use std::process::Command; +use crate::internal::exit_code::AppExitCode; use crate::internal::strings::{crash, log}; use crate::Options; diff --git a/src/internal/mod.rs b/src/internal/mod.rs index ca87eca..f0a69f6 100644 --- a/src/internal/mod.rs +++ b/src/internal/mod.rs @@ -1,3 +1,10 @@ +pub use clean::*; +pub use detect::*; +pub use initialise::*; +pub use sort::*; +use std::env; +pub use strings::*; + mod clean; pub mod commands; mod detect; @@ -9,13 +16,6 @@ mod sort; mod strings; pub mod structs; -pub use clean::*; -pub use detect::*; -pub use initialise::*; -pub use sort::*; -use std::env; -pub use strings::*; - #[macro_export] macro_rules! uwu { ($x:expr) => {{ diff --git a/src/main.rs b/src/main.rs index 063209d..a6482af 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,10 +1,9 @@ -use clap::Parser; - -use crate::args::{InstallArgs, Operation, QueryArgs, RemoveArgs, SearchArgs}; use args::Args; +use clap::Parser; use internal::commands::ShellCommand; use internal::error::SilentUnwrap; +use crate::args::{InstallArgs, Operation, QueryArgs, RemoveArgs, SearchArgs}; use crate::internal::detect; use crate::internal::exit_code::AppExitCode; #[allow(unused_imports)] diff --git a/src/operations/mod.rs b/src/operations/mod.rs index 6966d43..ef348bb 100644 --- a/src/operations/mod.rs +++ b/src/operations/mod.rs @@ -1,13 +1,13 @@ -mod aur_install; -mod clean; -mod install; -mod search; -mod uninstall; -mod upgrade; - pub use aur_install::*; pub use clean::*; pub use install::*; pub use search::{aur_search, repo_search as search}; pub use uninstall::*; pub use upgrade::*; + +mod aur_install; +mod clean; +mod install; +mod search; +mod uninstall; +mod upgrade; From e9617cb714e38ec7731f31e62d502660c3c56ba2 Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 4 Jul 2022 15:55:09 +0000 Subject: [PATCH 08/19] Bumped crate versions, Cargo.lock & flake.lock --- Cargo.lock | 205 ++++++++++++++++++++++++++++++++++------------------- Cargo.toml | 14 ++-- flake.lock | 24 +++---- 3 files changed, 152 insertions(+), 91 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0e8ab9d..7f8776b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -76,16 +76,16 @@ checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" [[package]] name = "clap" -version = "3.1.14" +version = "3.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "535434c063ced786eb04aaf529308092c5ab60889e8fe24275d15de07b01fa97" +checksum = "190814073e85d238f31ff738fcb0bf6910cedeb73376c87cd69291028966fd83" dependencies = [ "atty", "bitflags", "clap_derive", "clap_lex", "indexmap", - "lazy_static", + "once_cell", "strsim", "termcolor", "terminal_size", @@ -94,9 +94,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.1.7" +version = "3.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3aab4734e083b809aaf5794e14e756d1c798d2c69c7f7de7a09a2f5214993c1" +checksum = "759bf187376e1afa7b85b959e6a664a3e7a95203415dba952ad19139e798f902" dependencies = [ "heck", "proc-macro-error", @@ -107,9 +107,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.2.0" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a37c35f1112dad5e6e0b1adaff798507497a18fceeb30cceb3bae7d1427b9213" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" dependencies = [ "os_str_bytes", ] @@ -178,9 +178,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ "cfg-if", "libc", @@ -196,13 +196,19 @@ 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", + "hashbrown 0.11.2", ] [[package]] @@ -233,12 +239,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.8.1" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.1", ] [[package]] @@ -252,9 +258,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" [[package]] name = "lazy_static" @@ -264,15 +270,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.123" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb691a747a7ab48abc15c5b42066eaafde10dc427e3b6ee2a1cf43db04c763bd" +checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" [[package]] name = "libmimalloc-sys" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7705fc40f6ed493f73584abbb324e74f96b358ff60dfe5659a0f8fc12c590a69" +checksum = "11ca136052550448f55df7898c6dbe651c6b574fe38a0d9ea687a9f8088a2e2c" dependencies = [ "cc", ] @@ -289,9 +295,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.16" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ "cfg-if", ] @@ -304,15 +310,15 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "memchr" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "mimalloc" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0dfa131390c2f6bdb3242f65ff271fcdaca5ff7b6c08f28398be7f2280e3926" +checksum = "2f64ad83c969af2e732e907564deb0d0ed393cec4af80776f77dd77a1a427698" dependencies = [ "libmimalloc-sys", ] @@ -337,24 +343,36 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.10.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" +checksum = "ac8b1a9b2518dc799a2271eff1688707eb315f0d4697aa6b0871369ca4c4da55" [[package]] name = "openssl" -version = "0.10.38" +version = "0.10.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95" +checksum = "fb81a6430ac911acb25fe5ac8f1d2af1b4ea8a4fdfda0f1ee4292af2e2d8eb0e" dependencies = [ "bitflags", "cfg-if", "foreign-types", "libc", "once_cell", + "openssl-macros", "openssl-sys", ] +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "openssl-probe" version = "0.1.5" @@ -363,9 +381,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.72" +version = "0.9.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e46109c383602735fa0a2e48dd2b7c892b048e1bf69e5c3b1d804b7d9c203cb" +checksum = "835363342df5fba8354c5b453325b110ffd54044e588c539cf2f20a8014e4cb1" dependencies = [ "autocfg", "cc", @@ -376,9 +394,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.0.0" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" +checksum = "21326818e99cfe6ce1e524c2a805c189a99b5ae555a35d19f9a284b427d86afa" [[package]] name = "percent-encoding" @@ -418,18 +436,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1" +checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "quote" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" dependencies = [ "proc-macro2", ] @@ -445,18 +463,18 @@ dependencies = [ [[package]] name = "regex" -version = "1.5.5" +version = "1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" +checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" dependencies = [ "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.6.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" [[package]] name = "remove_dir_all" @@ -484,18 +502,18 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" [[package]] name = "schannel" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" dependencies = [ "lazy_static", - "winapi", + "windows-sys", ] [[package]] @@ -523,18 +541,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.136" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +checksum = "1578c6245786b9d168c5447eeacfb96856573ca56c9d68fdcf394be134882a47" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.136" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" +checksum = "023e9b1467aef8a10fb88f25611870ada9800ef7e22afce356bb0d2387b6f27c" dependencies = [ "proc-macro2", "quote", @@ -543,9 +561,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.79" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" +checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" dependencies = [ "itoa", "ryu", @@ -554,9 +572,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" +checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" [[package]] name = "strsim" @@ -566,13 +584,13 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.91" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b683b2b825c8eef438b77c36a06dc262294da3d5a5813fac20da149241dcd44d" +checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] @@ -619,9 +637,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] @@ -634,25 +652,25 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "unicode-bidi" -version = "0.3.7" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-ident" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" [[package]] name = "unicode-normalization" -version = "0.1.19" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - [[package]] name = "ureq" version = "2.4.0" @@ -695,9 +713,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "winapi" @@ -729,3 +747,46 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" diff --git a/Cargo.toml b/Cargo.toml index 7a31cd3..4b33430 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,11 +51,11 @@ lto = "fat" codegen-units = 1 [dependencies] -mimalloc = { version = "0.1.27", default-features = false } -clap = { version = "3.1.9", features = [ "derive", "wrap_help"] } -regex = { version = "1.5.4", default-features = false, features = ["std", "unicode-perl"] } +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 } -ureq = { version = "2.4.0", default-features = false, features = ["native-tls", "json"] } -serde = { version = "1.0.90", default-features = false, features = ["derive", "serde_derive"] } -native-tls = "0.2.8" -libc = "0.2.123" +ureq = { version = "2.4.0", default-features = false, features = [ "native-tls", "json" ] } +serde = { version = "1.0.138", default-features = false, features = [ "derive", "serde_derive" ] } +native-tls = { version = "0.2.10", default-features = false } +libc = { version = "0.2.126", default-features = false } diff --git a/flake.lock b/flake.lock index 1dde562..3701dc5 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1651574473, - "narHash": "sha256-wQhFORvRjo8LB2hTmETmv6cbyKGDPbfWqvZ/0chnDE4=", + "lastModified": 1655042882, + "narHash": "sha256-9BX8Fuez5YJlN7cdPO63InoyBy7dm3VlJkkmTt6fS1A=", "owner": "nix-community", "repo": "naersk", - "rev": "f21309b38e1da0d61b881b6b6d41b81c1aed4e1d", + "rev": "cddffb5aa211f50c4b8750adbec0bbbdfb26bb9f", "type": "github" }, "original": { @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1652483617, - "narHash": "sha256-Jxyn3uXFr5LdZNNiippI/obtLXAVBM18uVfiKVP4j9Q=", + "lastModified": 1656755932, + "narHash": "sha256-TGThfOxr+HjFK464+UoUE6rClp2cwxjiKvHcBVdIGSQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ed014c27f4d0ca772fb57d3b8985b772b0503bbd", + "rev": "660ac43ff9ab1f12e28bfb31d4719795777fe152", "type": "github" }, "original": { @@ -34,11 +34,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1652577883, - "narHash": "sha256-2p27P/7EpVStQ1UszTKHi3AiabZqI0fcgvwVFDzfxNI=", + "lastModified": 1656945861, + "narHash": "sha256-L41+pANwxKvhqqGRCKXzugOb81ewFJG95esLobRI1KY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1d370bd07399fb52cea6badfbffbc90ac9b0f8f0", + "rev": "4d26010c93091d4cb7fca36b8d3ecb33c89a6f23", "type": "github" }, "original": { @@ -56,11 +56,11 @@ }, "utils": { "locked": { - "lastModified": 1652557277, - "narHash": "sha256-jSes9DaIVMdmwBB78KkFUVrlDzawmD62vrUg0GS2500=", + "lastModified": 1656928814, + "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", "owner": "numtide", "repo": "flake-utils", - "rev": "12806d31a381e7cd169a6bac35590e7b36dc5fe5", + "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", "type": "github" }, "original": { From a4e91e5a8db1a50892ee734ea6605534d32131f3 Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 4 Jul 2022 17:15:07 +0000 Subject: [PATCH 09/19] Fixed PKGBUILD arch --- PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PKGBUILD b/PKGBUILD index 1dc3a7e..60a7e0a 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -6,7 +6,7 @@ pkgname=amethyst pkgver=3.3.0 pkgrel=1 pkgdesc="A fast and efficient AUR helper" -arch=('$CARCH') +arch=('x86_64') url="https://github.com/crystal-linux/amethyst" license=('GPL3') source=("git+$url") From b2c2c6e60ada10b90779c0634839bc7de33e1746 Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 4 Jul 2022 17:17:05 +0000 Subject: [PATCH 10/19] Fixed package() in PKGBUILD --- PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PKGBUILD b/PKGBUILD index 60a7e0a..0d2c390 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -33,5 +33,5 @@ package() { -maxdepth 1 \ -executable \ -type f \ - -exec install -Dm0755 {} "${pkgdir}/usr/bin/" {} + + -exec install -Dm0755 -t "${pkgdir}/usr/bin/" {} + } From 0c7a6c42339726f1c9c89370bce2e8440153f1cb Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 4 Jul 2022 18:38:02 +0100 Subject: [PATCH 11/19] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index ecea4f2..692032e 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,10 @@ Tested on latest Cargo (1.60.0-nightly) - `cargo build (--release) --all --features=pkg-warner` +### TODO: + +- Implement some sort of spinner for longer operations +