[Surfraw-commits] [SCM] surfraw - a fast unix command line interface to WWW branch, master, updated. surfraw_2-2-5_1-166-ga929977

Ian Beckwith ianb at erislabs.net
Sun Feb 20 05:17:46 UTC 2011


The following commit has been merged in the master branch:
commit 4d91709cbcdbed6551cb64e7bc34d895e40760f4
Author: Ian Beckwith <ianb at erislabs.net>
Date:   Sun Feb 20 03:45:06 2011 +0000

    new elvi: bugzilla

diff --git a/AUTHORS b/AUTHORS
index 275fb17..d87c769 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -8,8 +8,8 @@ Christian Surchi <csurchi at debian.org>
         elvi: debcontents, debbugs, debpackages
 
 Ian Beckwith <ianb at erislabs.net>
-        elvi: alioth, bbcnews, deblists, freedb, imdb, scpan,
-              port, codesearch, debwiki, lastfm, musicbrainz,
+        elvi: alioth, bbcnews, bugzilla, deblists, freedb, imdb,
+              scpan, codesearch, debwiki, lastfm, musicbrainz,
               opensearch, scholar, ctan, fsfdir, gutenberg, wayback,
               dmoz, w3html, w3link, w3css, w3rdf, debpts, rfc,
               sunonesearch, lsm, finkpkg, rpmsearch, macports,
diff --git a/ChangeLog b/ChangeLog
index fc6f1fd..ed6d707 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2011-02-20  Ian Beckwith  <ianb at erislabs.net>
 
+	* New elvi: bugzilla - searches various bugzillas,
+	  defaults to kernel.
 	* pgpkeys: add more options, support more
 	  keyservers, default to sks-keyservers.net.
 
diff --git a/elvi/Makefile.am b/elvi/Makefile.am
index eb2907d..dac172a 100644
--- a/elvi/Makefile.am
+++ b/elvi/Makefile.am
@@ -16,6 +16,7 @@ dist_elvi_SCRIPTS	= \
 		  bbcnews \
 		  bookfinder \
 		  bugmenot \
+		  bugzilla \
 		  cablesearch \
 		  cia \
 		  cite \
diff --git a/elvi/bugzilla b/elvi/bugzilla
new file mode 100755
index 0000000..d1622c4
--- /dev/null
+++ b/elvi/bugzilla
@@ -0,0 +1,87 @@
+#!/bin/sh
+# elvis: bugzilla	-- Search for bugs on Bugzilla bugtrackers
+. surfraw || exit 1
+
+w3_config_hook () {
+    def   SURFRAW_bugzilla_site     kernel
+    def   SURFRAW_bugzilla_status   open
+    def   SURFRAW_bugzilla_product  all
+}
+
+w3_usage_hook () {
+    cat <<EOF
+Usage: $w3_argv0 [options] [search words]...
+Description:
+  Surfraw search for bugs on Bugzilla bugtrackers
+Local options:
+  -site=URL                     Bugzilla site to search
+                                The site URL can be specified,
+				or the following aliases can be used:
+				  kernel, mozilla, gnome, kde, apache,
+				  freedesktop, eclipse, mandriva,
+				  gentoo, novell
+                                Default: $SURFRAW_bugzilla_site
+                                Environment: SURFRAW_bugzilla_site
+				Examples: bugzilla -s=http://bugs.kde.org ipv6
+				          bugzilla -s=kde ipv6
+  -status=open            |     Bug status
+          closed          |
+	  all
+                                Default: $SURFRAW_bugzilla_status
+                                Environment: SURFRAW_bugzilla_status
+  -product=all            |     Product to search for bugs in.
+           <product name>
+                                Default: $SURFRAW_bugzilla_product
+                                Environment: SURFRAW_bugzilla_product
+EOF
+    w3_global_usage
+}
+
+w3_parse_option_hook () {
+    opt="$1"
+    optarg="$2"
+    case "$opt" in
+    -st*=*)     setopt   SURFRAW_bugzilla_status  "$optarg" ;;
+    -s*=*)      setopt   SURFRAW_bugzilla_site    "$optarg" ;;
+    -p*=*)      setopt	 SURFRAW_bugzilla_product "$(w3_url_of_arg "$optarg")" ;;
+    *) return 1 ;;
+    esac
+    return 0
+}
+
+w3_config
+w3_parse_args "$@"
+# w3_args now contains a list of arguments
+
+if [ "$SURFRAW_bugzilla_product" = all ] ; then
+    setopt SURFRAW_bugzilla_product ""
+fi
+
+case "$SURFRAW_bugzilla_status" in
+    open)   setopt SURFRAW_bugzilla_status "__open__"    ;;
+    closed) setopt SURFRAW_bugzilla_status "__closed__"  ;;
+    all)    setopt SURFRAW_bugzilla_status "__all__"     ;;
+esac
+
+case "$SURFRAW_bugzilla_site" in
+    kernel)      setopt SURFRAW_bugzilla_site "https://bugzilla.kernel.org"         ;;
+    mozilla)     setopt SURFRAW_bugzilla_site "http://bugzilla.mozilla.org"         ;;
+    gnome)       setopt SURFRAW_bugzilla_site "http://bugzilla.gnome.org"           ;;
+    kde)         setopt SURFRAW_bugzilla_site "http://bugs.kde.org"                 ;;
+    apache)      setopt SURFRAW_bugzilla_site "http://issues.apache.org/bugzilla"   ;;
+    freedesktop) setopt SURFRAW_bugzilla_site "http://bugs.freedesktop.org"         ;;
+    eclipse)     setopt SURFRAW_bugzilla_site "http://bugs.eclipse.org/bugs"        ;;
+#    redhat)      setopt SURFRAW_bugzilla_site "http://bugzilla.redhat.com/bugzilla" ;;
+    mandriva)    setopt SURFRAW_bugzilla_site "http://qa.mandriva.com"              ;;
+    gentoo)      setopt SURFRAW_bugzilla_site "http://bugs.gentoo.org"              ;;
+    novell)      setopt SURFRAW_bugzilla_site "https://bugzilla.novell.com"         ;;
+esac
+
+if test -z "$w3_args"; then
+    w3_browse_url "${SURFRAW_bugzilla_site}/query.cgi?format=advanced"
+else
+    escaped_args=`w3_url_of_arg $w3_args`
+    params="quicksearch=${escaped_args}&bug_status=${SURFRAW_bugzilla_status}"
+    params="${params}&product=${SURFRAW_bugzilla_product}"
+    w3_browse_url "${SURFRAW_bugzilla_site}/buglist.cgi?${params}"
+fi
diff --git a/links.IN b/links.IN
index f12e5c2..39a7c5a 100644
--- a/links.IN
+++ b/links.IN
@@ -12,6 +12,7 @@ elvi.1sr.gz @mandir@/man1/bing.1sr.gz
 elvi.1sr.gz @mandir@/man1/bbcnews.1sr.gz
 elvi.1sr.gz @mandir@/man1/bookfinder.1sr.gz
 elvi.1sr.gz @mandir@/man1/bugmenot.1sr.gz
