Fix conflict resolution
This commit is contained in:
parent
a5c3dc96e9
commit
1e70122d93
1 changed files with 5 additions and 14 deletions
19
buildtool.sh
19
buildtool.sh
|
@ -329,39 +329,30 @@ function ask_clonedir_conflictresolution() {
|
|||
if [ -n "${BUILDTOOL_LOCALDIR}" ]; then
|
||||
warnh "Skipped conflict resolution (\$BUILDTOOL_LOCALDIR is set)"
|
||||
export "BUILDTOOL_CLONEDIR_CONFLICT=r"
|
||||
if [ -a "${BUILDTOOL_CLONEDIR}/src" ]; then
|
||||
diagh "src/ directory present, appending \"--noextract\""
|
||||
export "BUILDTOOL_MAKEPKG_REUSE= --noextract"
|
||||
fi
|
||||
if [ -a "${BUILDTOOL_CLONEDIR}/pkg" ]; then
|
||||
diagh "pkg/ directory present, appending \"--force\""
|
||||
export "BUILDTOOL_MAKEPKG_REUSE=${BUILDTOOL_MAKEPKG_REUSE} --force"
|
||||
fi
|
||||
return
|
||||
fi
|
||||
[[ ! -d "${BUILDTOOL_CLONEDIR}" ]] && [[ ! -L "${BUILDTOOL_CLONEDIR}" ]] && return
|
||||
[[ -a "${BUILDTOOL_CLONEDIR}" ]] && [[ ! -d "${BUILDTOOL_CLONEDIR}" ]] && [[ ! -L "${BUILDTOOL_CLONEDIR}" ]] && warnh "Something that isn't a directory or symlink exists at location \"${BUILDTOOL_CLONEDIR}\""
|
||||
read -rp "$(infoh "Warning: \"${BUILDTOOL_CLONEDIR}\" already exists. What should be done to resolve the conflict [A(bort)/r(ecompile)/f(resh)]? ")" BUILDTOOL_CLONEDIR_CONFLICT
|
||||
[[ -z "${BUILDTOOL_CLONEDIR_CONFLICT}" ]] && read -rp "$(infoh "Warning: \"${BUILDTOOL_CLONEDIR}\" already exists. What should be done to resolve the conflict [A(bort)/r(ecompile)/f(resh)]? ")" BUILDTOOL_CLONEDIR_CONFLICT
|
||||
case "${BUILDTOOL_CLONEDIR_CONFLICT}" in
|
||||
"a"|"A"|"")
|
||||
errorh "Conflict resolution failed"
|
||||
exit 1
|
||||
;;
|
||||
"r"|"R")
|
||||
if [ -a "${BUILDTOOL_CLONEDIR}/src" ]; then
|
||||
if [ -a "${BUILDTOOL_CLONEDIR}/src" ] || [ -a "/tmp/makepkg/linux-jstm-optimized/src" ]; then
|
||||
diagh "src/ directory present, appending \"--noextract\""
|
||||
export "BUILDTOOL_MAKEPKG_REUSE= --noextract"
|
||||
elif [ -a "${BUILDTOOL_CLONEDIR}/pkg" ]; then
|
||||
elif [ -a "${BUILDTOOL_CLONEDIR}/pkg" ] || [ -a "/tmp/makepkg/linux-jstm-optimized/pkg" ]; then
|
||||
diagh "pkg/ directory present, appending \"--force\""
|
||||
export "BUILDTOOL_MAKEPKG_REUSE=${BUILDTOOL_MAKEPKG_REUSE} --force"
|
||||
fi
|
||||
;;
|
||||
"f"|"F")
|
||||
infoh "Removing existing \$BUILDTOOL_CLONEDIR directory"
|
||||
rm -rf "${BUILDTOOL_CLONEDIR}"
|
||||
rm -rf "${BUILDTOOL_CLONEDIR}" "/tmp/makepkg/linux-jstm-optimized"
|
||||
;;
|
||||
*)
|
||||
errorh "Invalid answer. Please answer with Y, N or I"
|
||||
errorh "Invalid answer. Please answer with A, R or F"
|
||||
ask_debug
|
||||
esac
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue