index : devops | |
Archlinux32 devs' convenience-scripts | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2018-10-16 14:46:52 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-10-16 14:46:52 +0200 |
commit | a49695c92c84a56696b659517c8ca9c6a1a7bf33 (patch) | |
tree | 7bee2c001c6d2490892413ed6ce528a43a92130c /generate-bug-report | |
parent | 454b3c77da0f75edf73ca3259e8a144bf0b732b7 (diff) |
-rwxr-xr-x | generate-bug-report | 59 |
diff --git a/generate-bug-report b/generate-bug-report index f388a13..4ad845e 100755 --- a/generate-bug-report +++ b/generate-bug-report @@ -10,23 +10,55 @@ if ! diff -u PKGBUILD ../../trunk/PKGBUILD; then fi fi -if makepkg --verifysource; then - >&2 echo 'nothing wrong upstream.' - exit +if ! git archive HEAD -- PKGBUILD | tar -Ox | diff -u --color - PKGBUILD; then + >&2 echo "PKGBUILD differs from git - say something and I won't create a bug report." + read -r s + if [ -n "$s" ]; then + exit + fi fi -makepkg_info=$( - makepkg --verifysource 2>&1 -) git_revision=$( git rev-parse HEAD ) +if ! makepkg_info=$(makepkg --verifysource 2>&1); then + bug_report=$( + makepkg --verifysource 2>&1 + ) + fail_command='makepkg --verifysource' +else + >&2 echo 'Nothing wrong with upstream'"'"'s source - should I try to build? (empty="yes")' + read -r s + if [ -n "$s" ]; then + exit + fi + { + extra-x86_64-build 2>&1 + echo $? + } | \ + tee log.x86_64 + error=$( + sed -i ' + $ { + w /dev/stdout + d + } + ' log.x86_64 + ) + if [ "${error}" = '0' ]; then + >&2 echo 'Builds fine on x86_64.' + exit + fi + bug_report='extra-x86_64 fails with:' + fail_command='extra-x86_64-build' + log='full log is attached' + log_file=$(readlink -f 'log.x86_64') +fi + printf 'Bug report:\n\n' printf 'Description:\n\n' -printf '%s\n' \ - "${makepkg_info}" -printf '\n' +printf '%s\n' "${bug_report}" printf 'Additional info:\n' printf '* package version(s)\n' printf '%s\n' \ @@ -39,6 +71,10 @@ printf '%s\n' \ tr -d '\n' printf ' (git revision %s)\n' \ "${git_revision}" +if [ -n "${log}" ]; then + printf '* config and/or log files etc.\n' + printf '%s\n' "${log}" +fi printf '\n' printf 'Steps to reproduce:\n' printf '> git checkout %s\n' \ @@ -50,4 +86,7 @@ printf '> cd %s\n' \ s,^.*/\([^/]\+/repos/[^/]\+\)$,\1, ' )" -printf '> makepkg --verifysource\n' +printf '> %s\n' "${fail_command}" +if [ -n "${log_file}" ]; then + printf '\nupload: %s\n' "${log_file}" +fi |