Skip to content

Instantly share code, notes, and snippets.

@potch
Created February 1, 2011 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save potch/805181 to your computer and use it in GitHub Desktop.
Save potch/805181 to your computer and use it in GitHub Desktop.
Bugzilla checker (bugzilla.mozilla.org)
MILESTONE='5.12.9'
ASSIGNEDTO='bob@butts.biz'
PRODUCT='addons.mozilla.org'
BUGZILLA='https://bugzilla.mozilla.org/show_bug.cgi?id='
QUERY="https://bugzilla.mozilla.org/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=$ASSIGNEDTO&emailassigned_to1=1&emailtype1=exact&product=$PRODUCT&query_format=advanced&order=Assignee&target_milestone=$MILESTONE&ctype=csv"
#!/bin/sh
source ~/.bz
if [[ $1 == 'all' ]]; then
open $QUERY
else
if [[ $1 == 'nobody' ]]; then
ASSIGNEDTO='nobody@mozilla.org'
QUERY="https://bugzilla.mozilla.org/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=$ASSIGNEDTO&emailassigned_to1=1&emailtype1=exact&product=$PRODUCT&query_format=advanced&order=Assignee&target_milestone=$MILESTONE&ctype=csv"
shift 1
fi
if [[ $1 ]]; then
curl -s $QUERY |
awk -F\, '
{
if (NR-1 == bte)
print bz $1 "#comments"
}' bte=$1 bz=$BUGZILLA |
xargs open -g
else
curl -s $QUERY | wc | echo
echo
curl -s $QUERY |
sed 's/\","/\|/g;s/\"$//g;s/\"\"/"/g;s/\([0-9]\),\"/\1\|/g' |
awk -F\| '
{
sp = " "
if (NR>10)
sp = " "
if (NR > 1)
print NR-1 ")" sp , $1, " ", $3 ," ", $8
}'
echo
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment