diff options
author | randomdan <randomdan@localhost> | 2011-02-03 16:02:05 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2011-02-03 16:02:05 +0000 |
commit | ccf834ac888e74f5e46d0ae5bd602a1eb00e8c7d (patch) | |
tree | a0d44de05c5469ce6a4cc0134f4accaa10143a02 | |
parent | Fix sendmail task to contain the to parameter (diff) | |
download | gentoobrowse-ccf834ac888e74f5e46d0ae5bd602a1eb00e8c7d.tar.bz2 gentoobrowse-ccf834ac888e74f5e46d0ae5bd602a1eb00e8c7d.tar.xz gentoobrowse-ccf834ac888e74f5e46d0ae5bd602a1eb00e8c7d.zip |
Use xsl rows for getting bug data
-rw-r--r-- | gentoobrowse/console/bug.urls | 4 | ||||
-rw-r--r-- | gentoobrowse/console/bugimport.xml | 30 | ||||
-rw-r--r-- | gentoobrowse/console/bugs.xslt | 14 |
3 files changed, 22 insertions, 26 deletions
diff --git a/gentoobrowse/console/bug.urls b/gentoobrowse/console/bug.urls new file mode 100644 index 0000000..e010635 --- /dev/null +++ b/gentoobrowse/console/bug.urls @@ -0,0 +1,4 @@ +http://bugs.gentoo.org/data/cached/buglist-UNCONFIRMED.htmlgz +http://bugs.gentoo.org/data/cached/buglist-ASSIGNED.htmlgz +http://bugs.gentoo.org/data/cached/buglist-REOPENED.htmlgz +http://bugs.gentoo.org/data/cached/buglist-NEW.htmlgz diff --git a/gentoobrowse/console/bugimport.xml b/gentoobrowse/console/bugimport.xml index 738a62f..2b1bb4f 100644 --- a/gentoobrowse/console/bugimport.xml +++ b/gentoobrowse/console/bugimport.xml @@ -2,19 +2,25 @@ <bugimport name="bugimport" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:project2="http://project2.randomdan.homeip.net"> <xi:include href="../datasources/postgres.xml" /> - <project2:procrows name="bugsourceUnc" newline=" " encoding="utf-8" fieldSep="," quoteChar=""" - path="xsltproc -novalid console/bugs.xslt http://bugs.gentoo.org/data/cached/buglist-UNCONFIRMED.htmlgz" /> - <project2:procrows name="bugsourceAss" newline=" " encoding="utf-8" fieldSep="," quoteChar=""" - path="xsltproc -novalid console/bugs.xslt http://bugs.gentoo.org/data/cached/buglist-ASSIGNED.htmlgz" /> - <project2:procrows name="bugsourceROp" newline=" " encoding="utf-8" fieldSep="," quoteChar=""" - path="xsltproc -novalid console/bugs.xslt http://bugs.gentoo.org/data/cached/buglist-REOPENED.htmlgz" /> - <project2:procrows name="bugsourceNew" newline=" " encoding="utf-8" fieldSep="," quoteChar=""" - path="xsltproc -novalid console/bugs.xslt http://bugs.gentoo.org/data/cached/buglist-NEW.htmlgz" /> + <project2:filerows name="bugurls" newline=" " encoding="ascii" fieldSep="" quoteChar="" path="console/bug.urls"> + <columns> + <column>url</column> + </columns> + </project2:filerows> + <project2:xslrows name="buglist" html="true" warnings="false"> + <url source="parent" name="url" depth="1" /> + <filterview name="bugdetails" root="/html/body/div/ul/li/a"> + <field name="bugid" xpath="substring-before(substring-after(.,'Bug:'),' ')" /> + <field name="summary" xpath="em" /> + <field name="status" xpath="substring-before(substring-after(.,'status:'),' ')" /> + <field name="severity" xpath="substring-after(.,'severity:')" /> + </filterview> + </project2:xslrows> + <project2:sqlmerge name="bugimport" datasource="postgres" targettable="bugs"> - <project2:iterate name="Unc" source="bugsourceUnc" /> - <project2:iterate name="Ass" source="bugsourceAss" /> - <project2:iterate name="ROp" source="bugsourceROp" /> - <project2:iterate name="New" source="bugsourceNew" /> + <project2:iterate name="eachurl" source="bugurls"> + <project2:iterate name="eachbug" source="buglist" filter="bugdetails" /> + </project2:iterate> <columns> <column key="true">bugid</column> <column>severity</column> diff --git a/gentoobrowse/console/bugs.xslt b/gentoobrowse/console/bugs.xslt deleted file mode 100644 index a084a78..0000000 --- a/gentoobrowse/console/bugs.xslt +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:x="http://www.w3.org/1999/xhtml" -xmlns:str="http://exslt.org/strings" extension-element-prefixes="str"> -<xsl:output encoding="utf-8" method="text" media-type="text/csv" indent="no"/> -<xsl:template match="/x:html">bug_id,summary,status,severity -<xsl:apply-templates select="/x:html/x:body/x:div/x:ul/x:li/x:a" /> -</xsl:template> -<xsl:template match="x:li/x:a"> -<xsl:value-of select="substring-before(substring-after(.,'Bug:'),' ')" />,"<xsl:value-of select="str:replace(x:em,'"','""')" />",<xsl:value-of select="substring-before(substring-after(.,'status:'),' ')" />,<xsl:value-of select="substring-after(.,'severity:')" /> -<xsl:text> -</xsl:text> -</xsl:template> -</xsl:stylesheet> - |