Compare commits
2 Commits
14fbf3c41e
...
1.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 73f7e37670 | |||
| af686fe6c0 |
28
PKGBUILD
28
PKGBUILD
@@ -1,28 +0,0 @@
|
|||||||
# Maintainer: Bryan Joshua Pedini <bryan [at] pedini [dot] dev>
|
|
||||||
|
|
||||||
_pkgname="pman"
|
|
||||||
pkgname="$_pkgname-helper"
|
|
||||||
pkgver="1.2.0"
|
|
||||||
pkgrel="1"
|
|
||||||
pkgdesc="A `pacman` helper script, because you forget all the stupid flags"
|
|
||||||
url="https://git.bjphoster.com/source/$_pkgname"
|
|
||||||
arch=("any")
|
|
||||||
license=("MIT")
|
|
||||||
depends=("bash" "pacman")
|
|
||||||
conflicts=("pman") # Another package called `pman` currently exists in the AUR
|
|
||||||
source=(
|
|
||||||
"LICENSE"
|
|
||||||
"pman.sh"
|
|
||||||
)
|
|
||||||
sha256sums=(
|
|
||||||
"3964e8cf1894ecfea6ca57cf350e7a538229cd205ac35293ea8bf3fb19c0b86f"
|
|
||||||
"6bb6aab1dd31ae0a326a24afc34e62da13d482843fad5872562135007b43f1a5"
|
|
||||||
)
|
|
||||||
md5sums=(
|
|
||||||
"72db3ecfa718db796cd818f883cbdc68"
|
|
||||||
"369ea3fa3fb44dcfe035a297f64af9e5"
|
|
||||||
)
|
|
||||||
package() {
|
|
||||||
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
|
|
||||||
install -Dm755 pman.sh "${pkgdir}/usr/bin/${_pkgname}"
|
|
||||||
}
|
|
||||||
@@ -16,6 +16,7 @@ A `pacman` helper script, because you forget all the stupid flags
|
|||||||
- remove
|
- remove
|
||||||
- purge
|
- purge
|
||||||
- clean
|
- clean
|
||||||
|
- reflector
|
||||||
- config
|
- config
|
||||||
|
|
||||||
`config` is the only flag that is not appended to `pacman` (or `yay`), 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`.
|
||||||
|
|||||||
18
pman.sh
18
pman.sh
@@ -36,6 +36,15 @@ elif [ "$command_args" = "config" ]; then
|
|||||||
command="nano"
|
command="nano"
|
||||||
command_args="/etc/pacman.conf"
|
command_args="/etc/pacman.conf"
|
||||||
su_needed=true
|
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
|
fi
|
||||||
|
|
||||||
# If command is empty, command is pacman
|
# If command is empty, command is pacman
|
||||||
@@ -87,6 +96,13 @@ case "$command_args" in
|
|||||||
if [ "$command" = "pacman" ]; then
|
if [ "$command" = "pacman" ]; then
|
||||||
su_needed=true
|
su_needed=true
|
||||||
fi
|
fi
|
||||||
|
execute_command "${@}"
|
||||||
|
|
||||||
|
su_needed=false
|
||||||
|
command_args="-Qu"
|
||||||
|
echo
|
||||||
|
echo "$(execute_command "${@}" | wc -l) packages are available for update"
|
||||||
|
exit 0
|
||||||
;;
|
;;
|
||||||
"upgradable")
|
"upgradable")
|
||||||
command_args="-Qu"
|
command_args="-Qu"
|
||||||
@@ -137,6 +153,8 @@ case "$command_args" in
|
|||||||
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 " clean - pacman -Scc | remove all package files & trash"
|
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"
|
echo " config - /etc/pacman.conf | edits pacman configuration"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user