more random fixes

This commit is contained in:
2025-10-28 17:31:46 -05:00
parent 8a5ed69f86
commit 81a2cde5c7
5 changed files with 36 additions and 13 deletions

View File

@@ -286,11 +286,6 @@ download_release() {
local base_path="$(bash_basename "${extracted_dir}")"
local base_dl_path="${DL_DIR}/${base_path}"
# make paths if needed
test -d "${DL_DIR}" || { mkdir -p "${DL_DIR}" || return 1; }
test -d "${BUILD_DIR}" || { mkdir -p "${BUILD_DIR}" || return 1; }
test -d "${CCACHE_DIR}" || { mkdir -p "${CCACHE_DIR}" || return 1; }
# remove other versions of a download
for wrong_ver_dl in "${DL_DIR}/${build}-"*; do
if line_contains "${wrong_ver_dl}" "${base_path}"; then
@@ -521,7 +516,15 @@ cargo_cbuild() {
--destdir "${PWD}/local-install" \
"${CARGO_CINSTALL_FLAGS[@]}"
# cargo cinstall destdir prepends with entire prefix
cd "./local-install${PREFIX}" || return 1
# this breaks windows with msys path augmentation
# so recurse into directories until sysroot is there
cd ./local-install || return 1
local sysrootDir="$(bash_basename "${PREFIX}")"
while ! test -d "${sysrootDir}"; do
cd ./* || return 1
done
# final cd
cd "${sysrootDir}" || return 1
${SUDO_MODIFY} cp -r ./* "${PREFIX}/"
}

View File

@@ -106,7 +106,6 @@ docker_build_image() {
local image="$1"
validate_selected_image "${image}" || return 1
check_docker || return 1
test -d "${DOCKER_DIR}" || mkdir -p "${DOCKER_DIR}"
PLATFORM="${PLATFORM:-$(echo_platform)}"
echo_info "sourcing package manager for ${image}"

View File

@@ -293,7 +293,6 @@ set_encode_opts() {
# shellcheck disable=SC2155
# shellcheck disable=SC2016
gen_encode_script() {
test -d "${TMP_DIR}" || mkdir -p "${TMP_DIR}"
local genScript="${TMP_DIR}/$(bash_basename "${OUTPUT}").sh"
# single string params

View File

@@ -45,7 +45,6 @@ echo_if_fail() {
# set trace to the cmdEvalTrace and open file descriptor
local cmdEvalTrace="${TMP_DIR}/${logName}cmdEvalTrace"
test -d "${TMP_DIR}" || mkdir -p "${TMP_DIR}"
exec 5>"${cmdEvalTrace}"
export BASH_XTRACEFD=5
@@ -220,25 +219,35 @@ is_darwin() {
}
print_os() {
# cached response
if [[ -n ${FB_OS} ]]; then
echo "${FB_OS}"
return 0
fi
FB_OS=''
unset FB_OS
if [[ -f /etc/os-release ]]; then
source /etc/os-release
FB_OS="${ID}"
if [[ ${VERSION_ID} != '' ]]; then
FB_OS+="-${VERSION_ID}"
fi
if [[ ${FB_OS} == 'arch'* ]]; then
FB_OS=archlinux
if line_starts_with "${FB_OS}" 'arch'; then
FB_OS='archlinux'
fi
else
FB_OS="$(uname -o)"
fi
echo "${FB_OS,,}"
# lowercase
FB_OS="${FB_OS,,}"
# special treatment for windows
if line_contains "${FB_OS}" 'windows' || line_contains "${FB_OS}" 'msys'; then
FB_OS='windows'
fi
echo "${FB_OS}"
}
is_positive_integer() {

13
main.sh
View File

@@ -15,6 +15,19 @@ DOCKER_DIR="${IGN_DIR}/docker"
PATCHES_DIR="${REPO_DIR}/patches"
export REPO_DIR IGN_DIR TMP_DIR DL_DIR BUILD_DIR CCACHE_DIR DOCKER_DIR PATCHES_DIR
# make paths if needed
IGN_DIRS=(
"${TMP_DIR}"
"${DL_DIR}"
"${BUILD_DIR}"
"${CCACHE_DIR}"
"${DOCKER_DIR}"
)
for dir in "${IGN_DIRS[@]}"; do
test -d "${dir}" || mkdir -p "${dir}"
done
unset IGN_DIRS
# function names, descriptions, completions
unset FB_FUNC_NAMES FB_FUNC_DESCS FB_FUNC_COMPLETION
FB_FUNC_NAMES=()