You are not logged in.
I tried writing a hook for removing orphans after running pacman. The thing is it isn't successful. I run into issues with the database being locked. Plus, I believe if it does successfully run it would run a second time, as removing the orphans would trigger it again. Does anyone know the correct way of checking and removing orphans, after running pacman?
[Trigger]
Operation = Install
Operation = Upgrade
Operation = Remove
Type = Package
Target = *
[Action]
Depends = base
When = PostTransaction
Exec = /usr/bin/pacman -Rns "$(/usr/bin/pacman -Qtdq)"
Offline
Maybe use 'pacman -Rs' or 'pacman -Rss'?
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
What if you use the hook to call a script which waits for a few seconds first. Then it could could call pacman after the database has closed out. You could also have this script create / then delete a flag file to determine if it's the first time it was run since being called by the pacman hook. That would prevent an infinite loop.
If quantum mechanics hasn't profoundly shocked you, you haven't understood it yet.
Niels Bohr
Offline
Maybe use 'pacman -Rs' or 'pacman -Rss'?
What if you use the hook to call a script which waits for a few seconds first. Then it could could call pacman after the database has closed out. You could also have this script create / then delete a flag file to determine if it's the first time it was run since being called by the pacman hook. That would prevent an infinite loop.
Thanks for both of the suggestions. I'll give them both a try.
Offline
Does anyone know the correct way of checking and removing orphans, after running pacman?
A pacman wrapper script, not a hook.
Offline