Improve safety and CLI fidelity for everyday use
Drop default --noconfirm (opt-in via --noconfirm), fix --noremovemake, forward pacman argv intact for -R/-D/-F/-T/-U, deepen PKGBUILD review, show an install plan before building, and add shellcheck CI plus unit tests. Co-authored-by: Frank Vitrano <WHC2006@users.noreply.github.com>
This commit is contained in:
co-authored by
Frank Vitrano
parent
d0f2cfe335
commit
bba71040d6
+6
-8
@@ -60,8 +60,8 @@ cmd_query_aur_upgrades() {
|
||||
# Upgrade all outdated AUR packages
|
||||
cmd_upgrade_aur() {
|
||||
local -a pkgs=()
|
||||
local name old arrow new
|
||||
while read -r name old arrow new; do
|
||||
local name old _arrow new
|
||||
while read -r name old _arrow new; do
|
||||
[[ -z $name ]] && continue
|
||||
pkgs+=("$name")
|
||||
msg2 "$name ${old} -> ${new}"
|
||||
@@ -79,16 +79,14 @@ cmd_upgrade_aur() {
|
||||
cmd_upgrade_all() {
|
||||
local refresh=${1:-0}
|
||||
sudoloop_start
|
||||
local -a pac_args=()
|
||||
[[ $refresh -eq 1 ]] && pac_args+=(-y)
|
||||
pac_args+=(-Su)
|
||||
local -a conf=()
|
||||
mapfile -t conf < <(pac_noconfirm_args)
|
||||
|
||||
msg "Synchronizing databases and upgrading repository packages..."
|
||||
# Use -Syu style via pacman
|
||||
if [[ $refresh -eq 1 ]]; then
|
||||
as_root ${MIAUR_PACMAN} -Syu --noconfirm || die "repository upgrade failed"
|
||||
as_root ${MIAUR_PACMAN} -Syu "${conf[@]}" || die "repository upgrade failed"
|
||||
else
|
||||
as_root ${MIAUR_PACMAN} -Su --noconfirm || die "repository upgrade failed"
|
||||
as_root ${MIAUR_PACMAN} -Su "${conf[@]}" || die "repository upgrade failed"
|
||||
fi
|
||||
|
||||
msg "Checking for AUR updates..."
|
||||
|
||||
Reference in New Issue
Block a user