sh: Switch yay to paru

Removed outdated `syu` symlink which just hooks into topgrade.
Replaced it with simple function that tries for topgrade, paru, yay,
pacman, in that order. Can still be invoked with simple `syu` command,
but *only* through interactive terminal use.

Switched git pre-commit hook to default to paru instead of yay when
compiling installed package lists for dotfile commits.
This commit is contained in:
Marty Oehme 2020-12-22 19:51:01 +01:00
parent d2e44d330d
commit 8cb3252cf1
Signed by: Marty
GPG key ID: B7538B8F50A1C800
4 changed files with 38 additions and 5 deletions

View file

@ -6,7 +6,7 @@ COMMIT_SOURCE="$2"
BOOTSTRAPDIR="bootstrap"
pkgfileloc="$(git rev-parse --show-toplevel)/$BOOTSTRAPDIR/packages.txt"
pkgignoreloc="$(git rev-parse --show-toplevel)/$BOOTSTRAPDIR/packages_ignore.txt"
listgen="yay"
listgen="paru"
err() {
printf "\x1b[33mCAUTION:\x1b[0m %s\n" "$*"
@ -18,7 +18,7 @@ if [ ! -f "$pkgfileloc" ]; then
fi
if ! type "$listgen" >/dev/null 2>&1; then
err "Yay not installed on machine, can not reliably determine package differences!"
err "List generator not installed on machine, can not reliably determine package differences!"
fi
# get commited packages, remove empty lines
@ -30,7 +30,7 @@ sed -e '/^[#$]/d' <"$pkgfileloc" | sort >"$pkgcommited"
# q removes extraneous info
# e only lists explicitly installed
# tt removes those that are depended on, but NOT those optionally depended on
pkgcurrent=$(yay -Qqett | sort)
pkgcurrent=$("$listgen" -Qqett | sort)
# remove those listed in package_ignore.txt
if [ -f "$pkgignoreloc" ]; then
pkgcurrent=$(echo "$pkgcurrent" | comm -23 - "$pkgignoreloc")