Improve build script error handling and logging

- Added better logging for apt-get download command
- Create separate build_retry.log for retry attempts
- Improved error messages and log file management
- Better tracking of build process and ISO file detection
parent 570ff853
...@@ -46,16 +46,16 @@ else ...@@ -46,16 +46,16 @@ else
# Check if the error is about missing devuan-keyring # Check if the error is about missing devuan-keyring
if grep -q "Couldn't find these debs: devuan-keyring" build.log; then if grep -q "Couldn't find these debs: devuan-keyring" build.log; then
echo "Detected missing devuan-keyring. Downloading locally..." echo "Detected missing devuan-keyring. Downloading locally..."
if apt-get download devuan-keyring; then if apt-get download devuan-keyring 2>&1 | tee -a build.log; then
echo "devuan-keyring downloaded successfully. Retrying build..." echo "devuan-keyring downloaded successfully. Retrying build..."
rm -f build.log rm -f build.log
lb build lb build 2>&1 | tee build_retry.log
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "Build completed successfully!" echo "Build completed successfully!"
echo "ISO file: $(ls live-image-amd64.iso 2>/dev/null || ls *.iso 2>/dev/null || echo 'Not found')" echo "ISO file: $(ls live-image-amd64.iso 2>/dev/null || ls *.iso 2>/dev/null || echo 'Not found')"
exit 0 exit 0
else else
echo "Build failed again. Check the output above for errors." echo "Build failed again. Check build_retry.log for errors."
exit 1 exit 1
fi fi
else else
...@@ -63,7 +63,7 @@ else ...@@ -63,7 +63,7 @@ else
exit 1 exit 1
fi fi
else else
echo "Build failed. Check the output above for errors." echo "Build failed. Check build.log for errors."
exit 1 exit 1
fi fi
fi fi
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment