]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
tools/ci-build.sh: cleanup setup and usage of ci_builddir
authorRalf Habacker <ralf.habacker@freenet.de>
Mon, 7 Aug 2023 09:36:21 +0000 (11:36 +0200)
committerRalf Habacker <ralf.habacker@freenet.de>
Mon, 7 Aug 2023 17:59:16 +0000 (19:59 +0200)
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 <ralf.habacker@freenet.de>
tools/ci-build.sh

index ba981579d9bbf52c735f4ca59c6800e81261f776..42b8d69e770b84939baec868bc0c01ae1f70fd5c 100755 (executable)
@@ -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")"
 
 #