From: Ralf Habacker Date: Mon, 7 Aug 2023 09:36:21 +0000 (+0200) Subject: tools/ci-build.sh: cleanup setup and usage of ci_builddir X-Git-Tag: dbus-1.15.8~27^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b10f4f89cfcd844efa7b7c81e7b48a0142af0ef;p=thirdparty%2Fdbus.git tools/ci-build.sh: cleanup setup and usage of ci_builddir The order and arrangement of the initialization of the build directories has been improved: the deletion of special directories have been moved to the associated part, the rest have been merged and there is a default value if not specified as an environment variable, making it easier to execute on the command line. Signed-off-by: Ralf Habacker --- diff --git a/tools/ci-build.sh b/tools/ci-build.sh index ba981579d..42b8d69e7 100755 --- a/tools/ci-build.sh +++ b/tools/ci-build.sh @@ -155,17 +155,12 @@ maybe_fail_tests () { # own checks. NOCONFIGURE=1 ./autogen.sh -# clean up directories from possible previous builds -if [ -z "$ci_builddir" ]; then - echo "ERROR: ci_builddir environment variable must be set!" - exit 1 -fi -rm -rf "$ci_builddir" -rm -rf ci-build-dist -rm -rf src-from-dist - case "$ci_buildsys" in (cmake-dist|meson-dist) + # clean up directories from possible previous builds + rm -rf ci-build-dist + rm -rf src-from-dist + # Do an Autotools `make dist`, then build *that* with CMake or Meson, # to assert that our official release tarballs will be enough # to build with CMake or Meson. @@ -181,7 +176,15 @@ case "$ci_buildsys" in ;; esac +# setup default ci_builddir, if not present +if [ -z "$ci_builddir" ]; then + ci_builddir=${srcdir}/ci-build-${ci_variant}-${ci_host} +fi +# clean up directories from possible previous builds +rm -rf "$ci_builddir" +# create build directory mkdir -p "$ci_builddir" +# use absolute path ci_builddir="$(realpath "$ci_builddir")" #