+elvi.1sr.gz @mandir@/man1/bugzilla.1sr.gz
 elvi.1sr.gz @mandir@/man1/cablesearch.1sr.gz
 elvi.1sr.gz @mandir@/man1/cite.1sr.gz
 elvi.1sr.gz @mandir@/man1/cia.1sr.gz
diff --git a/test/Makefile.am b/test/Makefile.am
index 6817c4b..326acdb 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,9 +1,9 @@
 EXTRA_DIST = runtests elviwithouttests README COOKIES W.test		\
 	acronym.test ads.test alioth.test amazon.test archpkg.test	\
 	arxiv.test ask.test aur.test austlii.test bbcnews.test		\
-	bing.test bookfinder.test bugmenot.test cia.test cite.test	\
-	cliki.test cnn.test codesearch.test comlaw.test ctan.test	\
-	currency.test cve.test debbugs.test debcontents.test		\
+	bing.test bookfinder.test bugmenot.test bugzilla.test cia.test	\
+	cite.test cliki.test cnn.test codesearch.test comlaw.test	\
+	ctan.test currency.test cve.test debbugs.test debcontents.test	\
 	deblists.test deblogs.test debpackages.test debpkghome.test	\
 	debpts.test debsec.test debvcsbrowse.test debwiki.test		\
 	deja.test discogs.test dmoz.test duckduckgo.test ebay.test	\
diff --git a/test/bugzilla.test b/test/bugzilla.test
new file mode 100644
index 0000000..b001401
--- /dev/null
+++ b/test/bugzilla.test
@@ -0,0 +1,20 @@
+bugzilla ipv6
+bugs found
+bugzilla -s=mozilla ipv6
+bugs found
+bugzilla -s=gnome ipv6
+bugs found
+bugzilla -s=kde ipv6
+bugs found
+bugzilla -s=apache ipv6
+bugs found
+bugzilla -s=freedesktop ipv6
+bugs found
+bugzilla -s=eclipse delete
+bugs found
+bugzilla -s=mandriva ipv6
+bugs found
+bugzilla -s=gentoo ipv6
+bugs found
+bugzilla -s=novell ipv6
+bugs found

-- 
surfraw -  a fast unix command line interface to WWW



More information about the Surfraw-commits mailing list