[Pkg-libvirt-commits] [libguestfs] 04/40: Fix update-bugs.sh script so it doesn't write an empty BUGS file.

Hilko Bengen bengen at moszumanska.debian.org
Fri Oct 3 14:49:11 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag debian/1%1.27.57-1
in repository libguestfs.

commit 4c1ca9f880a55f1016114c4b4f607b4cedbaa2b1
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Fri Sep 26 20:09:44 2014 +0100

    Fix update-bugs.sh script so it doesn't write an empty BUGS file.
---
 update-bugs.sh | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/update-bugs.sh b/update-bugs.sh
index dcb0c83..f82142b 100755
--- a/update-bugs.sh
+++ b/update-bugs.sh
@@ -23,9 +23,10 @@
 # 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}' |
-  perl -e '
+bugzilla --nosslverify query -c libguestfs \
+  --outputformat='%{bug_id} %{bug_status} %{short_desc}' > .bugs.tmp || exit 0
+
+perl -e '
     sub bugclass {
       local $_ = shift;
       return 1 if /NEW/;
@@ -44,11 +45,15 @@ bugzilla query -c libguestfs \
     while (<>) {
       /^(\d+) (\w+) (.*)/; push @bugs, [bugclass($2), $1, $2, $3];
     }
+    # No bugs?  Fail.
+    print STDERR "#bugs = ", 0+ at bugs;
+    if (0+ at bugs == 0) {
+        die "failed to get list of bugs\n"
+    }
     foreach (sort compare @bugs) {
       print $_->[1], " ", $_->[2], " ", $_->[3], "\n";
     }
-' \
-> .bugs.tmp || exit 0
+' < .bugs.tmp > .bugs.tmp2 || exit 0
 
 # Any errors from now on are fatal.
 set -e
@@ -119,7 +124,7 @@ while read bugno status summary; do
     echo "$bugno $status https://bugzilla.redhat.com/show_bug.cgi?id=$bugno"
     echo "  $summary"
     echo
-done < .bugs.tmp
+done < .bugs.tmp2
 
 if [ $count -ge 1 ]; then
     echo "($count bugs)"
@@ -127,5 +132,5 @@ if [ $count -ge 1 ]; then
 fi
 echo "End of BUGS file."
 
-# Clean up temporary file.
-rm .bugs.tmp
+# Clean up temporary files.
+rm .bugs.tmp .bugs.tmp2

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list