Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/lib/util/pacman.sh
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2024-03-08 09:03:18 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2024-03-08 09:03:18 +0100
commit8f46b191dd9ef417976fe07229aa36f0f37a1f15 (patch)
treee981a6b2a88a56a9c2503d65416a38a843348bc6 /src/lib/util/pacman.sh
parent8c41277a2e62c7ed2b07ac5d09af57b31c9cd890 (diff)
parent509dd24bdcd6c45bd86937fcd1de6fd1fa510441 (diff)
merged with upstream changes
Diffstat (limited to 'src/lib/util/pacman.sh')
-rw-r--r--src/lib/util/pacman.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/util/pacman.sh b/src/lib/util/pacman.sh
index f6c2d5f..620e1a8 100644
--- a/src/lib/util/pacman.sh
+++ b/src/lib/util/pacman.sh
@@ -38,13 +38,21 @@ get_pacman_repo_from_pkgbuild() {
return
fi
+ # update the pacman repo cache if it doesn't exist yet
+ if [[ ! -d "${_DEVTOOLS_PACMAN_CACHE_DIR}" ]]; then
+ update_pacman_repo_cache
+ fi
+
slock 10 "${_DEVTOOLS_PACMAN_CACHE_DIR}.lock" "Locking pacman database cache"
+ # query repo of passed pkgname, specify --nodeps twice to skip all dependency checks
mapfile -t repos < <(pacman --config "${_DEVTOOLS_PACMAN_CONF_DIR}/multilib.conf" \
--dbpath "${_DEVTOOLS_PACMAN_CACHE_DIR}" \
- -S \
+ --sync \
+ --nodeps \
+ --nodeps \
--print \
--print-format '%n %r' \
- "${pkgnames[0]}" | grep -E "^${pkgnames[0]} " | awk '{print $2}'
+ "${pkgnames[0]}" 2>/dev/null | awk '$1=="'"${pkgnames[0]}"'"{print $2}'
)
lock_close 10