[PATCH 2/2] bacman: use pacman-conf to query pacman's config
morganamilo
morganamilo at gmail.com
Fri Jun 1 01:36:39 UTC 2018
Signed-off-by: morganamilo <morganamilo at gmail.com>
---
src/bacman.sh.in | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/bacman.sh.in b/src/bacman.sh.in
index ca7c9c8..4e93a38 100644
--- a/src/bacman.sh.in
+++ b/src/bacman.sh.in
@@ -137,12 +137,12 @@ if (( EUID )); then
fi
# Source environmental variables and specify fallbacks
-if [[ ! -r @sysconfdir@/pacman.conf ]]; then
- error "unable to read @sysconfdir@/pacman.conf"
- exit 1
+if ! DBPath="$(pacman-conf DBPath)"; then
+ error "unable to read @sysconfdir@/pacman.conf"
+ exit 1
fi
-eval $(awk '/DBPath/ {print $1$2$3}' @sysconfdir@/pacman.conf)
-pac_db="${DBPath:- at localstatedir@/lib/pacman/}/local"
+pac_db="${DBPath:- at localstatedir@/lib/pacman}/local"
+
if [[ ! -r @sysconfdir@/makepkg.conf ]]; then
error "unable to read @sysconfdir@/makepkg.conf"
exit 1
--
2.17.1
More information about the pacman-contrib
mailing list