summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2023-08-07 11:36:21 +0200
committerRalf Habacker <ralf.habacker@freenet.de>2023-08-07 19:59:16 +0200
commit1b10f4f89cfcd844efa7b7c81e7b48a0142af0ef (patch)
tree2492cd215ef320bbc8505986dc3ee1b74bdc1444
parent5ddb3b67bf983f7ed5a879093b3da5363abf64a8 (diff)
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 <ralf.habacker@freenet.de>
-rwxr-xr-xtools/ci-build.sh21
1 files changed, 12 insertions, 9 deletions
diff --git a/tools/ci-build.sh b/tools/ci-build.sh
index ba981579..42b8d69e 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")"
#