New mklog script

Jonathan Wakely jwakely.gcc@gmail.com
Tue May 19 21:50:40 GMT 2020


On Tue, 19 May 2020 at 17:13, Joseph Myers wrote:
>
> On Tue, 19 May 2020, Martin Liška wrote:
>
> > On 5/19/20 10:11 AM, Martin Liška wrote:
> > > Can you please share how do you do it? It would be easy to add it.
> >
> > I added the feature via --fill-up-bug-titles option. It uses common
> > request and beatifulsoup packages.
>
> The REST interface is much better to use for extracting bug data than
> screen scraping of HTML output.  Fetch e.g.
> https://gcc.gnu.org/bugzilla/rest.cgi/bug?id=12345&include_fields=summary
> to get JSON bug data (change or omit include_fields if you want more than
> just the summary).

REST+JSON is probably better for the mklog.py script, but in case this
is useful to anybody else, I get bugzilla info by fetching the XML for
a bug using the URL
https://gcc.gnu.org/bugzilla/show_bug.cgi?ctype=xml&id=NNNN and
applying this stylesheet:

    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
    <xsl:output method="text"/>
    <xsl:template match="/">
      <xsl:apply-templates select="/bugzilla/bug/short_desc"/>
      <xsl:text> </xsl:text>
      <xsl:apply-templates select="/bugzilla/bug/bug_status"/>
      <xsl:text> </xsl:text>
      <xsl:apply-templates select="/bugzilla/bug/resolution"/>
      <xsl:text>
    </xsl:text>
    </xsl:template>
    </xsl:stylesheet>


More information about the Gcc-patches mailing list