diff options
| author | Egor Tensin <egor@tensin.name> | 2026-09-28 21:31:29 +0500 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-09-28 21:31:29 +0500 |
| commit | ea6fa67385a37556c29f07bf73e1d892df2dc0ff (patch) | |
| tree | 168aebdd46fbc7ccdbd4aa9d40da987191d65ed8 /%HOME%/.bash_utils | |
| parent | arch.sh: attempt to sync AUR database only in yay_install (diff) | |
| download | linux-home-ea6fa67385a37556c29f07bf73e1d892df2dc0ff.tar.gz linux-home-ea6fa67385a37556c29f07bf73e1d892df2dc0ff.zip | |
arch.sh: refactoring
Diffstat (limited to '%HOME%/.bash_utils')
| -rw-r--r-- | %HOME%/.bash_utils/arch.sh | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/%HOME%/.bash_utils/arch.sh b/%HOME%/.bash_utils/arch.sh index c5d4c9a..2965ea6 100644 --- a/%HOME%/.bash_utils/arch.sh +++ b/%HOME%/.bash_utils/arch.sh @@ -3,21 +3,43 @@ # For details, see https://github.com/egor-tensin/linux-home # Distributed under the MIT License. +pacman_upgrade() ( + _bash_func_prelude + sudo pacman -Syu --noconfirm +) + +pacman_cleanup() ( + _bash_func_prelude + + local output + output="$( pacman -Qqdt )" || true + if [ -n "$output" ]; then + echo "$output" | sudo pacman -Rcsn --noconfirm - + fi +) + +yay_opts='--noconfirm --needed --cleanafter --removemake' + yay_upgrade() ( _bash_func_prelude - yay -Syua --noconfirm --needed --cleanafter + yay -Syua $yay_opts ) yay_install() ( _bash_func_prelude - yay -Sya --noconfirm --needed --cleanafter "$@" + yay -Sya $yay_opts "$@" +) + +yay_cleanup() ( + _bash_func_prelude + yay -Sca --noconfirm ) arch_upgrade() ( _bash_func_prelude echo ====================================================================== - sudo pacman -Syu --noconfirm + pacman_upgrade echo ====================================================================== yay_upgrade echo ====================================================================== @@ -32,12 +54,8 @@ arch_cleanup() ( _bash_func_prelude echo ====================================================================== - local output - output="$( pacman -Qqdt )" || true - if [ -n "$output" ]; then - echo "$output" | sudo pacman -Rcsn --noconfirm - - fi + pacman_cleanup echo ====================================================================== - yay -Sca --noconfirm + yay_cleanup echo ====================================================================== ) |
