diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index b39433f3..a1a450dd 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -67,6 +67,7 @@ NOARCHIVE=0 NOBUILD=0 NODEPS=0 NOEXTRACT=0 +NOWAIT=0 PKGFUNC=0 PKGVERFUNC=0 PREPAREFUNC=0 @@ -236,6 +237,10 @@ run_pacman() { cmd=(su root -c "$(printf '%q ' "${cmd[@]}")") fi local lockfile="$(pacman-conf DBPath)/db.lck" + if (( NOWAIT )) && [[ -f $lockfile ]]; then + msg "$(gettext "Pacman is currently in use, exiting")" + exit $E_FAIL + fi while [[ -f $lockfile ]]; do local timer=0 msg "$(gettext "Pacman is currently in use, please wait...")" @@ -984,6 +989,7 @@ usage() { printf -- "$(gettext " --nocheck Do not run the %s function in the %s")\n" "check()" "$BUILDSCRIPT" printf -- "$(gettext " --noprepare Do not run the %s function in the %s")\n" "prepare()" "$BUILDSCRIPT" printf -- "$(gettext " --nosign Do not create a signature for the package")\n" + printf -- "$(gettext " --nowait Exit immediately if pacman is in