fix(pkgctl): avoid pacman db dependency checks during repo detection

By default the sync operation enables dependency checks during the
preparation of the transaction. This isn't necessary for the print
option, but is done nevertheless, which leads to issues for example
during soname dependency problems. The result is a none functional
automatic repo detection.

Fix this by explicitly disabling dependency version checks. We specify
this option twice to skip all dependency checks.

Fixes #189

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
This commit is contained in:
Levente Polyak 2023-09-05 00:00:56 +02:00
parent 8190a22480
commit 547961681a
No known key found for this signature in database
GPG Key ID: FC1B547C8D8172C8
1 changed files with 4 additions and 1 deletions

View File

@ -39,9 +39,12 @@ get_pacman_repo_from_pkgbuild() {
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]}" | awk '$1=="'"${pkgnames[0]}"'"{print $2}'