diff options
-rw-r--r-- | gentoobrowse/base.xslt | 2 | ||||
-rw-r--r-- | gentoobrowse/categories.xslt | 10 | ||||
-rw-r--r-- | gentoobrowse/category.xslt | 8 | ||||
-rw-r--r-- | gentoobrowse/console/categorymetadata.xml | 37 | ||||
-rw-r--r-- | gentoobrowse/console/fileimport.xml | 1 | ||||
-rw-r--r-- | gentoobrowse/console/packageimport.xml | 2 | ||||
-rw-r--r-- | gentoobrowse/console/packagemetadata.xml | 44 | ||||
-rw-r--r-- | gentoobrowse/herd.xslt | 23 | ||||
-rw-r--r-- | gentoobrowse/home.xslt | 4 | ||||
-rw-r--r-- | gentoobrowse/package.xslt | 27 | ||||
-rw-r--r-- | gentoobrowse/popular.xslt | 7 | ||||
-rw-r--r-- | gentoobrowse/present/herd.xml | 11 | ||||
-rw-r--r-- | gentoobrowse/views/categories.xml | 2 | ||||
-rw-r--r-- | gentoobrowse/views/package.xml | 3 | ||||
-rw-r--r-- | gentoobrowse/views/search.xml | 13 |
15 files changed, 162 insertions, 32 deletions
diff --git a/gentoobrowse/base.xslt b/gentoobrowse/base.xslt index 357fd9d..1d4b254 100644 --- a/gentoobrowse/base.xslt +++ b/gentoobrowse/base.xslt @@ -9,6 +9,8 @@ <head> <link rel="stylesheet" href="/style.css" type="text/css" /> <link rel="shortcut icon" href="/images/glogo-small.png" type="image/png" /> + <link rel="start" href="/" /> + <link rel="search" href="/search" /> <meta http-equiv="content-language" content="en" /> <xsl:call-template name="head" /> <script type="text/javascript"> diff --git a/gentoobrowse/categories.xslt b/gentoobrowse/categories.xslt index 6987131..95ebd9e 100644 --- a/gentoobrowse/categories.xslt +++ b/gentoobrowse/categories.xslt @@ -7,7 +7,7 @@ doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" /> <xsl:template name="head"> <title>Category List - Gentoo Browse</title> - <meta name="description" content="Complete list of Gentoo package categories" /> + <meta name="description" content="Complete list of Gentoo Linux package categories" /> </xsl:template> <xsl:template name="content"> <xsl:apply-templates select="/gentoo/categories" /> @@ -21,12 +21,12 @@ <xsl:template match="/gentoo/categories/category"> <li> <a> - <xsl:attribute name="href"> - /category/<xsl:value-of select="catname" /> - </xsl:attribute> + <xsl:attribute name="href">/category/<xsl:value-of select="catname" /></xsl:attribute> <xsl:value-of select="catname" /> </a> - (<xsl:value-of select="packages" />) + - + <xsl:value-of select="summary" /> + (<xsl:value-of select="packages" /> packages) </li> </xsl:template> </xsl:stylesheet> diff --git a/gentoobrowse/category.xslt b/gentoobrowse/category.xslt index 5579ae2..e6fd355 100644 --- a/gentoobrowse/category.xslt +++ b/gentoobrowse/category.xslt @@ -8,13 +8,9 @@ <xsl:template name="head"> <title><xsl:value-of select="/gentoo/project2:uriElems/project2:uriElem[2]" /> Package List - Gentoo Browse</title> <meta name="description"> - <xsl:attribute name="content">Complete list of Gentoo packages in the <xsl:value-of select="/gentoo/project2:uriElems/project2:uriElem[2]" /> category</xsl:attribute> - </meta> - <meta name="keywords"> - <xsl:attribute name="content"> - <xsl:for-each select="/gentoo/packages/package/pkgname"><xsl:value-of select="." />, </xsl:for-each> - </xsl:attribute> + <xsl:attribute name="content">Complete list of Gentoo Linux packages in the <xsl:value-of select="/gentoo/project2:uriElems/project2:uriElem[2]" /> category</xsl:attribute> </meta> + <link rel="contents" href="/categories" /> </xsl:template> <xsl:template name="content"> <xsl:apply-templates select="/gentoo/packages" /> diff --git a/gentoobrowse/console/categorymetadata.xml b/gentoobrowse/console/categorymetadata.xml new file mode 100644 index 0000000..2cec791 --- /dev/null +++ b/gentoobrowse/console/categorymetadata.xml @@ -0,0 +1,37 @@ +<?xml version="1.0"?> +<homepages name="bugimport" xmlns:xi="http://www.w3.org/2001/XInclude" + xmlns:project2="http://project2.randomdan.homeip.net"> + <project2:sqlrows name="blanksummaries" datasource="postgres"> + <sql> + SELECT c.categoryid, 'file://' || ft.searchroot || f.filename AS path, f.moddate + FROM categories c, files f, filetypes ft + WHERE (c.metadatadate IS NULL OR c.metadatadate != f.moddate) + AND f.filename = c.name || '/metadata.xml' + AND f.filetypeid = ft.filetypeid + AND ft.filetypeid = 4 + </sql> + </project2:sqlrows> + <project2:xslrows name="cat" html="false" warnings="true"> + <url source="parent" name="path" depth="1" /> + <filterview name="catmetadata" root="/catmetadata"> + <field name="longdesc" xpath="longdescription[@lang='en']" /> + </filterview> + </project2:xslrows> + <project2:iterate name="eachcat" source="blanksummaries"> + <project2:iterate name="catdetail" source="cat" filter="catmetadata"> + <project2:sqltask name="update" datasource="postgres"> + <sql> + UPDATE categories SET + summary = ?, + metadatadate = ? + WHERE categoryid = ? + </sql> + <parameters> + <param name="0"><value source="parent" name="longdesc" depth="1" /></param> + <param name="1"><value source="parent" name="moddate" depth="2" /></param> + <param name="2"><value source="parent" name="categoryid" depth="2" /></param> + </parameters> + </project2:sqltask> + </project2:iterate> + </project2:iterate> +</homepages> diff --git a/gentoobrowse/console/fileimport.xml b/gentoobrowse/console/fileimport.xml index 6be8298..1a422ab 100644 --- a/gentoobrowse/console/fileimport.xml +++ b/gentoobrowse/console/fileimport.xml @@ -39,6 +39,7 @@ FROM files f, filetypes ft WHERE (f.cachedat IS NULL OR f.cachedat != f.moddate) AND f.filetypeid = ft.filetypeid + AND ft.content ORDER BY f.fileid </sql> </project2:sqlrows> diff --git a/gentoobrowse/console/packageimport.xml b/gentoobrowse/console/packageimport.xml index cdb66ff..b2c48ab 100644 --- a/gentoobrowse/console/packageimport.xml +++ b/gentoobrowse/console/packageimport.xml @@ -209,6 +209,8 @@ </columns> </project2:sqlmerge> + <xi:include href="categorymetadata.xml" /> + <xi:include href="packagemetadata.xml" /> <xi:include href="packagemasks.xml" /> <xi:include href="bugassociate.xml" /> </packageimport> diff --git a/gentoobrowse/console/packagemetadata.xml b/gentoobrowse/console/packagemetadata.xml new file mode 100644 index 0000000..1cb4628 --- /dev/null +++ b/gentoobrowse/console/packagemetadata.xml @@ -0,0 +1,44 @@ +<?xml version="1.0"?> +<homepages name="bugimport" xmlns:xi="http://www.w3.org/2001/XInclude" + xmlns:project2="http://project2.randomdan.homeip.net"> + <project2:sqlrows name="blanksummaries" datasource="postgres"> + <sql> + SELECT p.packageid, 'file://' || ft.searchroot || f.filename AS path, f.moddate + FROM packages p, categories c, files f, filetypes ft + WHERE (p.metadatadate IS NULL OR p.metadatadate != f.moddate) + AND p.categoryid = c.categoryid + AND f.filename = c.name || '/' || p.name || '/metadata.xml' + AND f.filetypeid = ft.filetypeid + AND ft.filetypeid = 4 + </sql> + </project2:sqlrows> + <project2:xslrows name="pkg" html="false" warnings="true"> + <url source="parent" name="path" depth="1" /> + <filterview name="pkgmetadata" root="/pkgmetadata"> + <field name="longdesc" xpath="longdescription" /> + <field name="maintainer" xpath="maintainer/email" /> + <field name="herd" xpath="herd" /> + </filterview> + </project2:xslrows> + <project2:iterate name="eachpkg" source="blanksummaries"> + <project2:iterate name="pkgdetail" source="pkg" filter="pkgmetadata"> + <project2:sqltask name="update" datasource="postgres"> + <sql> + UPDATE packages SET + summary = ?, + maintainer = ?, + herd = ?, + metadatadate = ? + WHERE packageid = ? + </sql> + <parameters> + <param name="0"><value source="parent" name="longdesc" depth="1" /></param> + <param name="1"><value source="parent" name="maintainer" depth="1" /></param> + <param name="2"><value source="parent" name="herd" depth="1" /></param> + <param name="3"><value source="parent" name="moddate" depth="2" /></param> + <param name="4"><value source="parent" name="packageid" depth="2" /></param> + </parameters> + </project2:sqltask> + </project2:iterate> + </project2:iterate> +</homepages> diff --git a/gentoobrowse/herd.xslt b/gentoobrowse/herd.xslt new file mode 100644 index 0000000..7e02a9c --- /dev/null +++ b/gentoobrowse/herd.xslt @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" + xmlns:project2="http://project2.randomdan.homeip.net" exclude-result-prefixes="project2" > + <xsl:import href="base.xslt" /> + <xsl:output encoding="utf-8" method="xml" media-type="text/html" indent="yes" + doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" + doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" /> + <xsl:template name="head"> + <title>Packages in the <xsl:value-of select="/gentoo/project2:uriElems/project2:uriElem[2]" /> herd - Gentoo Browse</title> + <meta name="description"> + <xsl:attribute name="content">Packages in the <xsl:value-of select="/gentoo/project2:uriElems/project2:uriElem[2]" /> herd</xsl:attribute> + </meta> + </xsl:template> + <xsl:template name="content"> + <xsl:apply-templates select="/gentoo/packages" /> + </xsl:template> + <xsl:template match="/gentoo/packages"> + <h2>Packages in the <xsl:value-of select="/gentoo/project2:uriElems/project2:uriElem[2]" /> herd</h2> + <ul> + <xsl:apply-templates select="/gentoo/packages/package" /> + </ul> + </xsl:template> +</xsl:stylesheet> diff --git a/gentoobrowse/home.xslt b/gentoobrowse/home.xslt index 848a487..df4e302 100644 --- a/gentoobrowse/home.xslt +++ b/gentoobrowse/home.xslt @@ -38,9 +38,7 @@ <xsl:attribute name="class">tracked</xsl:attribute> </xsl:if> <xsl:attribute name="title"><xsl:value-of select="description" /> (updated <xsl:value-of select="moddate" />)</xsl:attribute> - <xsl:attribute name="href"> - /package/<xsl:value-of select="catname" />/<xsl:value-of select="pkgname" /> - </xsl:attribute> + <xsl:attribute name="href">/package/<xsl:value-of select="catname" />/<xsl:value-of select="pkgname" /></xsl:attribute> <xsl:value-of select="catname" />/<xsl:value-of select="pkgname" />-<xsl:value-of select="version" /> </a> </li> diff --git a/gentoobrowse/package.xslt b/gentoobrowse/package.xslt index 2d7107f..11eb475 100644 --- a/gentoobrowse/package.xslt +++ b/gentoobrowse/package.xslt @@ -8,7 +8,7 @@ <xsl:template name="head"> <title><xsl:value-of select="/gentoo/summary/package/pkgname" /> (in <xsl:value-of select="/gentoo/summary/package/catname" />) Package Details - Gentoo Browse</title> <meta name="description"> - <xsl:attribute name="content"><xsl:value-of select="/gentoo/summary/package/description" /></xsl:attribute> + <xsl:attribute name="content">Gentoo Linux package details for <xsl:value-of select="/gentoo/summary/package/catname" />/<xsl:value-of select="/gentoo/summary/package/pkgname" />: <xsl:value-of select="/gentoo/summary/package/description" /></xsl:attribute> </meta> <script type="text/javascript"> function showTab(name) @@ -94,11 +94,17 @@ <xsl:apply-templates select="packageUrls" /> <h2> <a> - <xsl:attribute name="href"> - /category/<xsl:value-of select="catname" /> - </xsl:attribute> + <xsl:attribute name="href">/category/<xsl:value-of select="catname" /></xsl:attribute> + <xsl:attribute name="title">Other packages in the <xsl:value-of select="catname" /> category</xsl:attribute> <xsl:value-of select="catname" /> </a>/<xsl:value-of select="pkgname" /> + <xsl:if test="herd != 'no-herd'"> + - <small>(<a> + <xsl:attribute name="href">/herd/<xsl:value-of select="herd" /></xsl:attribute> + <xsl:attribute name="title">Other packages in the <xsl:value-of select="herd" /> herd</xsl:attribute> + <xsl:value-of select="herd" /> + </a>)</small> + </xsl:if> <xsl:if test="count(/gentoo/project2:session/project2:var[@name='loggedInUserID']) != 0"> <a id="dotrack"> <xsl:attribute name="href">javascript:track(<xsl:value-of select="/gentoo/summary/package/packageid" />);</xsl:attribute> @@ -112,9 +118,14 @@ </xsl:if>(Untrack)</a> </xsl:if> </h2> - <p> + <h3> <xsl:value-of select="description" /> - </p> + </h3> + <xsl:if test="summary != description and summary != ''"> + <p> + <xsl:value-of select="summary" /> + </p> + </xsl:if> <div class="tabstrip"> <!-- handles --> <h3 class="tabhandle"><a href="javascript:showTab('versions');">Versions</a></h3> @@ -155,9 +166,7 @@ <div class="urls"> <xsl:for-each select="url"> <a> - <xsl:attribute name="href"> - <xsl:value-of select="url" /> - </xsl:attribute> + <xsl:attribute name="href"><xsl:value-of select="url" /></xsl:attribute> <xsl:value-of select="url" /> </a> </xsl:for-each> diff --git a/gentoobrowse/popular.xslt b/gentoobrowse/popular.xslt index d11f432..53b88ef 100644 --- a/gentoobrowse/popular.xslt +++ b/gentoobrowse/popular.xslt @@ -8,12 +8,7 @@ <xsl:template name="head"> <title>Popular Package List - Gentoo Browse</title> <meta name="description"> - <xsl:attribute name="content">List of Gentoo packages track by users</xsl:attribute> - </meta> - <meta name="keywords"> - <xsl:attribute name="content"> - <xsl:for-each select="/gentoo/packages/package/pkgname"><xsl:value-of select="." />, </xsl:for-each> - </xsl:attribute> + <xsl:attribute name="content">List of Gentoo Linux packages track by users</xsl:attribute> </meta> </xsl:template> <xsl:template name="content"> diff --git a/gentoobrowse/present/herd.xml b/gentoobrowse/present/herd.xml new file mode 100644 index 0000000..c885336 --- /dev/null +++ b/gentoobrowse/present/herd.xml @@ -0,0 +1,11 @@ +<?xml version="1.0"?> +<view name="popular" root="gentoo" contenttype="text/xml-xslt" style="herd.xslt" xmlns:xi="http://www.w3.org/2001/XInclude" + xmlns:project2="http://project2.randomdan.homeip.net"> + <xi:include href="../views/search.xml" /> + <xi:include href="../views/webcommon.xml" /> + <project2:view name="packagesInHerd" source="packagesInHerd" rootname="packages" recordname="package" filter="byHerd"> + <parameters> + <param name="herd"><value source="uri" index="1" /></param> + </parameters> + </project2:view> +</view> diff --git a/gentoobrowse/views/categories.xml b/gentoobrowse/views/categories.xml index 8b41184..1faec02 100644 --- a/gentoobrowse/views/categories.xml +++ b/gentoobrowse/views/categories.xml @@ -3,7 +3,7 @@ xmlns:project2="http://project2.randomdan.homeip.net"> <project2:sqlrows name="categories" datasource="postgres-web"> <sql> - SELECT c.categoryid, MIN(c.name) AS catname, COUNT(*) AS packages + SELECT c.categoryid, MIN(c.name) AS catname, COUNT(*) AS packages, MIN(c.summary) AS summary FROM categories c, packages p WHERE c.categoryid = p.categoryid GROUP BY c.categoryid diff --git a/gentoobrowse/views/package.xml b/gentoobrowse/views/package.xml index 454685e..af36f44 100644 --- a/gentoobrowse/views/package.xml +++ b/gentoobrowse/views/package.xml @@ -3,7 +3,7 @@ xmlns:project2="http://project2.randomdan.homeip.net"> <project2:sqlrows name="packages" datasource="postgres-web"> <sql> - SELECT p.packageid, p.name AS pkgname, p.description, p.firstseen, c.name AS catname + SELECT p.packageid, p.name AS pkgname, p.description, p.firstseen, c.name AS catname, p.herd, p.summary FROM packages p, categories c WHERE p.categoryid = c.categoryid <filter name="catAndName"> @@ -50,6 +50,7 @@ <filter name="pkg"> AND e.packageid = <param name="pkgid" /> </filter> + AND u.use NOT LIKE 'linguas_%' ORDER BY version </sql> </project2:sqlrows> diff --git a/gentoobrowse/views/search.xml b/gentoobrowse/views/search.xml index 100677c..85ec56e 100644 --- a/gentoobrowse/views/search.xml +++ b/gentoobrowse/views/search.xml @@ -27,7 +27,18 @@ <filter name="freeText"> WHERE to_tsvector('english', regexp_replace(summary, '-[0-9][^ ]*', '', 'g')) @@ plainto_tsquery('english', <param name="criteria" />) ORDER BY rank DESC, bugid DESC - </filter> + </filter> + </sql> + </project2:sqlrows> + <project2:sqlrows name="packagesInHerd" datasource="postgres-web"> + <sql> + SELECT c.name as catname, p.name as pkgname, description + FROM packages p, categories c + WHERE p.categoryid = c.categoryid + <filter name="byHerd"> + AND p.herd = <param name="herd" /> + </filter> + ORDER BY c.name, p.name </sql> </project2:sqlrows> </block> |