summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-07-03 10:12:15 +0200
committerErich Eckner <git@eckner.net>2019-07-03 10:12:15 +0200
commit3181e6826afaab3ebc8c4df2b6bc61bb73a9c73b (patch)
tree61efa33701338d2de635fc88c4b1ab58d0fe078d
parent3741a72e9659918ad1c546ff9d61ce74bef2b611 (diff)
downloadbuilder-3181e6826afaab3ebc8c4df2b6bc61bb73a9c73b.tar.xz
bin/build-packages: store name of log file in variable. After build failure, search inside log file for reference to other log files and append them to the log (which gets uploaded)
-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