From b97fc89c9626d64332ea54936381f5b4112ea6f5 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sat, 12 Oct 2013 00:43:01 -0400 Subject: pro-archman: Don't lock db for help/version cmds. --- (limited to 'src') diff --git a/src/pro-archman.sh b/src/pro-archman.sh index 93fa4b5..2e0332e 100644 --- a/src/pro-archman.sh +++ b/src/pro-archman.sh @@ -99,25 +99,23 @@ main() exit 1 fi - mkdir -p "${opt_base_dir}/.db" - lock="${opt_base_dir}/.db/lock" - if ! (set -C; printf '%d\n' "${$}" >"${lock}") 2>/dev/null; then - printf '%s: Error: ' "${0##*/}" >&2 - printf "$(get_msg 'lock_fail')\n" >&2 - exit 2 - fi - if [ "x${opt_cmd}" != 'x' ]; then run_cmd "${opt_cmd}" "${@}" status=${?} else + mkdir -p "${opt_base_dir}/.db" + lock="${opt_base_dir}/.db/lock" + if ! (set -C; printf '%d\n' "${$}" >"${lock}") 2>/dev/null; then + printf '%s: Error: ' "${0##*/}" >&2 + printf "$(get_msg 'lock_fail')\n" >&2 + exit 2 + fi get_conf run_cmd "${@}" status=${?} + fini fi - fini - return ${status} } -- cgit v0.9.1