[pacman-contrib] [PATCH] checkupdates: Make sure spaces in DBPath are handled
Fixes FS#43706. Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> --- src/checkupdates.sh.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/checkupdates.sh.in b/src/checkupdates.sh.in index 04f11ae..e76780e 100644 --- a/src/checkupdates.sh.in +++ b/src/checkupdates.sh.in @@ -46,8 +46,10 @@ fi trap 'rm -f $CHECKUPDATES_DB/db.lck' INT TERM EXIT -DBPath="${DBPath:-@localstatedir@/lib/pacman/}" -eval $(awk -F' *= *' '$1 ~ /DBPath/ { print $1 "=" $2 }' @sysconfdir@/pacman.conf) +DBPath="$(awk -F' *= *' '/^DBPath/ { print $2 }' @sysconfdir@/pacman.conf)" +if [[ -z "$DBPath" ]] || [[ ! -d "$DBPath" ]]; then + DBPath="@localstatedir@/lib/pacman/" +fi mkdir -p "$CHECKUPDATES_DB" ln -s "${DBPath}/local" "$CHECKUPDATES_DB" &> /dev/null -- 2.10.0
participants (1)
-
Johannes Löthberg