index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
-rwxr-xr-x | lib/common-functions | 15 |
diff --git a/lib/common-functions b/lib/common-functions index 4224831..b152f53 100755 --- a/lib/common-functions +++ b/lib/common-functions @@ -719,3 +719,18 @@ calculate_script_checksum() { sha512sum | \ awk '{print $1}' } + +# verbose_flock +# flock wrapper with some informational output on error +verbose_flock() { + local err=0 + flock "$@" || { + err=$? + lsof "/proc/$$/fd/$( + printf '%s\n' "$@" | \ + grep -vm1 '^-' + )" || true + printf 'FYI: I am %s.\n' "$$" + return ${err} + } +} |