From b1c700169e99a2c3ac7a03059b9a9cc52d0a3f6f Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 15 Oct 2022 14:06:58 +0300 Subject: [PATCH 38/38] winbuild.sh: Clear out old build directory See osdn #45865 Signed-off-by: Marko Lindqvist --- windows/installer_cross/meson-winbuild.sh | 16 +++++++++------- windows/installer_cross/winbuild.sh | 13 ++++++++++--- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/windows/installer_cross/meson-winbuild.sh b/windows/installer_cross/meson-winbuild.sh index 5a6c51c424..b155e027ff 100755 --- a/windows/installer_cross/meson-winbuild.sh +++ b/windows/installer_cross/meson-winbuild.sh @@ -87,13 +87,15 @@ if test "$CLIENT" = "" ; then CLIENT="$GUI" fi -if ! rm -Rf meson-build-${SETUP}-${GUI} ; then +BUILD_DIR="meson-build-${SETUP}-${GUI}" + +if ! rm -Rf "${BUILD_DIR}" ; then echo "Failed to clear out old build directory!" >&2 exit 1 fi -if ! mkdir -p meson-build-${SETUP}-${GUI} ; then - echo "Can't create build directory \"meson-build-${SETUP}-${GUI}\"!" >&2 +if ! mkdir -p "${BUILD_DIR}" ; then + echo "Can't create build directory \"${BUILD_DIR}\"!" >&2 exit 1 fi @@ -103,10 +105,10 @@ then exit 1 fi -PACKAGENAME=freeciv-${VERREV}-${SETUP}-${GUI} -MESON_INSTALL_DIR=$(pwd)/meson-install/${PACKAGENAME} +PACKAGENAME="freeciv-${VERREV}-${SETUP}-${GUI}" +MESON_INSTALL_DIR="$(pwd)/meson-install/${PACKAGENAME}" -if ! rm -Rf $MESON_INSTALL_DIR ; then +if ! rm -Rf "${MESON_INSTALL_DIR}" ; then echo "Failed to clear out old install directory!" >&2 exit 1 fi @@ -117,7 +119,7 @@ echo "Freeciv version $VERREV" echo "----------------------------------" if ! ( -cd meson-build-${SETUP}-${GUI} +cd "${BUILD_DIR}" export PKG_CONFIG_PATH=${DLLSPATH}/lib/pkgconfig diff --git a/windows/installer_cross/winbuild.sh b/windows/installer_cross/winbuild.sh index 41e5513512..139e6478f2 100755 --- a/windows/installer_cross/winbuild.sh +++ b/windows/installer_cross/winbuild.sh @@ -102,8 +102,15 @@ if test "x$MAKE_PARAMS" = "x" ; then MAKE_PARAMS="-j$(nproc)" fi -if ! mkdir -p build-${SETUP}${NAMEP} ; then - echo "Can't create build directory \"build-${SETUP}${NAMEP}\"!" >&2 +BUILD_DIR="build-${SETUP}${NAMEP}" + +if ! rm -Rf "${BUILD_DIR}" ; then + echo "Failed to clear out old build directory!" >&2 + exit 1 +fi + +if ! mkdir -p "${BUILD_DIR}" ; then + echo "Can't create build directory \"${BUILD_DIR}\"!" >&2 exit 1 fi @@ -168,7 +175,7 @@ fi INSTALL_DIR="$(pwd)/freeciv-${VERREV}${NAMEP}" if ! ( -cd build-${SETUP}${NAMEP} +cd "${BUILD_DIR}" if test "x$INST_CROSS_MODE" = "xsnapshot" ; then GITREVP="--enable-gitrev" -- 2.35.1