summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/build-packages29
1 files changed, 25 insertions, 4 deletions
diff --git a/bin/build-packages b/bin/build-packages
index 479f5e6..9ae9891 100755
--- a/bin/build-packages
+++ b/bin/build-packages
@@ -606,15 +606,36 @@ while [ "${count}" -ne 0 ] && \
"${repository}" \
"${straw}" \
"${arch}"
+ log_file="${tmp_dir}/$(
+ date -u --iso-8601=seconds | \
+ cut -d+ -f1
+ ).build-log"
# by piping the log, we don't see anything in the terminal,
# but all ways to duplicate the logs seem pretty elaborate
# shellcheck disable=SC2024,SC2086
if ! "${build_command}" ${outerParameters} -- ${middleParameters} -- ${innerParameters} > \
- "$(
- date -u --iso-8601=seconds | \
- cut -d+ -f1
- ).build-log" 2>&1; then
+ "${log_file}" 2>&1; then
success=false
+ build_dir="/var/lib/archbuild/${build_command%-build}/$(whoami)"
+ if [ -d "${build_dir}" ]; then
+ sed '
+ s/^Full log written to\s\+\(\S\+\)\s*$/\1/
+ t
+ /# An error report file with more information is saved as:/ {
+ N
+ s/^.*\n#\s\+//
+ t
+ d
+ }
+ s/^See also "\(\S\+\)"\.\s*$/\1/
+ t
+ d
+ ' "${log_file}" | \
+ while read -r extra_log_file; do
+ grep -HF '' "${build_dir}/${extra_log_file}" || true
+ done | \
+ sponge -a "${log_file}"
+ fi
fi
fi