summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-10-12 00:43:01 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-10-12 00:43:01 (EDT)
commitb97fc89c9626d64332ea54936381f5b4112ea6f5 (patch)
tree8162f77a98b815e9c2a9b1c1ba2a0379b9ca917b /src
parent4da3b7492a51af6d73597e5455cdfec6265767f2 (diff)
pro-archman: Don't lock db for help/version cmds.
Diffstat (limited to 'src')
-rw-r--r--src/pro-archman.sh18
1 files changed, 8 insertions, 10 deletions
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}
}