Add clone dir conflict resolution
This commit is contained in:
parent
24c1065ab7
commit
7639862e51
1 changed files with 26 additions and 1 deletions
27
buildtool.sh
27
buildtool.sh
|
@ -13,12 +13,13 @@ echo ""
|
||||||
# Variables
|
# Variables
|
||||||
export "BUILDTOOL_REPOSITORY=https://git.staropensource.de/JeremyStarTM/kernel-optimized.git"
|
export "BUILDTOOL_REPOSITORY=https://git.staropensource.de/JeremyStarTM/kernel-optimized.git"
|
||||||
export "BUILDTOOL_PACKAGES=base-devel git rustup"
|
export "BUILDTOOL_PACKAGES=base-devel git rustup"
|
||||||
export "BUILDTOOL_CLONEDIR=jstm-kernel-optimized"
|
|
||||||
export "BUILDTOOL_BUILDCMDLINE=nice -20 env MAKEFLAGS=-j$(nproc)"
|
export "BUILDTOOL_BUILDCMDLINE=nice -20 env MAKEFLAGS=-j$(nproc)"
|
||||||
|
export "BUILDTOOL_CLONEDIR=jstm-kernel-optimized"
|
||||||
|
|
||||||
# Checks
|
# Checks
|
||||||
## Check for Arch Linux
|
## Check for Arch Linux
|
||||||
(
|
(
|
||||||
|
# shellcheck disable=SC1091
|
||||||
source "/etc/os-release"
|
source "/etc/os-release"
|
||||||
if [ "${NAME}" != "Arch Linux" ] || [ "${PRETTY_NAME}" != "Arch Linux" ] || [ "${ID}" != "arch" ]; then
|
if [ "${NAME}" != "Arch Linux" ] || [ "${PRETTY_NAME}" != "Arch Linux" ] || [ "${ID}" != "arch" ]; then
|
||||||
if [ "${BUILDTOOL_COMPILE_NONARCH}" != "true" ]; then
|
if [ "${BUILDTOOL_COMPILE_NONARCH}" != "true" ]; then
|
||||||
|
@ -241,6 +242,29 @@ function ask_debug() {
|
||||||
ask_debug
|
ask_debug
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
## Ask for clone directory conflict resolution (includes check)
|
||||||
|
function ask_clonedir_conflictresolution() {
|
||||||
|
if [ ! -d "${BUILDTOOL_CLONEDIR}" ]; then
|
||||||
|
return
|
||||||
|
elif [ -a "${BUILDTOOL_CLONEDIR}" ] && [ ! -d "${BUILDTOOL_CLONEDIR}" ]; then
|
||||||
|
echo ":: Warning: Something that isn't a directory exists at location \"${BUILDTOOL_CLONEDIR}\""
|
||||||
|
fi
|
||||||
|
read -rp ":: 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"|"")
|
||||||
|
echo ":: Error: Conflict resolution failed."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
"r"|"R") ;;
|
||||||
|
"f"|"F")
|
||||||
|
echo ":: Removing existing \$BUILDTOOL_CLONEDIR directory"
|
||||||
|
#rm -rf "${BUILDTOOL_CLONEDIR}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid answer. Please answer with Y, N or I."
|
||||||
|
ask_debug
|
||||||
|
esac
|
||||||
|
}
|
||||||
ask_mold
|
ask_mold
|
||||||
ask_cpupower
|
ask_cpupower
|
||||||
ask_tmpfs
|
ask_tmpfs
|
||||||
|
@ -250,6 +274,7 @@ ask_cpfinalconfig
|
||||||
ask_modprobeddb
|
ask_modprobeddb
|
||||||
ask_subarchitecture
|
ask_subarchitecture
|
||||||
ask_debug
|
ask_debug
|
||||||
|
ask_clonedir_conflictresolution
|
||||||
|
|
||||||
# Pre-building
|
# Pre-building
|
||||||
## Install dependencies
|
## Install dependencies
|
||||||
|
|
Loading…
Reference in a new issue