Only match if package- matches db_dir

There are some packages which have very short names, like `go`. Without this, every `go*` package will match, now only packages with `go-*` will match. It's needed because the output of the pacman db dir contains `$pkgname-$pkgver`
This commit is contained in:
Eduard Tolosa 2024-05-27 16:49:28 -05:00
parent b14d674355
commit 8914f16cc5

View file

@ -39,7 +39,7 @@ using_pacman_db() {
# Find the common elements between the two arrays
for dir in "${modified_db_dirs[@]}"; do
for pkg in "${installed_packages[@]}"; do
if [[ "$dir" == $pkg* ]]; then
if [[ "$dir" == $pkg-* ]]; then
matching_packages+=("$pkg")
fi
done