1 |
commit: 2b69063f19a03e9224eeaa6cecd35dd2004127c0 |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Oct 5 01:11:27 2021 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Oct 5 01:11:27 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/build-docbook-catalog.git/commit/?id=2b69063f |
7 |
|
8 |
add explicit check & error message for /run/lock |
9 |
|
10 |
If the system is missing its lock dir, show an explicit error message |
11 |
instead of confusing bash "file does not exist" errors. |
12 |
|
13 |
Bug: https://bugs.gentoo.org/816303 |
14 |
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org> |
15 |
|
16 |
build-docbook-catalog | 7 ++++++- |
17 |
1 file changed, 6 insertions(+), 1 deletion(-) |
18 |
|
19 |
diff --git a/build-docbook-catalog b/build-docbook-catalog |
20 |
index 9064d72..5b6cd85 100755 |
21 |
--- a/build-docbook-catalog |
22 |
+++ b/build-docbook-catalog |
23 |
@@ -66,7 +66,12 @@ main() { |
24 |
mkdir -p "${ROOT}${ROOTCONFDIR}" || error "could not create ${ROOTCONFDIR}" |
25 |
fi |
26 |
|
27 |
- local lock="${ROOT}/run/lock/build-docbook-catalog.lock" |
28 |
+ local lock_dir="${ROOT}/run/lock" |
29 |
+ if [[ ! -d ${lock_dir} ]] ; then |
30 |
+ error "${lock_dir}: missing critical system path; please create it" |
31 |
+ fi |
32 |
+ |
33 |
+ local lock="${lock_dir}/build-docbook-catalog.lock" |
34 |
( |
35 |
# Lock the dir to avoid trashing other runs that might |
36 |
# be running parallel. |