From dcf2aee9b05d83a549b86cfabd7413584ced9d87 Mon Sep 17 00:00:00 2001 From: Dmitriy Nikiforov Date: Wed, 2 Aug 2017 18:02:34 +0300 Subject: [PATCH] Clean previously built artifacts before starting a new build --- infra/commands/build.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/infra/commands/build.sh b/infra/commands/build.sh index 56bd69e..9efa652 100755 --- a/infra/commands/build.sh +++ b/infra/commands/build.sh @@ -162,6 +162,9 @@ output_dir="${gbs_build_root}${chroot_output_dir}" echo "Building ${target_dir}:" +# clean previously built target +[[ -d ${build_target_dir} ]] && rm -rf "${build_target_dir}" + if (( ONLY_TARGET != 1 )); then # Check if target spec exists if [[ -n "${CUSTOM_SPEC}" ]]; then @@ -183,6 +186,9 @@ if (( ONLY_TARGET != 1 )); then exit 0 fi + # clean previously built rpms + [[ -d ${build_rpm_dir} ]] && rm -rf "${build_rpm_dir}" + # ensure that the main project will be the last one to build the # fuzzing target on top of it projects=(${spec[extra]} ${spec[main]}) -- 2.7.4