diff --git a/buildtool.sh b/buildtool.sh index eea849e..08738cf 100755 --- a/buildtool.sh +++ b/buildtool.sh @@ -314,14 +314,18 @@ function ask_clonedir_conflictresolution() { exit 1 ;; "r"|"R") - export "BUILDTOOL_MAKEPKG_REUSE= --noextract --force" + if [ -a "${BUILDTOOL_CLONEDIR}/src" ]; then + export "BUILDTOOL_MAKEPKG_REUSE= --noextract" + elif [ -a "${BUILDTOOL_CLONEDIR}/pkg" ]; then + export "BUILDTOOL_MAKEPKG_REUSE=${BUILDTOOL_MAKEPKG_REUSE} --force" + fi ;; "f"|"F") infoh "Removing existing \$BUILDTOOL_CLONEDIR directory" rm -rf "${BUILDTOOL_CLONEDIR}" ;; *) - errorh "Invalid answer. Please answer with Y, N or I." + errorh "Invalid answer. Please answer with Y, N or I" ask_debug esac }