mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
debian-live-config: copy built ISO by name, not a SCRIPT_DIR glob
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:
parent
cccbac9ae9
commit
dcfad8b4af
1 changed files with 15 additions and 5 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue