From b4ad22038626a97e4c0e9202a97bce5793cf8000 Mon Sep 17 00:00:00 2001 From: Egor Tsyganchuk Date: Mon, 30 Mar 2026 20:01:11 +0300 Subject: [PATCH] Refactor build-toolchain.sh to improve toolchain archiving process - Created a dedicated directory for the target toolchain within the temporary working directory. - Copied the environment script to the working directory for inclusion in the archive. - Updated the tar command to include the target directory and environment script in the final archive, enhancing organization and clarity. --- build-toolchain.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/build-toolchain.sh b/build-toolchain.sh index 2abfc5b..074ce7b 100755 --- a/build-toolchain.sh +++ b/build-toolchain.sh @@ -217,10 +217,14 @@ cd "${TOP}" WDIR=$(mktemp -d) trap 'rm -rf "$WDIR"' EXIT -cp -a "${INSTALL_DIR}"/* "$WDIR"/ -find "$WDIR" -type f -executable -exec strip -p {} \; 2>/dev/null || true +ARCHIVE_TOOLCHAIN_DIR="${WDIR}/${TARGET}" +mkdir -p "${ARCHIVE_TOOLCHAIN_DIR}" +cp -a "${INSTALL_DIR}"/* "${ARCHIVE_TOOLCHAIN_DIR}/" +cp -a "${TOP}/env.sh" "${WDIR}/env.sh" -tar -C "$WDIR" --owner=0 --group=0 -cJf "toolset-jlv-${SUBARCH}-gcc${GCC_VER}-uclibc${UCLIBC_VER}.tar.xz" . +find "${ARCHIVE_TOOLCHAIN_DIR}" -type f -executable -exec strip -p {} \; 2>/dev/null || true + +tar -C "$WDIR" --owner=0 --group=0 -cJf "toolset-jlv-${SUBARCH}-gcc${GCC_VER}-uclibc${UCLIBC_VER}.tar.xz" "${TARGET}" "env.sh" echo "Готово: toolset-jlv-${SUBARCH}-gcc${GCC_VER}-uclibc${UCLIBC_VER}.tar.xz" # ==================================================================