A better way to search the bug database



--Boundary_(ID_QX0t/grEYtSKVMOEeQfREA)
Content-type: text/plain
Content-transfer-encoding: 7BIT

I have become quite frustrated with the lack of searching abilities in
the Sourceforge bug database and I know there are other developers who
feel the same. During the past couple of days I finally did something
about it. I wrote a script to assist general queries of the Sourceforge
database in the xml-export format. The script itself is ~200 lines of
Python code. It can perform arbitrarily complicated queries. The
documentation is still rudimentary, but there are several useful
examples. I have attached it to the end of this message.

I need advice on what to do with this script. I could

1) Keep it to myself.

2) Mail it and occasional copies of the xml-exported database to a few
interested developers. The database is currently 788K (180K gzipped.)

3) Post it on the Maxima web site and write a cron job to make the xml
database downloadable through the web site on a regular basis.

4) Convince someone here to write a cgi script to allow queries through
the web site. (Hint, hint...)

5) Make it a Sourceforge project itself. I think such a script is
generally useful. I searched to see if anyone had written such a thing
before I started.

Please let me know what you think. Just ask if you want the script
itself.

--Jim


--Boundary_(ID_QX0t/grEYtSKVMOEeQfREA)
Content-type: text/plain; name=sfquery-docs.txt; charset=ANSI_X3.4-1968
Content-transfer-encoding: 7BIT
Content-disposition: attachment; filename=sfquery-docs.txt

Command-line usage:

sfquery.py <filename> <query> <action>
    <filename> is an XML dump of a SourceForge bug database.
    <query> is a python command evaluating to 1 or 0.
    <action> is a python command or commands to perform on each matched
             object. Multiple command should be separated by the ';'
             character.

To search for field foo=bar, use the following query:
 "artifact.get('foo') == 'bar'"

To search all field values for the string 'foobar', use the following query:
 "contains(artifact,'foobar')"

The function "contains" will accept a regular expression as well as a
plain string.

The most common actions are
 "artifact.print_summary()"
and
 "artifact.print_all()"

===============================================================
Examples:

Find all the bugs submitted by amundson and print summaries:

./sfquery.py bugs-10-02-2003.xml\
 "artifact.get('submitted_by') == 'amundson'"\
 "artifact.print_summary()"

gives:

Total number of artifacts = 447
545221 : xmaxima calls "kill -1"
625439 : xmaxima can call "kill -1"
624940 : xmaxima-local is broken
566870 : plotting programs not found
549185 : Bugs were not copied to the mailing list
566883 : make distclean broken
552045 : strcat missing in mactex.lisp
624941 : maxima needs a -quiet option
545219 : configure does not accept full paths
596204 : Compiler warnings
571254 : subdirectories of share are not searched
566871 : files not installed
689792 : omplotdata and mgnuplot do not honor --with-wish
596202 : AUTHORS and ChangeLog are empty
530419 : zsolve exists only in documentation
573689 : genut package
689320 : patch for openmcl support
573692 : solver package
689794 : tests/Makefile.in uses ${INSTALL_PROGRAM} to install summari
689795 : texinfo fixes
Found 20 matches.

------------------------------------------------------------------
Find all the *open* bugs submitted by amundson and print summaries:

./sfquery.py bugs-10-02-2003.xml\
 "artifact.get('submitted_by')=='amundson' and artifact.get('status')=='Open'"\
 "artifact.print_summary()"

gives:

Total number of artifacts = 447
624941 : maxima needs a -quiet option
596204 : Compiler warnings
689792 : omplotdata and mgnuplot do not honor --with-wish
573689 : genut package
573692 : solver package
689794 : tests/Makefile.in uses ${INSTALL_PROGRAM} to install summari
689795 : texinfo fixes
Found 7 matches.

------------------------------------------------------------------
Find a specific bug and print the full record:

./sfquery.py bugs-10-02-2003.xml\
 "artifact.get('artifact_id') == '596204'"\
 "artifact.print_all()"

gives:


Total number of artifacts = 447
 ==================== artifact ====================
status : Open
submitted_by : amundson
artifact_id : 596204
artifact_group_id : None
summary : Compiler warnings
priority : 5
details :
-------------------------------------------------
The Maxima build generates many compiler warnings for
alll lisps. They should be eliminated if at all possible.


-------------------------------------------------
assigned_to : nobody
artifact_type : Bugs
open_date : Fri Aug 16 18:34:06 2002
category : None
resolution : None
 ----------- histories -----------
 ----------- messages -----------
 --------------------------------
 =================================================
Found 1 matches.

------------------------------------------------------------------
Find all bugs containing plot and print who submitted them and their status:

./sfquery.py bugs-10-02-2003.xml\
 "contains(artifact,'plot')"\
 "sys.stdout.write('%s\n' % artifact.get('submitted_by'));sys.stdout.write('%s\n\n' % artifact.get('status'))"

--Boundary_(ID_QX0t/grEYtSKVMOEeQfREA)--