Compare commits
5 Commits
7b3de6cef0
...
1.2.0
Author | SHA1 | Date | |
---|---|---|---|
73f7e37670 | |||
af686fe6c0 | |||
ba07f6275d | |||
8e2bdd88d3 | |||
8b23dc96a3 |
17
README.md
17
README.md
@@ -1,15 +1,24 @@
|
||||
# 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:
|
||||
- aur/yay
|
||||
- search
|
||||
- info
|
||||
- localinfo
|
||||
- provides
|
||||
- providefiles
|
||||
- installed
|
||||
- install
|
||||
- update
|
||||
- upgradable
|
||||
- upgrade
|
||||
- install
|
||||
- provides
|
||||
- remove
|
||||
- purge
|
||||
- clean
|
||||
- reflector
|
||||
- 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
|
||||
|
30
pman.sh
30
pman.sh
@@ -36,6 +36,15 @@ elif [ "$command_args" = "config" ]; then
|
||||
command="nano"
|
||||
command_args="/etc/pacman.conf"
|
||||
su_needed=true
|
||||
elif [ "$command_args" = "reflector" ]; then
|
||||
command="reflector"
|
||||
command_args=$(cat /etc/pacman.d/mirrorlist 2>/dev/null | grep -e "With.*reflector" | sed 's/#.*reflector //')
|
||||
# Check if reflector was actually used to generate the mirrorlist
|
||||
if [ "$command_args" = "" ]; then
|
||||
echo "Error: reflector was not used to generate mirrorlist or mirrorlist location differ from standard"
|
||||
exit 1
|
||||
fi
|
||||
su_needed=true
|
||||
fi
|
||||
|
||||
# If command is empty, command is pacman
|
||||
@@ -64,6 +73,15 @@ case "$command_args" in
|
||||
su_needed=false
|
||||
command_args="-F"
|
||||
;;
|
||||
"providefiles")
|
||||
# Update the cache
|
||||
su_needed=true
|
||||
command_args="-Fy"
|
||||
execute_command "${@}"
|
||||
|
||||
su_needed=false
|
||||
command_args="-Fl"
|
||||
;;
|
||||
"installed")
|
||||
command_args="-Q"
|
||||
;;
|
||||
@@ -78,6 +96,13 @@ case "$command_args" in
|
||||
if [ "$command" = "pacman" ]; then
|
||||
su_needed=true
|
||||
fi
|
||||
execute_command "${@}"
|
||||
|
||||
su_needed=false
|
||||
command_args="-Qu"
|
||||
echo
|
||||
echo "$(execute_command "${@}" | wc -l) packages are available for update"
|
||||
exit 0
|
||||
;;
|
||||
"upgradable")
|
||||
command_args="-Qu"
|
||||
@@ -108,7 +133,7 @@ case "$command_args" in
|
||||
;;
|
||||
*)
|
||||
if [ "$more_arguments" = "true" ]; then
|
||||
echo "Invalid command: \"$command $command_args\""
|
||||
echo "Invalid command: \"$command_args\""
|
||||
echo
|
||||
echo "Usage: pman <command> [args...]"
|
||||
echo "Available commands:"
|
||||
@@ -119,6 +144,7 @@ case "$command_args" in
|
||||
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"
|
||||
@@ -127,6 +153,8 @@ case "$command_args" in
|
||||
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 " reflector - mirrorlist | refresh the mirrorlist with reflector (if used)"
|
||||
echo " (do not use if file location differ from default /etc/pacman.d/mirrorlist)"
|
||||
echo " config - /etc/pacman.conf | edits pacman configuration"
|
||||
exit 1
|
||||
fi
|
||||
|
Reference in New Issue
Block a user