aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-10-04 21:11:27 -0400
committerMike Frysinger <vapier@gentoo.org>2021-10-04 21:11:27 -0400
commit2b69063f19a03e9224eeaa6cecd35dd2004127c0 (patch)
tree8882d3859df5544a0b1baebc1cb19c453f027394
parentupdate README & dist process (diff)
downloadbuild-docbook-catalog-2b69063f19a03e9224eeaa6cecd35dd2004127c0.tar.gz
build-docbook-catalog-2b69063f19a03e9224eeaa6cecd35dd2004127c0.tar.bz2
build-docbook-catalog-2b69063f19a03e9224eeaa6cecd35dd2004127c0.zip
add explicit check & error message for /run/lock
If the system is missing its lock dir, show an explicit error message instead of confusing bash "file does not exist" errors. Bug: https://bugs.gentoo.org/816303 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rwxr-xr-xbuild-docbook-catalog7
1 files changed, 6 insertions, 1 deletions
diff --git a/build-docbook-catalog b/build-docbook-catalog
index 9064d72..5b6cd85 100755
--- a/build-docbook-catalog
+++ b/build-docbook-catalog
@@ -66,7 +66,12 @@ main() {
mkdir -p "${ROOT}${ROOTCONFDIR}" || error "could not create ${ROOTCONFDIR}"
fi
- local lock="${ROOT}/run/lock/build-docbook-catalog.lock"
+ local lock_dir="${ROOT}/run/lock"
+ if [[ ! -d ${lock_dir} ]] ; then
+ error "${lock_dir}: missing critical system path; please create it"
+ fi
+
+ local lock="${lock_dir}/build-docbook-catalog.lock"
(
# Lock the dir to avoid trashing other runs that might
# be running parallel.