Compare commits
7 Commits
e2789d200b
...
1.1.2
Author | SHA1 | Date | |
---|---|---|---|
af686fe6c0 | |||
ba07f6275d | |||
8e2bdd88d3 | |||
8b23dc96a3 | |||
7b3de6cef0 | |||
2c209fd7a0 | |||
b1306a73b4 |
16
README.md
16
README.md
@@ -1,15 +1,23 @@
|
|||||||
# pman.sh
|
# pman.sh
|
||||||
A `pacman` helper script, because you forget the stupid flags
|
A `pacman` helper script, because you forget all the stupid flags
|
||||||
|
|
||||||
## Usage / Features:
|
## Usage / Features:
|
||||||
|
- aur/yay
|
||||||
- search
|
- search
|
||||||
|
- info
|
||||||
|
- localinfo
|
||||||
|
- provides
|
||||||
|
- providefiles
|
||||||
|
- installed
|
||||||
|
- install
|
||||||
- update
|
- update
|
||||||
- upgradable
|
- upgradable
|
||||||
- upgrade
|
- upgrade
|
||||||
- install
|
- remove
|
||||||
- provides
|
- purge
|
||||||
|
- clean
|
||||||
- config
|
- config
|
||||||
|
|
||||||
`config` is the only flag that is not appended to `pacman`, instead it resolves to `nano /etc/pacman.conf`.
|
`config` is the only flag that is not appended to `pacman` (or `yay`), instead it resolves to `nano /etc/pacman.conf`.
|
||||||
|
|
||||||
`sudo` gets prepended automatically if the command requires it and if installed - no, there is no check if your user is in the `sudo` group, if you download this script you should already be, or know you can only use part of this utility
|
`sudo` gets prepended automatically if the command requires it and if installed - no, there is no check if your user is in the `sudo` group, if you download this script you should already be, or know you can only use part of this utility
|
||||||
|
159
pman.sh
159
pman.sh
@@ -45,64 +45,109 @@ if [ "$command" = "" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Evaluate the command arguments
|
# Evaluate the command arguments
|
||||||
if [ "$command_args" = "search" ]; then
|
case "$command_args" in
|
||||||
command_args="-Ss"
|
"search")
|
||||||
elif [ "$command_args" = "provides" ]; then
|
command_args="-Ss"
|
||||||
# Update the cache
|
;;
|
||||||
su_needed=true
|
"info")
|
||||||
command_args="-Fy"
|
command_args="-Si"
|
||||||
execute_command "${@}"
|
;;
|
||||||
|
"localinfo")
|
||||||
|
command_args="-Qi"
|
||||||
|
;;
|
||||||
|
"provides")
|
||||||
|
# Update the cache
|
||||||
|
su_needed=true
|
||||||
|
command_args="-Fy"
|
||||||
|
execute_command "${@}"
|
||||||
|
|
||||||
su_needed=false
|
su_needed=false
|
||||||
command_args="-F"
|
command_args="-F"
|
||||||
elif [ "$command_args" = "installed" ]; then
|
;;
|
||||||
command_args="-Q"
|
"providefiles")
|
||||||
elif [ "$command_args" = "install" ]; then
|
# Update the cache
|
||||||
command_args="-S"
|
|
||||||
if [ "$command" = "pacman" ]; then
|
|
||||||
su_needed=true
|
su_needed=true
|
||||||
fi
|
command_args="-Fy"
|
||||||
elif [ "$command_args" = "update" ]; then
|
execute_command "${@}"
|
||||||
command_args="-Sy"
|
|
||||||
if [ "$command" = "pacman" ]; then
|
su_needed=false
|
||||||
su_needed=true
|
command_args="-Fl"
|
||||||
fi
|
;;
|
||||||
elif [ "$command_args" = "upgradable" ]; then
|
"installed")
|
||||||
command_args="-Qu"
|
command_args="-Q"
|
||||||
elif [ "$command_args" = "upgrade" ]; then
|
;;
|
||||||
command_args="-Syu"
|
"install")
|
||||||
if [ "$command" = "pacman" ]; then
|
command_args="-S"
|
||||||
su_needed=true
|
if [ "$command" = "pacman" ]; then
|
||||||
fi
|
su_needed=true
|
||||||
elif [ "$command_args" = "remove" ]; then
|
fi
|
||||||
command_args="-Rs"
|
;;
|
||||||
if [ "$command" = "pacman" ]; then
|
"update")
|
||||||
su_needed=true
|
command_args="-Sy"
|
||||||
fi
|
if [ "$command" = "pacman" ]; then
|
||||||
elif [ "$command_args" = "purge" ]; then
|
su_needed=true
|
||||||
command_args="-Rns"
|
fi
|
||||||
if [ "$command" = "pacman" ]; then
|
execute_command "${@}"
|
||||||
su_needed=true
|
|
||||||
fi
|
su_needed=false
|
||||||
elif [ "$more_arguments" = "true" ]; then
|
command_args="-Qu"
|
||||||
echo "Invalid command: \"$command $command_args\""
|
echo
|
||||||
echo
|
echo "$(execute_command "${@}" | wc -l) packages are available for update"
|
||||||
echo "Usage: pman <command> [args...]"
|
exit 0
|
||||||
echo "Available commands:"
|
;;
|
||||||
echo " yay (aur) - yay | invoke yay "
|
"upgradable")
|
||||||
echo " (aur packages - all the normal operations except config are available)"
|
command_args="-Qu"
|
||||||
echo " aur (yay) - yay | same as \"yay\""
|
;;
|
||||||
echo " search - pacman -Ss | search packages"
|
"upgrade")
|
||||||
echo " provides - pacman -F | list packages that provide file"
|
command_args="-Syu"
|
||||||
echo " installed - pacman -Q | list installed packages"
|
if [ "$command" = "pacman" ]; then
|
||||||
echo " install - pacman -S | install packages"
|
su_needed=true
|
||||||
echo " update - pacman -Sy | updates the repositories"
|
fi
|
||||||
echo " upgradable - pacman -Qu | list available upgrades"
|
;;
|
||||||
echo " upgrade - pacman -Syu | upgrades your system"
|
"remove")
|
||||||
echo " remove - pacman -Rs | remove packages & dependencies"
|
command_args="-Rs"
|
||||||
echo " purge - pacman -Rns | remove packages, dependencies & conf"
|
if [ "$command" = "pacman" ]; then
|
||||||
echo " config - /etc/pacman.conf | edits pacman configuration"
|
su_needed=true
|
||||||
exit 1
|
fi
|
||||||
fi
|
;;
|
||||||
|
"purge")
|
||||||
|
command_args="-Rns"
|
||||||
|
if [ "$command" = "pacman" ]; then
|
||||||
|
su_needed=true
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"clean")
|
||||||
|
command_args="-Scc"
|
||||||
|
if [ "$command" = "pacman" ]; then
|
||||||
|
su_needed=true
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if [ "$more_arguments" = "true" ]; then
|
||||||
|
echo "Invalid command: \"$command_args\""
|
||||||
|
echo
|
||||||
|
echo "Usage: pman <command> [args...]"
|
||||||
|
echo "Available commands:"
|
||||||
|
echo " yay (aur) - yay | invoke yay "
|
||||||
|
echo " (aur packages - all the normal operations except config are available)"
|
||||||
|
echo " aur (yay) - yay | same as \"yay\""
|
||||||
|
echo " search - pacman -Ss | search packages"
|
||||||
|
echo " info - pacman -Si | show package information"
|
||||||
|
echo " localinfo - pacman -Qi | show local package information"
|
||||||
|
echo " provides - pacman -F | list packages that provide file"
|
||||||
|
echo " providefiles - pacman -Fl | list files provided by package"
|
||||||
|
echo " installed - pacman -Q | list installed packages"
|
||||||
|
echo " install - pacman -S | install packages"
|
||||||
|
echo " update - pacman -Sy | updates the repositories"
|
||||||
|
echo " upgradable - pacman -Qu | list available upgrades"
|
||||||
|
echo " upgrade - pacman -Syu | upgrades your system"
|
||||||
|
echo " remove - pacman -Rs | remove packages & dependencies"
|
||||||
|
echo " purge - pacman -Rns | remove packages, dependencies & conf"
|
||||||
|
echo " clean - pacman -Scc | remove all package files & trash"
|
||||||
|
echo " config - /etc/pacman.conf | edits pacman configuration"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
execute_command "${@}"
|
execute_command "${@}"
|
||||||
|
Reference in New Issue
Block a user