fix: simplify pacman orphan cleanup command construction
This commit is contained in:
+8
-2
@@ -274,8 +274,14 @@ runCmd() { # $1=host $2=name $3=cmd
|
||||
ERROR=1
|
||||
fi
|
||||
echo "pacman orphan cleanup" | tee -a "${LOGFILENAME}"
|
||||
if ! runSSH "${HOST}" sh -c 'yesarg="$1"; orphans=$(pacman -Qqtd 2>/dev/null || true); if [ -n "$orphans" ]; then pacman -Rns $yesarg $orphans; fi' sh "${YESARG}" | tee -a "${LOGFILENAME}"; then
|
||||
ERROR=1
|
||||
if [ -n "${YESARG}" ]; then
|
||||
if ! runSSH "${HOST}" sh -c 'orphans=$(pacman -Qqtd 2>/dev/null || true); if [ -n "$orphans" ]; then pacman -Rns --noconfirm $orphans; fi' | tee -a "${LOGFILENAME}"; then
|
||||
ERROR=1
|
||||
fi
|
||||
else
|
||||
if ! runSSH "${HOST}" sh -c 'orphans=$(pacman -Qqtd 2>/dev/null || true); if [ -n "$orphans" ]; then pacman -Rns $orphans; fi' | tee -a "${LOGFILENAME}"; then
|
||||
ERROR=1
|
||||
fi
|
||||
fi
|
||||
echo "pacman -Sc ${YESARG}" | tee -a "${LOGFILENAME}"
|
||||
if ! runSSH "${HOST}" pacman -Sc ${YESARG} | tee -a "${LOGFILENAME}"; then
|
||||
|
||||
Reference in New Issue
Block a user