tools/ci-build.sh: Clean up directories from possible previous builds
authorRalf Habacker <ralf.habacker@freenet.de>
Mon, 9 Nov 2020 10:06:14 +0000 (11:06 +0100)
committerSimon McVittie <smcv@collabora.com>
Fri, 25 Feb 2022 13:26:40 +0000 (13:26 +0000)
Otherwise, ci-build.sh cannot be executed on a local system if there
are previous runs.

(cherry picked from commit e82d5fe48623337fd5a69317e27b7a8ce195398a)

tools/ci-build.sh

index e92d85b..1db4edf 100755 (executable)
@@ -100,10 +100,12 @@ NOCONFIGURE=1 ./autogen.sh
 
 case "$ci_buildsys" in
     (cmake-dist)
+        # clean up directories from possible previous builds
+        rm -rf ci-build-dist
         # Do an Autotools `make dist`, then build *that* with CMake,
         # to assert that our official release tarballs will be enough
         # to build with CMake.
-        mkdir ci-build-dist
+        mkdir -p ci-build-dist
         ( cd ci-build-dist; ../configure )
         make -C ci-build-dist dist
         tar -zxvf ci-build-dist/dbus-1.*.tar.gz
@@ -131,7 +133,9 @@ case "$ci_host" in
 esac
 
 srcdir="$(pwd)"
-mkdir ci-build-${ci_variant}-${ci_host}
+# clean up directories from possible previous builds
+rm -rf ci-build-${ci_variant}-${ci_host}
+mkdir -p ci-build-${ci_variant}-${ci_host}
 cd ci-build-${ci_variant}-${ci_host}
 
 make="make -j${ci_parallel} V=1 VERBOSE=1"