Created
October 23, 2023 04:35
-
-
Save cicku/3a0df5c458dddf584858a3f2c8cafd8e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
. /etc/makepkg.conf | |
PKGCACHE=$((grep -m 1 '^CacheDir' /etc/pacman.conf || echo 'CacheDir = /var/cache/pacman/pkg') | sed 's/CacheDir = //') | |
pkgdirs=("$@" "$PKGDEST" "$PKGCACHE") | |
while read -r -a parampart; do | |
pkgname="${parampart[0]}-${parampart[1]}-*.pkg.tar.{xz,zst}" | |
for pkgdir in ${pkgdirs[@]}; do | |
pkgpath="$pkgdir"/$pkgname | |
[ -f $pkgpath ] && { echo $pkgpath; break; }; | |
done || echo ${parampart[0]} 1>&2 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment