diff --git a/bin/bugzilla_mesa.sh b/bin/bugzilla_mesa.sh
index 49b9ce9c758..a8f5305844b 100755
--- a/bin/bugzilla_mesa.sh
+++ b/bin/bugzilla_mesa.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# This script is used to generate the list of fixed bugs that
# appears in the release notes files, with HTML formatting.
@@ -11,8 +11,6 @@
# $ bin/bugzilla_mesa.sh mesa-9.0.2..mesa-9.0.3
# $ bin/bugzilla_mesa.sh mesa-9.0.2..mesa-9.0.3 > bugfixes
# $ bin/bugzilla_mesa.sh mesa-9.0.2..mesa-9.0.3 | tee bugfixes
-# $ DRYRUN=yes bin/bugzilla_mesa.sh mesa-9.0.2..mesa-9.0.3
-# $ DRYRUN=yes bin/bugzilla_mesa.sh mesa-9.0.2..mesa-9.0.3 | wc -l
# regex pattern: trim before bug number
@@ -21,29 +19,17 @@ trim_before='s/.*show_bug.cgi?id=\([0-9]*\).*/\1/'
# regex pattern: reconstruct the url
use_after='s,^,https://bugs.freedesktop.org/show_bug.cgi?id=,'
+echo "
"
+echo ""
+
# extract fdo urls from commit log
-urls=$(git log $* | grep 'bugs.freedesktop.org/show_bug' | sed -e $trim_before | sort -n -u | sed -e $use_after)
-
-# if DRYRUN is set to "yes", simply print the URLs and don't fetch the
-# details from fdo bugzilla.
-#DRYRUN=yes
-
-if [ "x$DRYRUN" = xyes ]; then
- for i in $urls
- do
- echo $i
- done
-else
- echo ""
+git log $* | grep 'bugs.freedesktop.org/show_bug' | sed -e $trim_before | sort -n -u | sed -e $use_after |\
+while read url
+do
+ id=$(echo $url | cut -d'=' -f2)
+ summary=$(wget --quiet -O - $url | grep -e '.*' | sed -e 's/ *[0-9]\+ – \(.*\)<\/title>/\1/')
+ echo "- Bug $id - $summary
"
echo ""
+done
- for i in $urls
- do
- id=$(echo $i | cut -d'=' -f2)
- summary=$(wget --quiet -O - $i | grep -e '.*' | sed -e 's/ *[0-9]\+ – \(.*\)<\/title>/\1/')
- echo "- Bug $id - $summary
"
- echo ""
- done
-
- echo "
"
-fi
+echo "
"