Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/generate-bug-report
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-09-05 09:53:00 +0200
committerErich Eckner <git@eckner.net>2018-09-05 09:53:10 +0200
commite844ea5217c1794a7a4e64dddb9c3216a818808f (patch)
tree548c70db95ef1899f4ecf77e3fe6380eac6ab427 /generate-bug-report
parent6dc5a6cefea52cb0dfbb88c75e308b96dcb8032e (diff)
generate-bug-report new
Diffstat (limited to 'generate-bug-report')
-rwxr-xr-xgenerate-bug-report52
1 files changed, 52 insertions, 0 deletions
diff --git a/generate-bug-report b/generate-bug-report
new file mode 100755
index 0000000..c47c8ab
--- /dev/null
+++ b/generate-bug-report
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+git pull --ff-only
+
+if ! diff -u PKGBUILD ../../trunk/PKGBUILD; then
+ >&2 echo "trunk differs - say something and I won't create a bug report."
+ read -r s
+ if [ -n "$s" ]; then
+ exit
+ fi
+fi
+
+if makepkg --verifysource; then
+ >&2 echo 'nothing wrong upstream.'
+ exit
+fi
+
+makepkg_info=$(
+ makepkg --verifysource 2>&1
+)
+git_revision=$(
+ git rev-parse HEAD
+)
+
+printf 'Bug report:\n\n'
+printf 'Description:\n\n'
+printf '%s\n' \
+ "${makepkg_info}"
+printf 'Additional info:\n'
+printf '* package version(s)\n'
+printf '%s\n' \
+ "${makepkg_info}" | \
+ sed -n '
+ s/^==> Making package: \(\S\+ \S\+\) (.*$/\1/
+ T
+ p
+ ' | \
+ tr -d '\n'
+printf ' (git revision %s)\n' \
+ "${git_revision}"
+printf '\n'
+printf 'Steps to reproduce:\n'
+printf '> git checkout %s\n' \
+ "${git_revision}"
+printf '> cd %s\n' \
+ "$(
+ pwd | \
+ sed '
+ s,^.*/\([^/]\+/repos/[^/]\+\)$,\1,
+ '
+ )"
+printf '> makepkg --verifysource\n'