debian-live-config: copy built ISO by name, not a SCRIPT_DIR glob
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Controller Tests / controller-tests (push) Waiting to run
Jest Tests / jest-tests (push) Waiting to run

The build ended with `mv "${SCRIPT_DIR}"/*.iso "${DEST}"`. A leftover ISO from
a previous build made the glob match two files, so `mv` treated the target as
a directory and failed ("No such file or directory") -- after a successful
37-minute lb build. Take the single ISO out of the freshly-wiped BUILD_DIR via
a nullglob array and copy it to the final name; robust to leftovers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Roland 2026-05-30 20:27:11 -06:00
parent cccbac9ae9
commit dcfad8b4af
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680

View file

@ -134,12 +134,22 @@ set +o pipefail
grep "9999-wrolpi.hook.chroot completed" "${SCRIPT_DIR}/build.log" >/dev/null 2>&1 || (echo "build hook failed!" && exit 1)
cp "${BUILD_DIR}"/*iso "${SCRIPT_DIR}/" || (echo "Build failed. No ISOs were found!" && exit 1)
chmod 644 "${SCRIPT_DIR}"/*iso
chown "${SUDO_UID:-1000}:${SUDO_GID:-1000}" "${SCRIPT_DIR}"/*iso
# Copy the freshly built ISO directly to its final name. Take the single ISO
# out of BUILD_DIR (which is wiped each build, so it holds exactly one) rather
# than globbing SCRIPT_DIR -- a leftover ISO from a previous build would
# otherwise make a `*.iso` glob match multiple files and break the move.
DEST="${SCRIPT_DIR}/WROLPi-v${VERSION}-amd64.iso"
[ -f "${DEST}" ] && (echo "Removing conflicting ISO" && rm "${DEST}")
mv "${SCRIPT_DIR}"/*.iso "${DEST}"
shopt -s nullglob
BUILT_ISOS=("${BUILD_DIR}"/*.iso)
shopt -u nullglob
if [ "${#BUILT_ISOS[@]}" -eq 0 ]; then
echo "Build failed. No ISOs were found!"
exit 1
fi
rm -f "${DEST}"
cp "${BUILT_ISOS[0]}" "${DEST}"
chmod 644 "${DEST}"
chown "${SUDO_UID:-1000}:${SUDO_GID:-1000}" "${DEST}"
# Sanity-check the resulting ISO before declaring success, so a truncated or
# corrupt build never ships.