summaryrefslogtreecommitdiffstats
path: root/update-bugs.sh
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-06-07 09:18:12 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-06-07 09:21:23 +0100
commitf90c01a5dc6a01284debdd0a45406f9d4a5e7159 (patch)
treef811c7c572487d4f052699e00dfe4fc304ed4d46 /update-bugs.sh
parent4e5d3b06fb2f366c0010ae6aa15f9dee74261917 (diff)
downloadlibguestfs-f90c01a5dc6a01284debdd0a45406f9d4a5e7159.tar.gz
libguestfs-f90c01a5dc6a01284debdd0a45406f9d4a5e7159.tar.xz
libguestfs-f90c01a5dc6a01284debdd0a45406f9d4a5e7159.zip
Enhance BUGS script.
Since RHBZ was updated, the old python-bugzilla program broke. When it was fixed, I found the (undocumented) ordering of the results from the old tool was no longer true. This commit adds a small Perl script to sort the output predictably. Now bugs are sorted by both bug state and bug number, so the output should be more stable than before. Re-enable creation of the BUGS file in 'make dist' (this reverts commit 91f3456244e7843768da659e24ce0aeeb4ebe4b0). Also the BUGS file has been updated.
Diffstat (limited to 'update-bugs.sh')
-rwxr-xr-xupdate-bugs.sh29
1 files changed, 27 insertions, 2 deletions
diff --git a/update-bugs.sh b/update-bugs.sh
index 4eece23d..cc20d0bb 100755
--- a/update-bugs.sh
+++ b/update-bugs.sh
@@ -23,7 +23,32 @@
# eg. if there is no net access or no 'bugzilla' program, but if that
# happens just exit and leave the BUGS file alone.
-bugzilla query -c libguestfs --outputformat='%{bug_id} %{bug_status} %{short_desc}' > .bugs.tmp || exit 0
+bugzilla query -c libguestfs \
+ --outputformat='%{bug_id} %{bug_status} %{short_desc}' |
+ perl -e '
+ sub bugclass {
+ local $_ = shift;
+ return 1 if /NEW/;
+ return 2 if /ASSIGNED/;
+ return 3 if /ON_DEV/;
+ return 4 if /POST/;
+ return 5 if /MODIFIED/;
+ return 6 if /ON_QA/;
+ return 7 if /VERIFIED/;
+ return 8 if /RELEASE_PENDING/;
+ return 9 #if /CLOSED/;
+ }
+ sub compare {
+ $a->[0] <=> $b->[0] || $a->[1] <=> $b->[1]
+ }
+ while (<>) {
+ /^(\d+) (\w+) (.*)/; push @bugs, [bugclass($2), $1, $2, $3];
+ }
+ foreach (sort compare @bugs) {
+ print $_->[1], " ", $_->[2], " ", $_->[3], "\n";
+ }
+' \
+> .bugs.tmp || exit 0
# Any errors from now on are fatal.
set -e
@@ -63,7 +88,7 @@ while read bugno status summary; do
*) bugclass=$status ;;
esac
- # 'bugzilla' command returns the bugs sorted by status, NEW, ASSIGNED,
+ # perl sort returns the bugs sorted by status, NEW, ASSIGNED,
# MODIFIED, ..., CLOSED. Therefore start a new section when the
# status field changes.
if [ "$bugclass" != "$lastclass" ]; then