Skip to content

Commit

Permalink
'yay -Cd' does not seem to work anymore - use default orphan check in…
Browse files Browse the repository at this point in the history
…stead
  • Loading branch information
excalibur1234 committed Jul 15, 2018
1 parent e0b668b commit 33c2670
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 26 deletions.
2 changes: 1 addition & 1 deletion PKGBUILD_AUR-git
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

_pkgname=pacui
pkgname=$_pkgname-git
pkgver=r895.dfdedbc
pkgver=r898.e0b668b
pkgrel=1
pkgdesc="Bash script providing advanced Pacman and Yay/Pikaur/Aurman/Pakku/Trizen/Pacaur functionality in a simple UI"
arch=(any)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ wget https://raw.githubusercontent.com/excalibur1234/pacui/master/pacui
bash pacui/pacui
```
I find this feature of PacUI invaluable for fixing systems. Here are two examples:
- A large number of updates broke (parts of) the GUI, e.g. xorg, window manager, or desktop environment. In this case, switching to a tty (with CTRL + ALT + F2), installing PacUI and using "Roll Back System" to roll back all the latest updates can fix the system (temporarily).
- A large number of updates broke (parts of) the GUI, e.g. xorg, window manager, or desktop environment. In this case, switching to a different tty (with CTRL + ALT + F2), installing PacUI and using "Roll Back System" to roll back all the latest updates can fix the system (temporarily).
- A broken keyring makes it impossible to apply updates or install any packages. Executing PacUI without prior installation and using "Fix Pacman Errors" (which does not require "expac" or "fzf") to fix the keyring and all related problems is the easiest and fastest solution I know of.


Expand Down
38 changes: 14 additions & 24 deletions pacui
Original file line number Diff line number Diff line change
Expand Up @@ -288,31 +288,21 @@ function func_m


echo " searching orphans ..."
if [[ "$AUR_Helper" == "yay" ]]
if [[ -n "$(pacman -Qdt)" ]] # only run the following commands, if output of "pacman -Qdt" is not empty.
then
yay -Cd

else # this is the case when pikaur, aurman, pakku, tirzen, pacaur, or no AUR helper is installed.

if [[ -n "$(pacman -Qdt)" ]] # only run these commands, if output of "pacman -Qdt" is not empty. this happens if there are no orphans.
then

pacman -Qdt --color always
# ask, whether to remove the displayed orphaned packages:
echo -e " \e[41m Do you want to remove these orphaned packages? [Y|n] \e[0m"
read -rs -n1 answer # save user input in "answer" variable (only accept 1 character as input)

case ${answer:-y} in # if ENTER is pressed, the variable "answer" is empty. if "answer" is empty, its default value is "y".
y|Y|yes|YES|Yes ) # do this, if "answer" is y or Y or yes or YES or Yes
sudo pacman -Rsn $(pacman -Qqdt) --color always --noconfirm # ATTENTION: (i do not know why but) using quotes (" symbols) around $(...) breaks pacman command for multiple packages
;;
* ) # do this in all other cases
echo -e " \e[1m Packages have not been removed.\e[0m"
;;
esac # end of "case" loop

fi

pacman -Qdt --color always # display orhphaned packages
# ask, whether to remove the displayed orphaned packages:
echo -e " \e[41m Do you want to remove these orphaned packages? [Y|n] \e[0m"
read -rs -n1 answer # save user input in "answer" variable (only accept 1 character as input)

case ${answer:-y} in # if ENTER is pressed, the variable "answer" is empty. if "answer" is empty, its default value is "y".
y|Y|yes|YES|Yes ) # do this, if "answer" is y or Y or yes or YES or Yes
sudo pacman -Rsn $(pacman -Qqdt) --color always --noconfirm # ATTENTION: (i do not know why but) using quotes (" symbols) around $(...) breaks pacman command for multiple packages
;;
* ) # do this in all other cases
echo -e " \e[1m Packages have not been removed.\e[0m"
;;
esac # end of "case" loop
fi
echo ""

Expand Down

2 comments on commit 33c2670

@Morganamilo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay -Cd was changed to yay -Yc over 6 months ago.

Yay specific options:
    -c --clean            Remove unneeded dependencies

@excalibur1234
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the tip.
i have readded it: 5f3e9a5

Please sign in to comment.