--- /dev/null
+#!/usr/bin/env bash
+#
+# lib-build.sh - A library of build and test bash shell functions.
+#
+# There should be few, or none, globals in this file beyond function
+# definitions.
+#
+# This script should be `shellcheck`ed. Please run shellcheck when
+# making changes to this script and use ignore comments
+# (ref: https://www.shellcheck.net/wiki/Ignore ) to explicitly mark
+# where a line is intentionally ignoring a typical rule.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+
+# The following global only exists to help detect if lib-build has already been
+# sourced. This is only needed because the scripts that are being migrated are
+# often sourcing (as opposed to exec'ing one another).
+# shellcheck disable=SC2034
+_SOURCED_LIB_BUILD=1
+
+function in_jenkins() {
+ [ -n "$JENKINS_HOME" ]
+}
set -e
+if ! [ "${_SOURCED_LIB_BUILD}" = 1 ]; then
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ CEPH_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
+ . "${CEPH_ROOT}/src/script/lib-build.sh" || exit 2
+fi
+
+
trap clean_up_after_myself EXIT
ORIGINAL_CCACHE_CONF="$HOME/.ccache/ccache.conf"
SAVED_CCACHE_CONF="$HOME/.run-make-check-saved-ccache-conf"
-function in_jenkins() {
- test -n "$JENKINS_HOME"
-}
-
function save_ccache_conf() {
test -f $ORIGINAL_CCACHE_CONF && cp $ORIGINAL_CCACHE_CONF $SAVED_CCACHE_CONF || true
}