Vendor the command set the menu and shell depend on
This commit is contained in:
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
# blob:summary=Remove all the named packages from the system if they're installed (otherwise ignore).
|
||||
# blob:args=<packages...>
|
||||
# blob:requires-sudo=true
|
||||
|
||||
installed=()
|
||||
declare -A installed_exact=()
|
||||
declare -A selected=()
|
||||
|
||||
while IFS= read -r package_name; do
|
||||
installed_exact[$package_name]=1
|
||||
done < <(pacman -Qq)
|
||||
|
||||
for pkg in "$@"; do
|
||||
if [[ -n ${installed_exact[$pkg]} && -z ${selected[$pkg]} ]]; then
|
||||
installed+=("$pkg")
|
||||
selected[$pkg]=1
|
||||
fi
|
||||
done
|
||||
|
||||
if (( ${#installed[@]} > 0 )); then
|
||||
sudo pacman -Rns --noconfirm "${installed[@]}"
|
||||
fi
|
||||
Reference in New Issue
Block a user