From cf821cb355e5ea46e935ec6a03259595abcd7686 Mon Sep 17 00:00:00 2001 From: Georges Dubus Date: Fri, 9 Mar 2012 13:53:39 +0100 Subject: [PATCH] Wait for pacman to be available. --- scripts/makepkg.sh.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 89cd118..5d530b4 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -424,6 +424,11 @@ run_pacman() { else cmd=("$PACMAN" "$@") fi + local lockfile="/var/lib/pacman//db.lck" + if [[ -f ${lockfile} ]]; then + msg "$(gettext 'Pacman is currently in use, please wait.')" + while [[ -f ${lockfile} ]]; do sleep 3; done + fi if (( ! ASROOT )) && [[ ! $1 = -@(T|Qq) ]]; then if type -p sudo >/dev/null; then cmd=(sudo "${cmd[@]}") -- 1.7.9.3