more clean slate fixes

This commit is contained in:
2025-10-28 16:31:43 -05:00
parent 014448ac55
commit 8a5ed69f86

View File

@@ -32,7 +32,7 @@ set_compile_opts() {
testfile="${PREFIX}/ffmpeg-build-testfile" testfile="${PREFIX}/ffmpeg-build-testfile"
else else
# try creating in parent path # try creating in parent path
testfile="$(bash_basename "${PREFIX}")/ffmpeg-build-testfile" testfile="$(bash_dirname "${PREFIX}")/ffmpeg-build-testfile"
fi fi
unset SUDO_MODIFY unset SUDO_MODIFY
if touch "${testfile}" 2>/dev/null; then if touch "${testfile}" 2>/dev/null; then
@@ -286,6 +286,11 @@ download_release() {
local base_path="$(bash_basename "${extracted_dir}")" local base_path="$(bash_basename "${extracted_dir}")"
local base_dl_path="${DL_DIR}/${base_path}" 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 # remove other versions of a download
for wrong_ver_dl in "${DL_DIR}/${build}-"*; do for wrong_ver_dl in "${DL_DIR}/${build}-"*; do
if line_contains "${wrong_ver_dl}" "${base_path}"; then if line_contains "${wrong_ver_dl}" "${base_path}"; then
@@ -442,10 +447,6 @@ FB_FUNC_NAMES+=('build')
# shellcheck disable=SC2034 # shellcheck disable=SC2034
FB_FUNC_DESCS['build']='build ffmpeg with desired configuration' FB_FUNC_DESCS['build']='build ffmpeg with desired configuration'
build() { build() {
test -d "${DL_DIR}" || { mkdir -p "${DL_DIR}" || return 1; }
test -d "${CCACHE_DIR}" || { mkdir -p "${CCACHE_DIR}" || return 1; }
test -d "${BUILD_DIR}" || { mkdir -p "${BUILD_DIR}" || return 1; }
set_compile_opts || return 1 set_compile_opts || return 1
for build in ${ENABLE}; do for build in ${ENABLE}; do
@@ -517,9 +518,11 @@ del_pkgconfig_gcc_s() {
### RUST ### ### RUST ###
cargo_cbuild() { cargo_cbuild() {
cargo cinstall \ cargo cinstall \
--destdir ./local-install \ --destdir "${PWD}/local-install" \
"${CARGO_CINSTALL_FLAGS[@]}" "${CARGO_CINSTALL_FLAGS[@]}"
${SUDO_MODIFY} cp -r ./local-install "${PREFIX}/" # cargo cinstall destdir prepends with entire prefix
cd "./local-install${PREFIX}" || return 1
${SUDO_MODIFY} cp -r ./* "${PREFIX}/"
} }
build_hdr10plus_tool() { build_hdr10plus_tool() {