Compare commits
No commits in common. "cdc17a329b2e6b557e858ff393f9b264e673ffb5" and "0df0a8dd6ebbfad3147341880ac0c06a1c63aff3" have entirely different histories.
cdc17a329b
...
0df0a8dd6e
30
pman.sh
30
pman.sh
@ -29,15 +29,6 @@ fi
|
|||||||
# Evaluate the command arguments
|
# Evaluate the command arguments
|
||||||
if [ "$command_args" = "search" ]; then
|
if [ "$command_args" = "search" ]; then
|
||||||
command_args="-Ss"
|
command_args="-Ss"
|
||||||
elif [ "$command_args" = "provides" ]; then
|
|
||||||
command_args="-F"
|
|
||||||
elif [ "$command_args" = "installed" ]; then
|
|
||||||
command_args="-Q"
|
|
||||||
elif [ "$command_args" = "install" ]; then
|
|
||||||
command_args="-S"
|
|
||||||
if [ "$command" = "pacman" ]; then
|
|
||||||
su_needed=true
|
|
||||||
fi
|
|
||||||
elif [ "$command_args" = "update" ]; then
|
elif [ "$command_args" = "update" ]; then
|
||||||
command_args="-Sy"
|
command_args="-Sy"
|
||||||
if [ "$command" = "pacman" ]; then
|
if [ "$command" = "pacman" ]; then
|
||||||
@ -50,6 +41,11 @@ elif [ "$command_args" = "upgrade" ]; then
|
|||||||
if [ "$command" = "pacman" ]; then
|
if [ "$command" = "pacman" ]; then
|
||||||
su_needed=true
|
su_needed=true
|
||||||
fi
|
fi
|
||||||
|
elif [ "$command_args" = "install" ]; then
|
||||||
|
command_args="-S"
|
||||||
|
if [ "$command" = "pacman" ]; then
|
||||||
|
su_needed=true
|
||||||
|
fi
|
||||||
elif [ "$command_args" = "remove" ]; then
|
elif [ "$command_args" = "remove" ]; then
|
||||||
command_args="-Rs"
|
command_args="-Rs"
|
||||||
if [ "$command" = "pacman" ]; then
|
if [ "$command" = "pacman" ]; then
|
||||||
@ -60,6 +56,8 @@ elif [ "$command_args" = "purge" ]; then
|
|||||||
if [ "$command" = "pacman" ]; then
|
if [ "$command" = "pacman" ]; then
|
||||||
su_needed=true
|
su_needed=true
|
||||||
fi
|
fi
|
||||||
|
elif [ "$command_args" = "provides" ]; then
|
||||||
|
command_args="-F"
|
||||||
elif [ "$more_arguments" = "true" ]; then
|
elif [ "$more_arguments" = "true" ]; then
|
||||||
echo "Invalid command: \"$command $command_args\""
|
echo "Invalid command: \"$command $command_args\""
|
||||||
echo
|
echo
|
||||||
@ -69,26 +67,20 @@ elif [ "$more_arguments" = "true" ]; then
|
|||||||
echo " (aur packages - all the normal operations except config are available)"
|
echo " (aur packages - all the normal operations except config are available)"
|
||||||
echo " aur (yay) - yay | same as \"yay\""
|
echo " aur (yay) - yay | same as \"yay\""
|
||||||
echo " search - pacman -Ss | search packages"
|
echo " search - pacman -Ss | search packages"
|
||||||
echo " provides - pacman -F | list packages that provide file"
|
|
||||||
echo " installed - pacman -Q | list installed packages"
|
|
||||||
echo " install - pacman -S | install packages"
|
echo " install - pacman -S | install packages"
|
||||||
echo " update - pacman -Sy | updates the repositories"
|
echo " update - pacman -Sy | updates the repositories"
|
||||||
echo " upgradable - pacman -Qu | list available upgrades"
|
echo " upgradable - pacman -Qu | list available upgrades"
|
||||||
echo " upgrade - pacman -Syu | upgrades your system"
|
echo " upgrade - pacman -Syu | upgrades your system"
|
||||||
|
echo " provides - pacman -F | list packages that provide file"
|
||||||
echo " remove - pacman -Rs | remove packages & dependencies"
|
echo " remove - pacman -Rs | remove packages & dependencies"
|
||||||
echo " purge - pacman -Rns | remove packages, dependencies & conf"
|
echo " purge - pacman -Rns | remove packages, dependencies & conf"
|
||||||
echo " config - /etc/pacman.conf | edits pacman configuration"
|
echo " config - /etc/pacman.conf | edits pacman configuration"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If sudo is needed and necessary (and installed), prepend it, if not installed throw error
|
# If sudo is needed and necessary (and installed), prepend it
|
||||||
if [ "$su_needed" = "true" ] && [ "$UID" != 0 ]; then
|
if [ "$su_needed" = "true" ] && [ "$UID" != 0 ] && command -v "sudo" &>/dev/null; then
|
||||||
if command -v "sudo" &>/dev/null; then
|
sudo $command $command_args "${@}"
|
||||||
sudo $command $command_args "${@}"
|
|
||||||
else
|
|
||||||
echo "sudo command needed but not found" > /dev/stderr
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
$command $command_args "${@}"
|
$command $command_args "${@}"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user