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:
authorLevente Polyak <anthraxx@archlinux.org>2024-02-06 21:59:11 +0100
committerLevente Polyak <anthraxx@archlinux.org>2024-02-08 00:52:20 +0100
commit3ecba314fc3a7508d80c5450aaae4b5fc507d62b (patch)
treeb49d8fb9233d9f821b1769a7c8520d22d51b38a8 /src/lib/util/pacman.sh
parent5042dcaeb4916e199b30ecf21048a4234da43499 (diff)
feat(build): consolidate repo flags in build and release subcommand
Previously the behavior was inconsistent and not fully fulfilling its purpose of only using --repo once when initially pushing a new and unknown package to the official repositories. Consolidate the behavior by only allowing to use --repo during the initial packaging and disallow any subsequent usage. The expected user experience is to subsequently use --testing or --staging to influence the auto-detection of the build target. This avoids any kind of human error which leads to releasing core packages to extra-testing by accident. Furthermore, allow the build subcommand to automatically fallback to extra as the default stable repository target which greatly improves the usability for AUR or local override builds. Fixes #193 Fixes #191 Component: pkgctl build Component: pkgctl release Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
Diffstat (limited to 'src/lib/util/pacman.sh')
-rw-r--r--src/lib/util/pacman.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/util/pacman.sh b/src/lib/util/pacman.sh
index 82a227b..620e1a8 100644
--- a/src/lib/util/pacman.sh
+++ b/src/lib/util/pacman.sh
@@ -38,6 +38,11 @@ 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" \
@@ -47,7 +52,7 @@ get_pacman_repo_from_pkgbuild() {
--nodeps \
--print \
--print-format '%n %r' \
- "${pkgnames[0]}" | awk '$1=="'"${pkgnames[0]}"'"{print $2}'
+ "${pkgnames[0]}" 2>/dev/null | awk '$1=="'"${pkgnames[0]}"'"{print $2}'
)
lock_close 10