summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/makepkg.sh.in9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 5606f65b..4e7b2e6c 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -228,6 +228,15 @@ run_pacman() {
else
cmd=(su root -c "$(printf '%q ' "${cmd[@]}")")
fi
+ local lockfile="$(pacman-conf DBPath)/db.lck"
+ while [[ -f $lockfile ]]; do
+ local timer=0
+ msg "$(gettext "Pacman is currently in use, please wait...")"
+ while [[ -f $lockfile ]] && (( timer < 10 )); do
+ (( ++timer ))
+ sleep 3
+ done
+ done
fi
"${cmd[@]}"
}