From 1f675b4dea063c5272b9b0421dafcb23f55ad959 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 21 Dec 2016 15:02:57 +0000 Subject: Line in the sand, all basic functionality is working --- gentoobrowse/.htaccess | 10 +- gentoobrowse/Jamfile.jam | 0 gentoobrowse/checks/.htaccess | 1 - gentoobrowse/checks/loggedIn.xml | 7 - gentoobrowse/config/ice.properties | 7 + gentoobrowse/console/.htaccess | 1 - gentoobrowse/console/bug.urls | 3 - gentoobrowse/console/bugassociate.xml | 17 - gentoobrowse/console/bugimport.xml | 44 -- gentoobrowse/console/changelogs.xml | 51 -- gentoobrowse/console/emailebuilds.xml | 40 -- gentoobrowse/console/fileimport.xml | 46 -- gentoobrowse/console/newsimport.xml | 47 -- gentoobrowse/console/packageimport.xml | 203 ------- gentoobrowse/console/packagelicenses.xml | 24 - gentoobrowse/console/packagemasks.xml | 43 -- gentoobrowse/console/use.global.xml | 16 - gentoobrowse/console/use.grouped.xml | 29 - gentoobrowse/console/use.local.xml | 20 - gentoobrowse/css/general.css | 9 +- gentoobrowse/datasources/.htaccess | 1 - gentoobrowse/datasources/database.mk | 11 - gentoobrowse/datasources/postgres-web.xml | 10 - gentoobrowse/datasources/postgres.xml | 7 - gentoobrowse/datasources/poweredBy.txt | 9 - gentoobrowse/datasources/schema.mk | 5 - gentoobrowse/datasources/schema.sql | 907 ---------------------------- gentoobrowse/emails/.htaccess | 1 - gentoobrowse/emails/base.xslt | 69 --- gentoobrowse/emails/newpackageversions.xml | 37 -- gentoobrowse/emails/newpackageversions.xslt | 48 -- gentoobrowse/emails/signup.xslt | 23 - gentoobrowse/emails/welcome.xml | 17 - gentoobrowse/gentoobrowse-cgi | 1 + gentoobrowse/js/pkgtracking.js | 31 +- gentoobrowse/present/.htaccess | 1 - gentoobrowse/present/accountHome.xml | 11 - gentoobrowse/present/accountTracked.xml | 17 - gentoobrowse/present/atom.xml | 16 - gentoobrowse/present/categories.xml | 11 - gentoobrowse/present/category.xml | 14 - gentoobrowse/present/confirm.xml | 14 - gentoobrowse/present/herd.xml | 14 - gentoobrowse/present/index.xml | 18 - gentoobrowse/present/login.xml | 19 - gentoobrowse/present/package.xml | 82 --- gentoobrowse/present/popular.xml | 11 - gentoobrowse/present/search.xml | 22 - gentoobrowse/present/signup.xml | 14 - gentoobrowse/present/sitemap.xml.xml | 9 - gentoobrowse/present/use.xml | 26 - gentoobrowse/request/.htaccess | 1 - gentoobrowse/request/doconfirm.xml | 27 - gentoobrowse/request/dologin.xml | 48 -- gentoobrowse/request/dologout.xml | 6 - gentoobrowse/request/dosignup.xml | 43 -- gentoobrowse/request/track.xml | 19 - gentoobrowse/request/untrack.xml | 11 - gentoobrowse/robots.txt | 5 +- gentoobrowse/src/Jamfile.jam | 59 ++ gentoobrowse/src/base.cpp | 67 ++ gentoobrowse/src/base.json | 21 + gentoobrowse/src/mash.ice | 107 ++++ gentoobrowse/src/news.ice | 14 + gentoobrowse/src/news.json | 52 ++ gentoobrowse/src/packages.cpp | 323 ++++++++++ gentoobrowse/src/packages.json | 52 ++ gentoobrowse/src/pagebase.ice | 26 + gentoobrowse/src/search.cpp | 67 ++ gentoobrowse/src/search.json | 45 ++ gentoobrowse/src/use.json | 50 ++ gentoobrowse/src/user.cpp | 236 ++++++++ gentoobrowse/tasks/.htaccess | 1 - gentoobrowse/views/.htaccess | 1 - gentoobrowse/views/categories.xml | 14 - gentoobrowse/views/category.xml | 14 - gentoobrowse/views/newebuilds.xml | 28 - gentoobrowse/views/newebuildsatom.xml | 18 - gentoobrowse/views/package.xml | 174 ------ gentoobrowse/views/popular.xml | 15 - gentoobrowse/views/poweredBy.xml | 12 - gentoobrowse/views/search.xml | 55 -- gentoobrowse/views/tracked.xml | 15 - gentoobrowse/views/use.xml | 48 -- gentoobrowse/views/user.xml | 13 - gentoobrowse/views/webcommon.xml | 5 - gentoobrowse/xslt/atom.xslt | 22 + gentoobrowse/xslt/atomebuilds.xslt | 37 -- gentoobrowse/xslt/base.xslt | 166 +++-- gentoobrowse/xslt/categories.xslt | 41 +- gentoobrowse/xslt/category.xslt | 39 +- gentoobrowse/xslt/error.xslt | 3 +- gentoobrowse/xslt/form.xslt | 95 +-- gentoobrowse/xslt/herd.xslt | 53 -- gentoobrowse/xslt/home-atom.xslt | 66 ++ gentoobrowse/xslt/home.xslt | 111 ++-- gentoobrowse/xslt/login.xslt | 48 -- gentoobrowse/xslt/news-atom.xslt | 78 +++ gentoobrowse/xslt/news.xslt | 83 +++ gentoobrowse/xslt/newsitem.xslt | 78 +++ gentoobrowse/xslt/package.xslt | 239 ++++---- gentoobrowse/xslt/popular.xslt | 32 +- gentoobrowse/xslt/search.xslt | 116 +++- gentoobrowse/xslt/sitemap.xslt | 75 +-- gentoobrowse/xslt/use-detail.xslt | 58 ++ gentoobrowse/xslt/use.xslt | 54 +- gentoobrowse/xslt/user-atom.xslt | 66 ++ gentoobrowse/xslt/user-home.xslt | 24 + gentoobrowse/xslt/user-signup.xslt | 30 + gentoobrowse/xslt/user-tracked.xslt | 37 ++ gentoobrowse/xslt/user-verification.xslt | 29 + 111 files changed, 2290 insertions(+), 3176 deletions(-) create mode 100644 gentoobrowse/Jamfile.jam delete mode 100644 gentoobrowse/checks/.htaccess delete mode 100644 gentoobrowse/checks/loggedIn.xml create mode 100644 gentoobrowse/config/ice.properties delete mode 100644 gentoobrowse/console/.htaccess delete mode 100644 gentoobrowse/console/bug.urls delete mode 100644 gentoobrowse/console/bugassociate.xml delete mode 100644 gentoobrowse/console/bugimport.xml delete mode 100644 gentoobrowse/console/changelogs.xml delete mode 100644 gentoobrowse/console/emailebuilds.xml delete mode 100644 gentoobrowse/console/fileimport.xml delete mode 100644 gentoobrowse/console/newsimport.xml delete mode 100644 gentoobrowse/console/packageimport.xml delete mode 100644 gentoobrowse/console/packagelicenses.xml delete mode 100644 gentoobrowse/console/packagemasks.xml delete mode 100644 gentoobrowse/console/use.global.xml delete mode 100644 gentoobrowse/console/use.grouped.xml delete mode 100644 gentoobrowse/console/use.local.xml delete mode 100644 gentoobrowse/datasources/.htaccess delete mode 100644 gentoobrowse/datasources/database.mk delete mode 100644 gentoobrowse/datasources/postgres-web.xml delete mode 100644 gentoobrowse/datasources/postgres.xml delete mode 100644 gentoobrowse/datasources/poweredBy.txt delete mode 100644 gentoobrowse/datasources/schema.mk delete mode 100644 gentoobrowse/datasources/schema.sql delete mode 100644 gentoobrowse/emails/.htaccess delete mode 100644 gentoobrowse/emails/base.xslt delete mode 100644 gentoobrowse/emails/newpackageversions.xml delete mode 100644 gentoobrowse/emails/newpackageversions.xslt delete mode 100644 gentoobrowse/emails/signup.xslt delete mode 100644 gentoobrowse/emails/welcome.xml create mode 120000 gentoobrowse/gentoobrowse-cgi delete mode 100644 gentoobrowse/present/.htaccess delete mode 100644 gentoobrowse/present/accountHome.xml delete mode 100644 gentoobrowse/present/accountTracked.xml delete mode 100644 gentoobrowse/present/atom.xml delete mode 100644 gentoobrowse/present/categories.xml delete mode 100644 gentoobrowse/present/category.xml delete mode 100644 gentoobrowse/present/confirm.xml delete mode 100644 gentoobrowse/present/herd.xml delete mode 100644 gentoobrowse/present/index.xml delete mode 100644 gentoobrowse/present/login.xml delete mode 100644 gentoobrowse/present/package.xml delete mode 100644 gentoobrowse/present/popular.xml delete mode 100644 gentoobrowse/present/search.xml delete mode 100644 gentoobrowse/present/signup.xml delete mode 100644 gentoobrowse/present/sitemap.xml.xml delete mode 100644 gentoobrowse/present/use.xml delete mode 100644 gentoobrowse/request/.htaccess delete mode 100644 gentoobrowse/request/doconfirm.xml delete mode 100644 gentoobrowse/request/dologin.xml delete mode 100644 gentoobrowse/request/dologout.xml delete mode 100644 gentoobrowse/request/dosignup.xml delete mode 100644 gentoobrowse/request/track.xml delete mode 100644 gentoobrowse/request/untrack.xml create mode 100644 gentoobrowse/src/Jamfile.jam create mode 100644 gentoobrowse/src/base.cpp create mode 100644 gentoobrowse/src/base.json create mode 100644 gentoobrowse/src/mash.ice create mode 100644 gentoobrowse/src/news.ice create mode 100644 gentoobrowse/src/news.json create mode 100644 gentoobrowse/src/packages.cpp create mode 100644 gentoobrowse/src/packages.json create mode 100644 gentoobrowse/src/pagebase.ice create mode 100644 gentoobrowse/src/search.cpp create mode 100644 gentoobrowse/src/search.json create mode 100644 gentoobrowse/src/use.json create mode 100644 gentoobrowse/src/user.cpp delete mode 100644 gentoobrowse/tasks/.htaccess delete mode 100644 gentoobrowse/views/.htaccess delete mode 100644 gentoobrowse/views/categories.xml delete mode 100644 gentoobrowse/views/category.xml delete mode 100644 gentoobrowse/views/newebuilds.xml delete mode 100644 gentoobrowse/views/newebuildsatom.xml delete mode 100644 gentoobrowse/views/package.xml delete mode 100644 gentoobrowse/views/popular.xml delete mode 100644 gentoobrowse/views/poweredBy.xml delete mode 100644 gentoobrowse/views/search.xml delete mode 100644 gentoobrowse/views/tracked.xml delete mode 100644 gentoobrowse/views/use.xml delete mode 100644 gentoobrowse/views/user.xml delete mode 100644 gentoobrowse/views/webcommon.xml create mode 100644 gentoobrowse/xslt/atom.xslt delete mode 100644 gentoobrowse/xslt/atomebuilds.xslt delete mode 100644 gentoobrowse/xslt/herd.xslt create mode 100644 gentoobrowse/xslt/home-atom.xslt delete mode 100644 gentoobrowse/xslt/login.xslt create mode 100644 gentoobrowse/xslt/news-atom.xslt create mode 100644 gentoobrowse/xslt/news.xslt create mode 100644 gentoobrowse/xslt/newsitem.xslt create mode 100644 gentoobrowse/xslt/use-detail.xslt create mode 100644 gentoobrowse/xslt/user-atom.xslt create mode 100644 gentoobrowse/xslt/user-home.xslt create mode 100644 gentoobrowse/xslt/user-signup.xslt create mode 100644 gentoobrowse/xslt/user-tracked.xslt create mode 100644 gentoobrowse/xslt/user-verification.xslt diff --git a/gentoobrowse/.htaccess b/gentoobrowse/.htaccess index e4d5a37..40f4020 100644 --- a/gentoobrowse/.htaccess +++ b/gentoobrowse/.htaccess @@ -1,13 +1,13 @@ - - sethandler fcgid-script + + sethandler cgi-script RewriteEngine on RewriteCond %{REQUEST_URI} !^/css/ RewriteCond %{REQUEST_URI} !^/js/ RewriteCond %{REQUEST_URI} !^/img/ RewriteCond %{REQUEST_URI} !^/[^/]+\.[^/]+$ -RewriteCond %{REQUEST_URI} !^/p2fcgi -RewriteRule ^(.*) /p2fcgi/\1 [L] +RewriteCond %{REQUEST_URI} !^/gentoobrowse-cgi +RewriteRule ^(.*) /gentoobrowse-cgi/\1 [L] RewriteCond %{REQUEST_URI} ^/sitemap\.xml$ -RewriteRule ^(.*) /p2fcgi/\1 [L] +RewriteRule ^(.*) /gentoobrowse-cgi/\1 [L] diff --git a/gentoobrowse/Jamfile.jam b/gentoobrowse/Jamfile.jam new file mode 100644 index 0000000..e69de29 diff --git a/gentoobrowse/checks/.htaccess b/gentoobrowse/checks/.htaccess deleted file mode 100644 index e13f618..0000000 --- a/gentoobrowse/checks/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Order allow,deny diff --git a/gentoobrowse/checks/loggedIn.xml b/gentoobrowse/checks/loggedIn.xml deleted file mode 100644 index 49893c3..0000000 --- a/gentoobrowse/checks/loggedIn.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/gentoobrowse/config/ice.properties b/gentoobrowse/config/ice.properties new file mode 100644 index 0000000..dc0baab --- /dev/null +++ b/gentoobrowse/config/ice.properties @@ -0,0 +1,7 @@ +Gentoo.Portage = portage:tcp -h localhost -p 9001 +Gentoo.Users = users:tcp -h localhost -p 9001 +IceSpider.SessionManager = IceSpider-FileSessions +IceSpider.FileSessions.Path = /var/tmp/icespider-sessions/gentoobrowse +Ice.ThreadPool.Client.SizeMax = 20 +Ice.ThreadPool.Client.Size = 5 +Ice.MessageSizeMax = 4000 diff --git a/gentoobrowse/console/.htaccess b/gentoobrowse/console/.htaccess deleted file mode 100644 index e13f618..0000000 --- a/gentoobrowse/console/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Order allow,deny diff --git a/gentoobrowse/console/bug.urls b/gentoobrowse/console/bug.urls deleted file mode 100644 index 0209f97..0000000 --- a/gentoobrowse/console/bug.urls +++ /dev/null @@ -1,3 +0,0 @@ -http://bugs.gentoo.org/data/cached/buglist-UNCONFIRMED.htmlgz -http://bugs.gentoo.org/data/cached/buglist-CONFIRMED.htmlgz -http://bugs.gentoo.org/data/cached/buglist-IN_PROGRESS.htmlgz diff --git a/gentoobrowse/console/bugassociate.xml b/gentoobrowse/console/bugassociate.xml deleted file mode 100644 index d0b9ed1..0000000 --- a/gentoobrowse/console/bugassociate.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - SELECT b.bugid, p.packageid - FROM bugs b, packages p, categories c - WHERE p.categoryid = c.categoryid - AND namedpackages(b.summary) @> ARRAY[c.name || '/' || p.name] - - - - - - - - diff --git a/gentoobrowse/console/bugimport.xml b/gentoobrowse/console/bugimport.xml deleted file mode 100644 index b6b0747..0000000 --- a/gentoobrowse/console/bugimport.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/gentoobrowse/console/changelogs.xml b/gentoobrowse/console/changelogs.xml deleted file mode 100644 index 0cdc351..0000000 --- a/gentoobrowse/console/changelogs.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - (a.packageid, a.repoid) IN ( - SELECT p.packageid, f.repoid - FROM files f, packages p, categories c - WHERE f.filetypeid = 2 - AND (f.cachedat IS NULL OR f.cachedat != f.moddate) - AND p.name = f.pathparts[2] - AND c.name = f.pathparts[1] - AND c.categoryid = p.categoryid) - - - SELECT repoid, p.packageid, RANK() OVER(PARTITION BY repoid, packageid, TO_DATE(l[1], 'DD Mon YYYY') ORDER BY n DESC) AS n, - TO_DATE(l[1], 'DD Mon YYYY') AS date, - TRIM(l[2]) AS person, - TRIM(l[3]) AS email, - TRIM(l[4]) AS comment - FROM ( - SELECT repoid, cat, pkg, n, - REGEXP_MATCHES(r, '(\d{1,2} *(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\w* 2\d{3}); (.+)? <(.+@[^ >]+)[>\s] (?:[^:]*:)? (.*)', 'i') l - FROM ( - SELECT repoid, pathparts[1] cat, pathparts[2] pkg, REGEXP_REPLACE(r, '\s+', ' ', 'g') r, ROW_NUMBER() OVER() n - FROM files f, REGEXP_SPLIT_TO_TABLE(f.filecontent, '\n\s*\n') r - WHERE filetypeid = 2 - AND (f.cachedat IS NULL OR f.cachedat != f.moddate)) f - ) f, packages p, categories c - WHERE p.name = f.pkg - AND c.name = f.cat - AND p.categoryid = c.categoryid - - - - - - - - - - - - - - UPDATE files SET - cachedat = moddate - WHERE filetypeid = 2 - - - diff --git a/gentoobrowse/console/emailebuilds.xml b/gentoobrowse/console/emailebuilds.xml deleted file mode 100644 index 660e2d7..0000000 --- a/gentoobrowse/console/emailebuilds.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - select ut.userid, ut.useremail from - (select e.ebuildid, u.userid, u.useremail - from ebuilds e, user_packages up, users u - where e.packageid = up.packageid - and u.userid = up.userid - and e.firstseen > up.trackedsince) as ut left outer join user_ebuild_emails ebe - on ebe.userid = ut.userid and ebe.ebuildid = ut.ebuildid - where ebe.userid is null - group by ut.userid, ut.useremail - - - - - - - - - insert into user_ebuild_emails(ebuildid, userid, sentat) - select ut.ebuildid, ut.userid, now() - from ( - select e.ebuildid, up.userid - from ebuilds e, user_packages up, users u - where e.packageid = up.packageid - and u.userid = up.userid - and u.userid = - and e.firstseen > up.trackedsince) as ut left outer join user_ebuild_emails ebe - on ebe.userid = ut.userid and ebe.ebuildid = ut.ebuildid - where ebe.userid is null - - - - - - diff --git a/gentoobrowse/console/fileimport.xml b/gentoobrowse/console/fileimport.xml deleted file mode 100644 index 149f094..0000000 --- a/gentoobrowse/console/fileimport.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - SELECT name FROM PG_LS_DIR('gentoobrowse') name - - - - - - - - WITH RECURSIVE filelist AS ( - SELECT ('gentoobrowse/' || pg_ls_dir) AS filename, st.size, st.modification, st.isdir - FROM PG_LS_DIR('gentoobrowse'), PG_STAT_FILE('gentoobrowse') st - UNION ALL - SELECT parent.filename || '/' || cur, st.size, st.modification, st.isdir - FROM filelist parent, PG_LS_DIR(parent.filename) cur, PG_STAT_FILE(parent.filename || '/' || cur) st - WHERE parent.isdir - AND cur != 'packages' - AND cur != 'lost+found' - AND cur != 'distfiles' - AND cur NOT LIKE '.%' - ) - SELECT - r.repoid, - fl.filename, - ft.filetypeid, - (STRING_TO_ARRAY(fl.filename, '/'))[3:100] pathparts, - fl.size filesize, - fl.modification AT TIME ZONE 'utc' moddate - FROM filelist fl, repos r, filetypes ft - WHERE (STRING_TO_ARRAY(fl.filename, '/'))[2] = r.name - AND (STRING_TO_ARRAY(fl.filename, '/'))[3:100] ~ ft.spec - AND NOT fl.isdir - - - - - - - - - - - diff --git a/gentoobrowse/console/newsimport.xml b/gentoobrowse/console/newsimport.xml deleted file mode 100644 index 6b6c039..0000000 --- a/gentoobrowse/console/newsimport.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - a.newsid IN ( - SELECT f.pathparts[3] - FROM files f - WHERE f.filetypeid = 11 - AND (f.cachedat IS NULL OR f.cachedat != f.moddate)) - - - SELECT - newsid, - (SELECT REGEXP_MATCHES(p[1], 'Title: ([^\n]+)'))[1] title, - CAST((SELECT REGEXP_MATCHES(p[1], 'Posted: ([^\n]+)'))[1] AS DATE) posted, - (SELECT REGEXP_MATCHES(P[1], 'Author: ([^\n]+) <'))[1] authorname, - (SELECT REGEXP_MATCHES(P[1], 'Author:.*?<([^>]+)>'))[1] authoremail, - (SELECT ARRAY_AGG(pkg) FROM (SELECT (REGEXP_MATCHES(P[1], 'Display-If-Installed: ([^\n]+)', 'g') )[1] pkg) p) atomspec, - (SELECT ARRAY_AGG(REGEXP_REPLACE(PARA, '\s+', ' ', 'g')) FROM (SELECT REGEXP_SPLIT_TO_TABLE(p[2], '\n\n') para) p) body, - (SELECT ARRAY_AGG(url) FROM (SELECT (REGEXP_MATCHES(p[3], '(\w+://[^\s]+)', 'g'))[1] url) u) urls - FROM ( - SELECT pathparts[3] newsid, REGEXP_MATCHES(f.filecontent, '^(.*?)\n\n(.*?)(\n(\n\[[\d]+\] \w+://[^ ]+)*)?$') p - FROM files f - WHERE f.filetypeid = 11 - AND (f.cachedat IS NULL OR f.cachedat != f.moddate) - ) newsfiles - - - - - <posted /> - <authorname /> - <authoremail /> - <atomspec /> - <body /> - <urls /> - </columns> - </project2:sqlmerge> - <project2:sqltask name="update" datasource="postgres"> - <sql> - UPDATE files SET - cachedat = moddate - WHERE filetypeid = 11 - </sql> - </project2:sqltask> -</packageimport> diff --git a/gentoobrowse/console/packageimport.xml b/gentoobrowse/console/packageimport.xml deleted file mode 100644 index 54b1a62..0000000 --- a/gentoobrowse/console/packageimport.xml +++ /dev/null @@ -1,203 +0,0 @@ -<?xml version="1.0"?> -<packageimport name="bugassociate" xmlns:xi="http://www.w3.org/2001/XInclude" - xmlns:project2="http://project2.randomdan.homeip.net"> - <project2:sqlmerge name="categories" datasource="postgres" targettable="categories" useview="yes"> - <sql> - SELECT c.name, m.summary - FROM (SELECT DISTINCT pathparts[3] AS name FROM files WHERE filetypeid = 1) c - LEFT OUTER JOIN ( - SELECT f.pathparts[1] AS name, RANK() OVER(PARTITION BY f.pathparts[1] ORDER BY repoid DESC) r, - TRIM(REGEXP_REPLACE(CAST((XPATH('/catmetadata/longdescription[@lang="en"]/text()', doc))[1] AS TEXT), '\s+', ' ', 'g')) summary - FROM files f, XMLPARSE(DOCUMENT f.filecontent) doc - WHERE filetypeid = 10) m ON m.name = c.name - </sql> - <columns> - <name key="true" /> - <summary /> - </columns> - </project2:sqlmerge> - - <project2:sqltask name="tmpdefs" datasource="postgres"> - <sql> - CREATE TEMPORARY TABLE ebuilddefs AS - SELECT p.*, d[1] pkgname, d[2] AS version, ebuildversion_constructor(d[2]) AS versioninst - FROM ( - SELECT c.name catname, c.categoryid, f.repoid, f.firstseen, f.moddate, REGEXP_MATCHES(pathparts[4], '^(.+)-([0-9].*)$') AS d, p.* - FROM CROSSTAB($$ - SELECT fileid, a, SUBSTRING(md FROM '=(.*)') v - FROM ( - SELECT f.fileid, f.filecontent, a - FROM files f, unnest(array['DEFINED_PHASES', 'DEPEND', 'DESCRIPTION', 'EAPI', 'HOMEPAGE', 'IUSE', 'KEYWORDS', - 'LICENSE', 'PDEPEND', 'PROPERTIES', 'RDEPEND', 'REQUIRED_USE', 'RESTRICT', 'SLOT', 'SRC_URI']) a - WHERE filetypeid = 1 - ) f LEFT OUTER JOIN REGEXP_SPLIT_TO_TABLE(filecontent, '\n') md - ON SPLIT_PART(md, '=' ,1) = a - ORDER BY FILEID, a $$) AS p(fileid INT, defined_phases TEXT, depend TEXT, description TEXT, eapi text, homepage TEXT, - iuse TEXT, keywords TEXT, license TEXT, pdepend TEXT, properties TEXT, rdepend TEXT, required_use TEXT, - restrict TEXT, slot TEXT, src_uri TEXT), files f, categories c - WHERE f.fileid = p.fileid - AND f.pathparts[3] = c.name) p - </sql> - </project2:sqltask> - - <project2:sqlmerge name="packages" datasource="postgres" targettable="packages" useview="no"> - <sql> - SELECT d.categoryid, d.pkgname AS name, description, maintainer, maintainername, herd, summary, image - FROM ( - SELECT categoryid, pkgname, description, RANK() OVER(PARTITION BY categoryid, pkgname ORDER BY version DESC) r - FROM ebuilddefs) d - LEFT OUTER JOIN ( - SELECT categoryid, pkgname, maintainer, maintainername, herd, r, - TRIM(REGEXP_REPLACE(REGEXP_REPLACE(COALESCE(longdescen, longdesc), '<<data:image/[^>]+>>', ''), '\s+', ' ', 'g')) AS summary, - (SELECT REGEXP_MATCHES(COALESCE(longdescen, longdesc), '<<(data:image/[^>]+)>>')) AS image - FROM ( - SELECT categoryid, pkgname, RANK() OVER(PARTITION BY categoryid, pkgname ORDER BY repoid DESC) r, - CAST((XPATH('/pkgmetadata/maintainer/email/text()', doc))[1] AS TEXT) maintainer, - CAST((XPATH('/pkgmetadata/maintainer/name/text()', doc))[1] AS TEXT) maintainername, - CAST((XPATH('/pkgmetadata/longdescription[@lang="en"]/text()', doc))[1] AS TEXT) longdescen, - CAST((XPATH('/pkgmetadata/longdescription[not(@lang)]/text()', doc))[1] AS TEXT) longdesc, - CAST((XPATH('/pkgmetadata/herd/text()', doc))[1] AS TEXT) herd - FROM ( - SELECT f.repoid, categoryid, f.pathparts[2] pkgname, XMLPARSE(DOCUMENT f.filecontent) doc - FROM files f, categories c - WHERE filetypeid = 4 - AND f.pathparts[1] = c.name) x) x - ) m ON m.categoryid = d.categoryid AND m.pkgname = d.pkgname AND m.r = 1 - WHERE d.r = 1 - </sql> - <columns> - <categoryid key="true" /> - <name key="true" /> - <description /> - <maintainer /> - <maintainername /> - <herd /> - <summary /> - <image /> - </columns> - </project2:sqlmerge> - - <project2:sqlmerge name="ebuilds" datasource="postgres" targettable="ebuilds" useview="yes"> - <sql> - SELECT p.packageid, e.version, e.fileid AS ebuildid, e.versioninst, e.slot, e.license, e.firstseen, e.moddate, e.repoid - FROM ebuilddefs e, packages p - WHERE e.pkgname = p.name - AND e.categoryid = p.categoryid - </sql> - <columns> - <ebuildid key="true" /> - <packageid /> - <version /> - <versioninst /> - <slot /> - <license /> - <firstseen /> - <moddate /> - <repoid /> - </columns> - </project2:sqlmerge> - - <project2:sqlmerge name="archs" datasource="postgres" targettable="ebuild_archs" useview="yes"> - <sql> - SELECT DISTINCT e.fileid AS ebuildid, REGEXP_SPLIT_TO_TABLE(e.keywords, ' ') AS arch - FROM ebuilddefs e - </sql> - <columns> - <ebuildid key="true" /> - <arch key="true" /> - </columns> - </project2:sqlmerge> - - <project2:sqlmerge name="uses" datasource="postgres" targettable="ebuild_uses" useview="yes"> - <sql> - SELECT DISTINCT e.fileid AS ebuildid, REGEXP_SPLIT_TO_TABLE(e.iuse, ' ') AS use - FROM ebuilddefs e - </sql> - <columns> - <ebuildid key="true" /> - <use key="true" /> - </columns> - </project2:sqlmerge> - - <project2:sqlmerge name="urls" datasource="postgres" targettable="package_urls" useview="yes"> - <sql> - SELECT DISTINCT p.packageid, REGEXP_SPLIT_TO_TABLE(e.homepage, ' ') AS url - FROM ebuilddefs e, packages p - WHERE e.pkgname = p.name - AND e.categoryid = p.categoryid - AND homepage LIKE '%://%' - </sql> - <columns> - <packageid key="true" /> - <url key="true" /> - </columns> - </project2:sqlmerge> - - <project2:sqlmerge name="deps" datasource="postgres" targettable="ebuild_deps" useview="no"> - <sql> - SELECT fileid AS ebuildid, packageid, COALESCE(slot, '') AS slot, COALESCE(op, '') AS op, - COALESCE(versionspec, '') AS versionspec, COALESCE(flags, '') AS flags - FROM ( - SELECT DISTINCT fileid, field[2] AS cat, field[3] AS pkg, field[7] AS slot, - field[1] AS op, field[5] AS versionspec, field[9] AS flags - FROM ( - SELECT fileid, REGEXP_MATCHES(dep, - E'([^a-zA-Z0-9]*)([a-zA-Z0-9-]+)/([a-zA-Z0-9_+-]+?)(-([0-9][^:]*))?(:([0-9.]+))?(\\[([^]]+)\\])?') as field - FROM ( - SELECT e.fileid, REGEXP_SPLIT_TO_TABLE(e.depend, ' ') AS dep - FROM ebuilddefs e - ) src - ) AS src2 - ) AS src3, categories c, packages p - WHERE p.categoryid = c.categoryid - AND p.name = pkg - AND c.name = cat - </sql> - <columns> - <ebuildid key="true" /> - <packageid key="true" /> - <slot key="true" /> - <op key="true" /> - <versionspec key="true" /> - <flags key="true" /> - </columns> - </project2:sqlmerge> - - <project2:sqlmerge name="rdeps" datasource="postgres" targettable="ebuild_rdeps" useview="no"> - <sql> - SELECT fileid AS ebuildid, packageid, COALESCE(slot, '') AS slot, COALESCE(op, '') AS op, - COALESCE(versionspec, '') AS versionspec, COALESCE(flags, '') AS flags - FROM ( - SELECT DISTINCT fileid, field[2] AS cat, field[3] AS pkg, field[7] AS slot, - field[1] AS op, field[5] AS versionspec, field[9] AS flags - FROM ( - SELECT fileid, REGEXP_MATCHES(dep, - E'([^a-zA-Z0-9]*)([a-zA-Z0-9-]+)/([a-zA-Z0-9_+-]+?)(-([0-9][^:]*))?(:([0-9.]+))?(\\[([^]]+)\\])?') as field - FROM ( - SELECT e.fileid, REGEXP_SPLIT_TO_TABLE(e.rdepend, ' ') AS dep - FROM ebuilddefs e - ) src - ) AS src2 - ) AS src3, categories c, packages p - WHERE p.categoryid = c.categoryid - AND p.name = pkg - AND c.name = cat - </sql> - <columns> - <ebuildid key="true" /> - <packageid key="true" /> - <slot key="true" /> - <op key="true" /> - <versionspec key="true" /> - <flags key="true" /> - </columns> - </project2:sqlmerge> - - <xi:include href="changelogs.xml" /> - <xi:include href="packagelicenses.xml" /> - <xi:include href="use.global.xml" /> - <xi:include href="use.local.xml" /> - <xi:include href="use.grouped.xml" /> - <xi:include href="packagemasks.xml" /> - <xi:include href="bugassociate.xml" /> -</packageimport> diff --git a/gentoobrowse/console/packagelicenses.xml b/gentoobrowse/console/packagelicenses.xml deleted file mode 100644 index baa88b0..0000000 --- a/gentoobrowse/console/packagelicenses.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0"?> -<homepages name="bugimport" xmlns:xi="http://www.w3.org/2001/XInclude" - xmlns:project2="http://project2.randomdan.homeip.net"> - <project2:sqlmerge name="update" datasource="postgres" targettable="license"> - <updatewhere>a.name IN (SELECT o.pathparts[2] FROM files o WHERE o.cachedat IS NULL OR o.cachedat != o.moddate)</updatewhere> - <sql> - SELECT f.pathparts[2] AS name, f.filecontent legalbumph - FROM files f - WHERE (f.cachedat IS NULL OR f.cachedat != f.moddate) - AND f.filetypeid = 7 - </sql> - <columns> - <name key="true" /> - <legalbumph /> - </columns> - </project2:sqlmerge> - <project2:sqltask name="update" datasource="postgres"> - <sql> - UPDATE files SET - cachedat = moddate - WHERE filetypeid = 7 - </sql> - </project2:sqltask> -</homepages> diff --git a/gentoobrowse/console/packagemasks.xml b/gentoobrowse/console/packagemasks.xml deleted file mode 100644 index fd03528..0000000 --- a/gentoobrowse/console/packagemasks.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0"?> -<packagemasks name="packagemasks" xmlns:xi="http://www.w3.org/2001/XInclude" - xmlns:project2="http://project2.randomdan.homeip.net"> - <project2:sqltask name="tmpmasks" datasource="postgres"> - <sql> - CREATE TEMPORARY TABLE tmpmasks AS - SELECT to_date(m[3], 'dd mon yyyy') as dateadded, RANK() OVER(PARTITION BY to_date(m[3], 'dd mon yyyy') ORDER BY n DESC) n, - TRIM(m[1]) as person, m[2] as email, m[4] as message, m[5] as atoms - FROM ( - SELECT row_number() over() n, - regexp_matches(r, '^# ([^<]+)? ?<(.+?@[^>]+)> \((\d+ *(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec) \d+)\)\n((?:#[^\n]*\n)+)(.*)$', 'i') m - FROM files f, REGEXP_SPLIT_TO_TABLE(f.filecontent, '\n\s*\n') r - WHERE filetypeid = 3) m - </sql> - </project2:sqltask> - <project2:sqlmerge name="masksets" datasource="postgres" targettable="masksets" useview="yes"> - <sql> - SELECT dateadded, n, person, email, - TRIM(REGEXP_REPLACE(message, '#?\s+', ' ', 'g')) message - FROM tmpmasks - </sql> - <columns> - <dateadded key="true" /> - <n key="true" /> - <person /> - <email /> - <message /> - </columns> - </project2:sqlmerge> - <project2:sqlmerge name="masks" datasource="postgres" targettable="ebuild_masks" useview="yes"> - <sql> - SELECT DISTINCT s.setno, ebuildfilter(REGEXP_SPLIT_TO_TABLE(tm.atoms, '\n')) ebuildid - FROM tmpmasks tm, masksets s - WHERE tm.dateadded = s.dateadded - AND tm.n = s.n - </sql> - <columns> - <setno key="true" /> - <ebuildid key="true" /> - </columns> - </project2:sqlmerge> -</packagemasks> - diff --git a/gentoobrowse/console/use.global.xml b/gentoobrowse/console/use.global.xml deleted file mode 100644 index e437514..0000000 --- a/gentoobrowse/console/use.global.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0"?> -<test name="test" xmlns:xi="http://www.w3.org/2001/XInclude" - xmlns:project2="http://project2.randomdan.homeip.net"> - <project2:sqlmerge name="mergeguse" datasource="postgres" targettable="use_global"> - <sql> - SELECT u.ud[1] AS use, u.ud[2] AS description - FROM (SELECT regexp_matches(u, '([^ ]+) - (.+)') ud - FROM files f, regexp_split_to_table(f.filecontent, '\n') u - WHERE f.filetypeid = 5) u - </sql> - <columns> - <use key="true" /> - <description /> - </columns> - </project2:sqlmerge> -</test> diff --git a/gentoobrowse/console/use.grouped.xml b/gentoobrowse/console/use.grouped.xml deleted file mode 100644 index ea93357..0000000 --- a/gentoobrowse/console/use.grouped.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0"?> -<packageimport name="bugassociate" xmlns:xi="http://www.w3.org/2001/XInclude" - xmlns:project2="http://project2.randomdan.homeip.net"> - <project2:sqlmerge name="categories" datasource="postgres" targettable="use_groups" useview="yes"> - <sql> - SELECT DISTINCT split_part(pathparts[3], '.', 1) AS name - FROM files f - WHERE f.filetypeid = 9 - </sql> - <columns> - <name key="true" /> - </columns> - </project2:sqlmerge> - <project2:sqlmerge datasource="postgres" targettable="use_group"> - <sql> - SELECT ug.usegroupid, u.ud[1] AS use, MIN(u.ud[2]) AS description - FROM (SELECT split_part(pathparts[3], '.', 1) AS name, regexp_matches(u, '([^ ]+) - (.*)') ud - FROM files f, regexp_split_to_table(f.filecontent, '\n') u - WHERE f.filetypeid = 9) u, use_groups ug - WHERE ug.name = u.name - GROUP BY ug.usegroupid, u.ud[1] - </sql> - <columns> - <usegroupid key="true" /> - <use key="true" /> - <description /> - </columns> - </project2:sqlmerge> -</packageimport> diff --git a/gentoobrowse/console/use.local.xml b/gentoobrowse/console/use.local.xml deleted file mode 100644 index e9e5f52..0000000 --- a/gentoobrowse/console/use.local.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0"?> -<test name="test" xmlns:xi="http://www.w3.org/2001/XInclude" - xmlns:project2="http://project2.randomdan.homeip.net"> - <project2:sqlmerge name="mergeguse" datasource="postgres" targettable="use_local"> - <sql> - SELECT p.packageid, u.ud[3] AS use, u.ud[4] AS description - FROM (SELECT regexp_matches(u, '([^/]+)/([^:]+):([^ ]+) - (.+)') ud - FROM files f, regexp_split_to_table(f.filecontent, '\n') u - WHERE f.filetypeid = 6) u, categories c, packages p - WHERE c.name = u.ud[1] - AND p.name = u.ud[2] - AND c.categoryid = p.categoryid - </sql> - <columns> - <packageid key="true" /> - <use key="true" /> - <description /> - </columns> - </project2:sqlmerge> -</test> diff --git a/gentoobrowse/css/general.css b/gentoobrowse/css/general.css index 35a46c7..2b4d500 100644 --- a/gentoobrowse/css/general.css +++ b/gentoobrowse/css/general.css @@ -1062,10 +1062,13 @@ form.bs-docs-example { +.local { + font-style: italic; +} - - - +.block { + text-decoration: line-through; +} form#search input[type=search] { width: 516px; diff --git a/gentoobrowse/datasources/.htaccess b/gentoobrowse/datasources/.htaccess deleted file mode 100644 index e13f618..0000000 --- a/gentoobrowse/datasources/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Order allow,deny diff --git a/gentoobrowse/datasources/database.mk b/gentoobrowse/datasources/database.mk deleted file mode 100644 index 0d242d0..0000000 --- a/gentoobrowse/datasources/database.mk +++ /dev/null @@ -1,11 +0,0 @@ -.PHONY : database current.sql schema.sql - -database: patch.sql - psql -U gentoo gentoo -qf $< - -current.sql : - pg_dump -U gentoo gentoo -n gentoobrowse -s -E utf8 | grep -v _gentoo > $@ - -patch.sql : current.sql schema.sql - apgdiff --add-transaction current.sql schema.sql | tee $@ - diff --git a/gentoobrowse/datasources/postgres-web.xml b/gentoobrowse/datasources/postgres-web.xml deleted file mode 100644 index be19a4e..0000000 --- a/gentoobrowse/datasources/postgres-web.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0"?> -<project2:rdbmsdatasource xmlns:project2="http://project2.randomdan.homeip.net" name="postgres-web" preferlocal="true"> - <readonly> - <dsn host="firebrand" provider="postgresql" dsn="host=firebrand.random.lan user=apache dbname=gentoo options='-c search_path=gentoobrowse,public'" /> - <dsn host="defiant" provider="postgresql" dsn="host=defiant.random.lan user=apache dbname=gentoo options='-c search_path=gentoobrowse,public'" /> - <dsn host="akira" provider="postgresql" dsn="host=akira.random.lan user=apache dbname=gentoo options='-c search_path=gentoobrowse,public'" /> - <dsn host="riogrande" provider="postgresql" dsn="host=riogrande.random.lan user=apache dbname=gentoo options='-c search_path=gentoobrowse,public'" /> - </readonly> - <masterdsn provider="postgresql" dsn="host=firebrand.random.lan user=apache dbname=gentoo options='-c search_path=gentoobrowse,public'" /> -</project2:rdbmsdatasource> diff --git a/gentoobrowse/datasources/postgres.xml b/gentoobrowse/datasources/postgres.xml deleted file mode 100644 index 8281549..0000000 --- a/gentoobrowse/datasources/postgres.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0"?> -<project2:rdbmsdatasource xmlns:project2="http://project2.randomdan.homeip.net" name="postgres" preferlocal="true"> - <readonly> - <dsn host="firebrand" provider="postgresql" dsn="sslmode=disable user=gentoo dbname=gentoo options='-c search_path=gentoobrowse,public'" /> - </readonly> - <masterdsn provider="postgresql" dsn="sslmode=disable user=gentoo dbname=gentoo options='-c search_path=gentoobrowse,public'" /> -</project2:rdbmsdatasource> diff --git a/gentoobrowse/datasources/poweredBy.txt b/gentoobrowse/datasources/poweredBy.txt deleted file mode 100644 index b7d9dde..0000000 --- a/gentoobrowse/datasources/poweredBy.txt +++ /dev/null @@ -1,9 +0,0 @@ -Gentoo|http://www.gentoo.org/ -PostgreSQL|http://www.postgresql.org/ -Apache|http://httpd.apache.org/ -FastCGI|http://www.fastcgi.com/drupal/ -XSLT|http://www.w3.org/TR/xslt/ -jQuery|http://jquery.com/ -Boost|http://www.boost.org/ -Bootstrap|http://twitter.github.com/bootstrap/index.html -Project2|http://project2.randomdan.homeip.net/ diff --git a/gentoobrowse/datasources/schema.mk b/gentoobrowse/datasources/schema.mk deleted file mode 100644 index 42d4586..0000000 --- a/gentoobrowse/datasources/schema.mk +++ /dev/null @@ -1,5 +0,0 @@ -.PHONY : schema.sql - -schema.sql : - pg_dump -U gentoo gentoo -n gentoobrowse -s -E utf8 | grep -v _gentoo | grep -v '^\(--\|\)$$' > $@ - diff --git a/gentoobrowse/datasources/schema.sql b/gentoobrowse/datasources/schema.sql deleted file mode 100644 index 119d5bc..0000000 --- a/gentoobrowse/datasources/schema.sql +++ /dev/null @@ -1,907 +0,0 @@ --- PostgreSQL database dump -SET statement_timeout = 0; -SET lock_timeout = 0; -SET client_encoding = 'UTF8'; -SET standard_conforming_strings = on; -SET check_function_bodies = false; -SET client_min_messages = warning; --- Name: gentoobrowse; Type: SCHEMA; Schema: -; Owner: gentoo -CREATE SCHEMA gentoobrowse; -ALTER SCHEMA gentoobrowse OWNER TO gentoo; -SET search_path = gentoobrowse, pg_catalog; --- Name: ebuildversion; Type: TYPE; Schema: gentoobrowse; Owner: gentoo -CREATE TYPE ebuildversion AS ( - ver bigint[], - versuffix character(1), - suffix bigint, - suffixnum bigint, - revision bigint -); -ALTER TYPE ebuildversion OWNER TO gentoo; --- Name: filterspec; Type: TYPE; Schema: gentoobrowse; Owner: gentoo -CREATE TYPE filterspec AS ( - part integer, - pattern text -); -ALTER TYPE filterspec OWNER TO gentoo; -SET default_tablespace = ''; -SET default_with_oids = false; --- Name: bugs; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE bugs ( - bugid integer NOT NULL, - severity text NOT NULL, - status text NOT NULL, - summary text NOT NULL, - firstseen timestamp without time zone DEFAULT now() NOT NULL -); -ALTER TABLE bugs OWNER TO gentoo; --- Name: TABLE bugs; Type: COMMENT; Schema: gentoobrowse; Owner: gentoo -COMMENT ON TABLE bugs IS 'Import of Gentoo Bugs bug list from snapshots'; --- Name: bugfts(bugs); Type: FUNCTION; Schema: gentoobrowse; Owner: gentoo -CREATE FUNCTION bugfts(b bugs) RETURNS tsvector - LANGUAGE plpgsql IMMUTABLE - AS $$ -BEGIN - RETURN TO_TSVECTOR('english', regexp_replace(b.summary, '-[0-9][^ ]*', '', 'g')); -END -$$; -ALTER FUNCTION gentoobrowse.bugfts(b bugs) OWNER TO gentoo; --- Name: ebuildfilter(text); Type: FUNCTION; Schema: gentoobrowse; Owner: gentoo -CREATE FUNCTION ebuildfilter(atomspec text) RETURNS SETOF integer - LANGUAGE plpgsql - AS $_$ -declare - op text; - cat text; - pkg text; - ver gentoobrowse.ebuildversion; -begin -if (atomspec like '=%*') then - atomspec = '~' || substr(atomspec, 2, length(atomspec) - 2); -end if; -op = (regexp_matches(atomspec, '^([^a-z]*)'))[1]; -cat = (regexp_matches(atomspec, '^[^a-z]*([^/]+)/'))[1]; -pkg = (regexp_matches(atomspec, '/(.+?)((-[0-9])|$)'))[1]; -ver = ebuildversion_constructor((regexp_matches(atomspec, '-([0-9]+.*)$'))[1]); -return query select ebuildid -from ebuilds e, packages p, categories c -where e.packageid = p.packageid -and p.categoryid = c.categoryid -and p.name = pkg -and c.name = cat -and case - when op = '=' then e.versioninst = ver - when op = '>=' then e.versioninst >= ver - when op = '<=' then e.versioninst <= ver - when op = '<' then e.versioninst < ver - when op = '>' then e.versioninst > ver - when op = '~' then e.versioninst ~ ver - when op = '' then true - else false -end -; -end; -$_$; -ALTER FUNCTION gentoobrowse.ebuildfilter(atomspec text) OWNER TO gentoo; --- Name: ebuildversion_constructor(text); Type: FUNCTION; Schema: gentoobrowse; Owner: gentoo -CREATE FUNCTION ebuildversion_constructor(val text) RETURNS ebuildversion - LANGUAGE plpgsql IMMUTABLE - AS $_$ -declare - v ebuildversion; - s text; -begin - v.ver = string_to_array((regexp_matches(val, '^([0-9.]+)'))[1], '.')::bigint[]; - v.versuffix = (regexp_matches(val, '[0-9]([a-z])'))[1]; - v.versuffix = coalesce(v.versuffix, '@'); - s = (regexp_matches(val, '_([a-z]+)'))[1]; - case - when s = 'alpha' then v.suffix = -4; - when s = 'beta' then v.suffix = -3; - when s = 'pre' then v.suffix = -2; - when s = 'rc' then v.suffix = -1; - when s = 'p' then v.suffix = 1; - else v.suffix = 0; - end case; - v.suffixnum = (regexp_matches(val, '_[a-z]+([0-9]+)'))[1]; - v.suffixnum = coalesce(v.suffixnum, 0); - v.revision = (regexp_matches(val, '-r([0-9]+)$'))[1]; - v.revision = coalesce(v.revision, 0); - return v; -end; -$_$; -ALTER FUNCTION gentoobrowse.ebuildversion_constructor(val text) OWNER TO gentoo; --- Name: ebuildversionrange(ebuildversion, ebuildversion); Type: FUNCTION; Schema: gentoobrowse; Owner: gentoo -CREATE FUNCTION ebuildversionrange(a ebuildversion, b ebuildversion) RETURNS boolean - LANGUAGE plpgsql - AS $$begin --- If spec if longer, can't match -if (array_length(a.ver, 1) < array_length(b.ver, 1)) then - return false; -end if; --- Otherwise, they have to start the same -if (position(array_to_string(b.ver, '.') in array_to_string(a.ver, '.')) != 1) then - return false; -end if; -if (a.ver = b.ver) then - if (a.versuffix != b.versuffix and b.versuffix != '@') then - return false; - end if; - if (a.suffix != b.suffix and b.suffix != 0) then - return false; - end if; - if (a.suffixnum != b.suffixnum and b.suffixnum != 0) then - return false; - end if; - if (a.revision != b.revision and b.revision != 0) then - return false; - end if; - return true; -else - return ((b.versuffix = '@' - and b.suffix = 0 - and b.suffixnum = 0 - and b.revision = 0) or b is null); -end if; -end -$$; -ALTER FUNCTION gentoobrowse.ebuildversionrange(a ebuildversion, b ebuildversion) OWNER TO gentoo; --- Name: ebuildversiontotext(ebuildversion); Type: FUNCTION; Schema: gentoobrowse; Owner: gentoo -CREATE FUNCTION ebuildversiontotext(v ebuildversion) RETURNS text - LANGUAGE plpgsql - AS $_$ -declare -str text; -begin -str = array_to_string($1.ver, '.'); -if ($1.versuffix != '@') then - str = str || $1.versuffix; -end if; -if ($1.suffix != 0) then -str = str || ( - case - when $1.suffix = -4 then '_alpha' - when $1.suffix = -3 then '_beta' - when $1.suffix = -2 then '_pre' - when $1.suffix = -1 then '_rc' - when $1.suffix = 1 then '_p' - end ); - str = str || $1.suffixnum; -end if; -if ($1.revision != 0) then - str = str || '-r' || $1.revision; -end if; -return str; -end; -$_$; -ALTER FUNCTION gentoobrowse.ebuildversiontotext(v ebuildversion) OWNER TO gentoo; --- Name: namedpackages(text); Type: FUNCTION; Schema: gentoobrowse; Owner: gentoo -CREATE FUNCTION namedpackages(str text) RETURNS text[] - LANGUAGE plpgsql IMMUTABLE - AS $$ -declare - pkgs text[]; - p record; -begin - for p in select regexp_matches(str, '([[:alnum:]]+-[[:alnum:]]+/(?:-?[_[:alpha:]+][[:alnum:]+]+)+)', 'g') as p - loop - pkgs = array_append(pkgs, p.p[1]); - end loop; - return pkgs; -end -$$; -ALTER FUNCTION gentoobrowse.namedpackages(str text) OWNER TO gentoo; --- Name: packages; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE packages ( - packageid integer NOT NULL, - categoryid integer NOT NULL, - name text NOT NULL, - firstseen timestamp without time zone DEFAULT now() NOT NULL, - description text NOT NULL, - summary text, - maintainer text, - herd text, - image text, - maintainername text -); -ALTER TABLE packages OWNER TO gentoo; --- Name: TABLE packages; Type: COMMENT; Schema: gentoobrowse; Owner: gentoo -COMMENT ON TABLE packages IS 'Packages as summarised from their ebuilds'; --- Name: packagefts(packages); Type: FUNCTION; Schema: gentoobrowse; Owner: gentoo -CREATE FUNCTION packagefts(p packages) RETURNS tsvector - LANGUAGE plpgsql IMMUTABLE - AS $$ -BEGIN - RETURN (SETWEIGHT(TO_TSVECTOR('english', p.name), 'A') || - SETWEIGHT(TO_TSVECTOR('english', p.description), 'B') || - SETWEIGHT(TO_TSVECTOR('english', COALESCE(p.summary, '')), 'C')); -END -$$; -ALTER FUNCTION gentoobrowse.packagefts(p packages) OWNER TO gentoo; --- Name: pathpartsmatchesspecs(text[], filterspec[]); Type: FUNCTION; Schema: gentoobrowse; Owner: gentoo -CREATE FUNCTION pathpartsmatchesspecs(pathparts text[], spec filterspec[]) RETURNS boolean - LANGUAGE plpgsql - AS $$ -DECLARE - i integer; - p integer; -BEGIN - p := array_upper(pathparts, 1); - FOR i IN 1 .. array_upper(spec, 1) LOOP - IF (p < spec[i].part) THEN RETURN FALSE; END IF; - IF (spec[i].part <= 0) THEN - IF (pathparts[p - spec[i].part] NOT LIKE spec[i].pattern) THEN RETURN FALSE; END IF; - ELSE - IF (pathparts[spec[i].part] NOT LIKE spec[i].pattern) THEN RETURN FALSE; END IF; - END IF; - END LOOP; - RETURN TRUE; -END; -$$; -ALTER FUNCTION gentoobrowse.pathpartsmatchesspecs(pathparts text[], spec filterspec[]) OWNER TO gentoo; --- Name: sum(tsvector); Type: AGGREGATE; Schema: gentoobrowse; Owner: postgres -CREATE AGGREGATE sum(tsvector) ( - SFUNC = tsvector_concat, - STYPE = tsvector -); -ALTER AGGREGATE gentoobrowse.sum(tsvector) OWNER TO postgres; --- Name: ~; Type: OPERATOR; Schema: gentoobrowse; Owner: gentoo -CREATE OPERATOR ~ ( - PROCEDURE = ebuildversionrange, - LEFTARG = ebuildversion, - RIGHTARG = ebuildversion -); -ALTER OPERATOR gentoobrowse.~ (ebuildversion, ebuildversion) OWNER TO gentoo; --- Name: ~; Type: OPERATOR; Schema: gentoobrowse; Owner: gentoo -CREATE OPERATOR ~ ( - PROCEDURE = pathpartsmatchesspecs, - LEFTARG = text[], - RIGHTARG = filterspec[] -); -ALTER OPERATOR gentoobrowse.~ (text[], filterspec[]) OWNER TO gentoo; --- Name: categories; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE categories ( - categoryid integer NOT NULL, - name text, - summary text -); -ALTER TABLE categories OWNER TO gentoo; --- Name: TABLE categories; Type: COMMENT; Schema: gentoobrowse; Owner: gentoo -COMMENT ON TABLE categories IS 'Gentoo defined package categories'; --- Name: ebuild_archs; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE ebuild_archs ( - ebuildid integer NOT NULL, - arch text NOT NULL -); -ALTER TABLE ebuild_archs OWNER TO gentoo; --- Name: TABLE ebuild_archs; Type: COMMENT; Schema: gentoobrowse; Owner: gentoo -COMMENT ON TABLE ebuild_archs IS 'Architectures an ebuild is suitable for'; --- Name: ebuild_deps; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE ebuild_deps ( - ebuildid integer NOT NULL, - packageid integer NOT NULL, - versionspec text NOT NULL, - flags text NOT NULL, - op character varying(4) NOT NULL, - slot text NOT NULL -); -ALTER TABLE ebuild_deps OWNER TO gentoo; --- Name: TABLE ebuild_deps; Type: COMMENT; Schema: gentoobrowse; Owner: gentoo -COMMENT ON TABLE ebuild_deps IS 'The dependencies of ebuilds (includes blocks, etc)'; --- Name: ebuild_masks; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE ebuild_masks ( - setno integer NOT NULL, - ebuildid integer NOT NULL -); -ALTER TABLE ebuild_masks OWNER TO gentoo; --- Name: ebuild_rdeps; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE ebuild_rdeps ( - ebuildid integer NOT NULL, - packageid integer NOT NULL, - versionspec text NOT NULL, - flags text NOT NULL, - op character varying(4) NOT NULL, - slot text NOT NULL -); -ALTER TABLE ebuild_rdeps OWNER TO gentoo; --- Name: ebuild_uses; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE ebuild_uses ( - ebuildid integer NOT NULL, - use text NOT NULL -); -ALTER TABLE ebuild_uses OWNER TO gentoo; --- Name: TABLE ebuild_uses; Type: COMMENT; Schema: gentoobrowse; Owner: gentoo -COMMENT ON TABLE ebuild_uses IS 'Use flags affecting ebuilds'; --- Name: ebuilds; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE ebuilds ( - ebuildid integer NOT NULL, - packageid integer NOT NULL, - version text NOT NULL, - versioninst ebuildversion NOT NULL, - slot text NOT NULL, - license text, - firstseen timestamp without time zone NOT NULL, - moddate timestamp without time zone NOT NULL, - repoid integer NOT NULL -); -ALTER TABLE ebuilds OWNER TO gentoo; --- Name: TABLE ebuilds; Type: COMMENT; Schema: gentoobrowse; Owner: gentoo -COMMENT ON TABLE ebuilds IS 'Ebuilds :-)'; --- Name: files; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE files ( - filename text NOT NULL, - fileid integer NOT NULL, - moddate timestamp without time zone NOT NULL, - firstseen timestamp without time zone DEFAULT now() NOT NULL, - cachedat timestamp without time zone, - filetypeid integer NOT NULL, - repoid integer NOT NULL, - filesize integer NOT NULL, - pathparts text[] NOT NULL, - encoding text -); -ALTER TABLE files OWNER TO gentoo; --- Name: filecontent(files); Type: FUNCTION; Schema: gentoobrowse; Owner: gentoo -CREATE FUNCTION filecontent(f files) RETURNS text - LANGUAGE plpgsql IMMUTABLE - AS $$ -begin - return CONVERT_FROM(PG_READ_BINARY_FILE(f.filename), COALESCE(f.encoding, 'utf-8')); -end -$$; -ALTER FUNCTION gentoobrowse.filecontent(f files) OWNER TO gentoo; --- Name: filetypes; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE filetypes ( - filetypeid integer NOT NULL, - description text NOT NULL, - spec filterspec[] NOT NULL -); -ALTER TABLE filetypes OWNER TO gentoo; --- Name: TABLE filetypes; Type: COMMENT; Schema: gentoobrowse; Owner: gentoo -COMMENT ON TABLE filetypes IS 'What kind of file is this?... metadata, changelog, etc'; --- Name: license; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE license ( - name text NOT NULL, - legalbumph text NOT NULL -); -ALTER TABLE license OWNER TO gentoo; --- Name: masksets; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE masksets ( - setno integer NOT NULL, - person text, - email text NOT NULL, - dateadded date NOT NULL, - message text NOT NULL, - n smallint NOT NULL -); -ALTER TABLE masksets OWNER TO gentoo; --- Name: masksets_setno_seq; Type: SEQUENCE; Schema: gentoobrowse; Owner: gentoo -CREATE SEQUENCE masksets_setno_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; -ALTER TABLE masksets_setno_seq OWNER TO gentoo; --- Name: masksets_setno_seq; Type: SEQUENCE OWNED BY; Schema: gentoobrowse; Owner: gentoo -ALTER SEQUENCE masksets_setno_seq OWNED BY masksets.setno; --- Name: news; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE news ( - newsid text NOT NULL, - title text NOT NULL, - posted date NOT NULL, - authorname text, - authoremail text, - atomspec text[], - body text[] NOT NULL, - urls text[] -); -ALTER TABLE news OWNER TO gentoo; --- Name: newsfts(news); Type: FUNCTION; Schema: gentoobrowse; Owner: gentoo -CREATE FUNCTION newsfts(n news) RETURNS tsvector - LANGUAGE plpgsql IMMUTABLE - AS $$ -BEGIN - RETURN SUM(t) FROM (SELECT TO_TSVECTOR('english', UNNEST(n.body)) t) a; -END -$$; -ALTER FUNCTION gentoobrowse.newsfts(n news) OWNER TO gentoo; --- Name: package_bugs; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE package_bugs ( - packageid integer NOT NULL, - bugid integer NOT NULL, - firstseen timestamp without time zone DEFAULT now() NOT NULL -); -ALTER TABLE package_bugs OWNER TO gentoo; --- Name: TABLE package_bugs; Type: COMMENT; Schema: gentoobrowse; Owner: gentoo -COMMENT ON TABLE package_bugs IS 'Association of bugs to products by bug description'; --- Name: package_changelogs; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE package_changelogs ( - packageid integer NOT NULL, - date date NOT NULL, - n smallint NOT NULL, - person text, - email text, - comment text, - repoid integer NOT NULL -); -ALTER TABLE package_changelogs OWNER TO gentoo; --- Name: package_urls; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE package_urls ( - packageid integer NOT NULL, - url text NOT NULL -); -ALTER TABLE package_urls OWNER TO gentoo; --- Name: TABLE package_urls; Type: COMMENT; Schema: gentoobrowse; Owner: gentoo -COMMENT ON TABLE package_urls IS 'URLs associated with a given package'; --- Name: repos; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE repos ( - repoid integer NOT NULL, - name text NOT NULL -); -ALTER TABLE repos OWNER TO gentoo; --- Name: repos_repoid_seq; Type: SEQUENCE; Schema: gentoobrowse; Owner: gentoo -CREATE SEQUENCE repos_repoid_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; -ALTER TABLE repos_repoid_seq OWNER TO gentoo; --- Name: repos_repoid_seq; Type: SEQUENCE OWNED BY; Schema: gentoobrowse; Owner: gentoo -ALTER SEQUENCE repos_repoid_seq OWNED BY repos.repoid; --- Name: seq_categoryid; Type: SEQUENCE; Schema: gentoobrowse; Owner: gentoo -CREATE SEQUENCE seq_categoryid - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; -ALTER TABLE seq_categoryid OWNER TO gentoo; --- Name: seq_categoryid; Type: SEQUENCE OWNED BY; Schema: gentoobrowse; Owner: gentoo -ALTER SEQUENCE seq_categoryid OWNED BY categories.categoryid; --- Name: seq_fileid; Type: SEQUENCE; Schema: gentoobrowse; Owner: gentoo -CREATE SEQUENCE seq_fileid - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; -ALTER TABLE seq_fileid OWNER TO gentoo; --- Name: seq_fileid; Type: SEQUENCE OWNED BY; Schema: gentoobrowse; Owner: gentoo -ALTER SEQUENCE seq_fileid OWNED BY files.fileid; --- Name: seq_packageid; Type: SEQUENCE; Schema: gentoobrowse; Owner: gentoo -CREATE SEQUENCE seq_packageid - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; -ALTER TABLE seq_packageid OWNER TO gentoo; --- Name: seq_packageid; Type: SEQUENCE OWNED BY; Schema: gentoobrowse; Owner: gentoo -ALTER SEQUENCE seq_packageid OWNED BY packages.packageid; --- Name: use_global; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE use_global ( - use text NOT NULL, - description text -); -ALTER TABLE use_global OWNER TO gentoo; --- Name: use_group; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE use_group ( - usegroupid integer NOT NULL, - use text NOT NULL, - description text NOT NULL -); -ALTER TABLE use_group OWNER TO gentoo; --- Name: use_groups; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE use_groups ( - usegroupid integer NOT NULL, - name text NOT NULL -); -ALTER TABLE use_groups OWNER TO gentoo; --- Name: use_groups_usegroupid_seq; Type: SEQUENCE; Schema: gentoobrowse; Owner: gentoo -CREATE SEQUENCE use_groups_usegroupid_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; -ALTER TABLE use_groups_usegroupid_seq OWNER TO gentoo; --- Name: use_groups_usegroupid_seq; Type: SEQUENCE OWNED BY; Schema: gentoobrowse; Owner: gentoo -ALTER SEQUENCE use_groups_usegroupid_seq OWNED BY use_groups.usegroupid; --- Name: use_local; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE use_local ( - packageid integer NOT NULL, - use text NOT NULL, - description text NOT NULL -); -ALTER TABLE use_local OWNER TO gentoo; --- Name: user_ebuild_emails; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE user_ebuild_emails ( - userid integer NOT NULL, - ebuildid integer NOT NULL, - sentat timestamp without time zone NOT NULL -); -ALTER TABLE user_ebuild_emails OWNER TO gentoo; --- Name: user_packages; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE user_packages ( - userid integer NOT NULL, - packageid integer NOT NULL, - trackedsince timestamp without time zone DEFAULT now() NOT NULL -); -ALTER TABLE user_packages OWNER TO gentoo; --- Name: TABLE user_packages; Type: COMMENT; Schema: gentoobrowse; Owner: gentoo -COMMENT ON TABLE user_packages IS 'Lists packages that registered users are interested in'; --- Name: users; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE TABLE users ( - userid integer NOT NULL, - username text NOT NULL, - userrealname text NOT NULL, - userpassword text NOT NULL, - useremail text NOT NULL, - verifyguid uuid -); -ALTER TABLE users OWNER TO gentoo; --- Name: TABLE users; Type: COMMENT; Schema: gentoobrowse; Owner: gentoo -COMMENT ON TABLE users IS 'Registered users'; --- Name: users_userid_seq; Type: SEQUENCE; Schema: gentoobrowse; Owner: gentoo -CREATE SEQUENCE users_userid_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; -ALTER TABLE users_userid_seq OWNER TO gentoo; --- Name: users_userid_seq; Type: SEQUENCE OWNED BY; Schema: gentoobrowse; Owner: gentoo -ALTER SEQUENCE users_userid_seq OWNED BY users.userid; --- Name: categoryid; Type: DEFAULT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY categories ALTER COLUMN categoryid SET DEFAULT nextval('seq_categoryid'::regclass); --- Name: fileid; Type: DEFAULT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY files ALTER COLUMN fileid SET DEFAULT nextval('seq_fileid'::regclass); --- Name: setno; Type: DEFAULT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY masksets ALTER COLUMN setno SET DEFAULT nextval('masksets_setno_seq'::regclass); --- Name: packageid; Type: DEFAULT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY packages ALTER COLUMN packageid SET DEFAULT nextval('seq_packageid'::regclass); --- Name: repoid; Type: DEFAULT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY repos ALTER COLUMN repoid SET DEFAULT nextval('repos_repoid_seq'::regclass); --- Name: usegroupid; Type: DEFAULT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY use_groups ALTER COLUMN usegroupid SET DEFAULT nextval('use_groups_usegroupid_seq'::regclass); --- Name: userid; Type: DEFAULT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY users ALTER COLUMN userid SET DEFAULT nextval('users_userid_seq'::regclass); --- Name: license_pkey; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY license - ADD CONSTRAINT license_pkey PRIMARY KEY (name); --- Name: pk_bugs; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY bugs - ADD CONSTRAINT pk_bugs PRIMARY KEY (bugid); --- Name: pk_ebuild; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY ebuilds - ADD CONSTRAINT pk_ebuild PRIMARY KEY (ebuildid); --- Name: pk_ebuildarch; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY ebuild_archs - ADD CONSTRAINT pk_ebuildarch PRIMARY KEY (ebuildid, arch); -ALTER TABLE ebuild_archs CLUSTER ON pk_ebuildarch; --- Name: pk_ebuilddeps; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY ebuild_deps - ADD CONSTRAINT pk_ebuilddeps PRIMARY KEY (ebuildid, packageid, versionspec, flags, slot, op); -ALTER TABLE ebuild_deps CLUSTER ON pk_ebuilddeps; --- Name: pk_ebuildmasks; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY ebuild_masks - ADD CONSTRAINT pk_ebuildmasks PRIMARY KEY (ebuildid, setno); --- Name: pk_ebuildrdeps; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY ebuild_rdeps - ADD CONSTRAINT pk_ebuildrdeps PRIMARY KEY (ebuildid, packageid, versionspec, flags, slot, op); -ALTER TABLE ebuild_rdeps CLUSTER ON pk_ebuildrdeps; --- Name: pk_ebuilduses; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY ebuild_uses - ADD CONSTRAINT pk_ebuilduses PRIMARY KEY (ebuildid, use); -ALTER TABLE ebuild_uses CLUSTER ON pk_ebuilduses; --- Name: pk_fileclass; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY filetypes - ADD CONSTRAINT pk_fileclass PRIMARY KEY (filetypeid); --- Name: pk_files; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY files - ADD CONSTRAINT pk_files PRIMARY KEY (fileid); --- Name: pk_news; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY news - ADD CONSTRAINT pk_news PRIMARY KEY (newsid); --- Name: pk_package_changelogs; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY package_changelogs - ADD CONSTRAINT pk_package_changelogs PRIMARY KEY (packageid, date, n, repoid); -ALTER TABLE package_changelogs CLUSTER ON pk_package_changelogs; --- Name: pk_packagebugs; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY package_bugs - ADD CONSTRAINT pk_packagebugs PRIMARY KEY (packageid, bugid); -ALTER TABLE package_bugs CLUSTER ON pk_packagebugs; --- Name: pk_packagemasksets; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY masksets - ADD CONSTRAINT pk_packagemasksets PRIMARY KEY (setno); --- Name: pk_packages; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY packages - ADD CONSTRAINT pk_packages PRIMARY KEY (packageid); --- Name: pk_pkggroup; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY categories - ADD CONSTRAINT pk_pkggroup PRIMARY KEY (categoryid); --- Name: pk_pkgurls; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY package_urls - ADD CONSTRAINT pk_pkgurls PRIMARY KEY (packageid, url); -ALTER TABLE package_urls CLUSTER ON pk_pkgurls; --- Name: pk_usegroup; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY use_groups - ADD CONSTRAINT pk_usegroup PRIMARY KEY (usegroupid); --- Name: pk_userebuildemails; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY user_ebuild_emails - ADD CONSTRAINT pk_userebuildemails PRIMARY KEY (userid, ebuildid); --- Name: pk_userpackages; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY user_packages - ADD CONSTRAINT pk_userpackages PRIMARY KEY (userid, packageid); -ALTER TABLE user_packages CLUSTER ON pk_userpackages; --- Name: pk_users; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY users - ADD CONSTRAINT pk_users PRIMARY KEY (userid); --- Name: repos_pkey; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY repos - ADD CONSTRAINT repos_pkey PRIMARY KEY (repoid); --- Name: uni_ebuild_pkgverrepo; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY ebuilds - ADD CONSTRAINT uni_ebuild_pkgverrepo UNIQUE (packageid, version, repoid); -ALTER TABLE ebuilds CLUSTER ON uni_ebuild_pkgverrepo; --- Name: uni_files_filename; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY files - ADD CONSTRAINT uni_files_filename UNIQUE (filename); --- Name: uni_pkg_name; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY packages - ADD CONSTRAINT uni_pkg_name UNIQUE (categoryid, name); -ALTER TABLE packages CLUSTER ON uni_pkg_name; --- Name: uni_pkggroup_group; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY categories - ADD CONSTRAINT uni_pkggroup_group UNIQUE (name); --- Name: uni_useremail; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY users - ADD CONSTRAINT uni_useremail UNIQUE (useremail); --- Name: uni_username; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY users - ADD CONSTRAINT uni_username UNIQUE (username); --- Name: use_global_pkey; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY use_global - ADD CONSTRAINT use_global_pkey PRIMARY KEY (use); --- Name: use_group_pkey; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY use_group - ADD CONSTRAINT use_group_pkey PRIMARY KEY (usegroupid, use); --- Name: use_local_pkey; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: -ALTER TABLE ONLY use_local - ADD CONSTRAINT use_local_pkey PRIMARY KEY (packageid, use); -ALTER TABLE use_local CLUSTER ON use_local_pkey; --- Name: idx_bug_fts; Type: INDEX; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE INDEX idx_bug_fts ON bugs USING gin (bugfts(bugs.*)); --- Name: idx_bugs_firstseen; Type: INDEX; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE INDEX idx_bugs_firstseen ON bugs USING btree (firstseen DESC); --- Name: idx_bugs_summarypackages; Type: INDEX; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE INDEX idx_bugs_summarypackages ON bugs USING gin (namedpackages(summary)); --- Name: idx_ebuilddeps_package; Type: INDEX; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE INDEX idx_ebuilddeps_package ON ebuild_deps USING btree (packageid); --- Name: idx_ebuildrdeps_package; Type: INDEX; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE INDEX idx_ebuildrdeps_package ON ebuild_rdeps USING btree (packageid); --- Name: idx_ebuilds_firstseen; Type: INDEX; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE INDEX idx_ebuilds_firstseen ON ebuilds USING btree (firstseen); --- Name: idx_ebuilduses_use; Type: INDEX; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE INDEX idx_ebuilduses_use ON ebuild_uses USING btree (use); --- Name: idx_news_fts; Type: INDEX; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE INDEX idx_news_fts ON news USING gin (newsfts(news.*)); --- Name: idx_news_posted; Type: INDEX; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE INDEX idx_news_posted ON news USING btree (posted); --- Name: idx_package_name; Type: INDEX; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE INDEX idx_package_name ON packages USING btree (name); --- Name: idx_packagebugs_bug; Type: INDEX; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE INDEX idx_packagebugs_bug ON package_bugs USING btree (bugid); --- Name: idx_packages_fts; Type: INDEX; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE INDEX idx_packages_fts ON packages USING gin (packagefts(packages.*)); --- Name: idx_packages_herd; Type: INDEX; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE INDEX idx_packages_herd ON packages USING btree (herd); --- Name: idx_uselocal_use; Type: INDEX; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE INDEX idx_uselocal_use ON use_local USING btree (use); --- Name: idx_userpackages_package; Type: INDEX; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE INDEX idx_userpackages_package ON user_packages USING btree (packageid); --- Name: uni_masksets_dateaddedn; Type: INDEX; Schema: gentoobrowse; Owner: gentoo; Tablespace: -CREATE INDEX uni_masksets_dateaddedn ON masksets USING btree (dateadded, n); --- Name: fk_ebuild_pkg; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY ebuilds - ADD CONSTRAINT fk_ebuild_pkg FOREIGN KEY (packageid) REFERENCES packages(packageid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_ebuild_repo; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY ebuilds - ADD CONSTRAINT fk_ebuild_repo FOREIGN KEY (repoid) REFERENCES repos(repoid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_ebuildarch_file; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY ebuild_archs - ADD CONSTRAINT fk_ebuildarch_file FOREIGN KEY (ebuildid) REFERENCES ebuilds(ebuildid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_ebuilddeps_ebuild; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY ebuild_deps - ADD CONSTRAINT fk_ebuilddeps_ebuild FOREIGN KEY (ebuildid) REFERENCES ebuilds(ebuildid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_ebuilddeps_pkg; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY ebuild_deps - ADD CONSTRAINT fk_ebuilddeps_pkg FOREIGN KEY (packageid) REFERENCES packages(packageid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_ebuildmasks_ebuild; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY ebuild_masks - ADD CONSTRAINT fk_ebuildmasks_ebuild FOREIGN KEY (ebuildid) REFERENCES ebuilds(ebuildid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_ebuildmasks_maskset; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY ebuild_masks - ADD CONSTRAINT fk_ebuildmasks_maskset FOREIGN KEY (setno) REFERENCES masksets(setno) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_ebuildrdeps_ebuild; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY ebuild_rdeps - ADD CONSTRAINT fk_ebuildrdeps_ebuild FOREIGN KEY (ebuildid) REFERENCES ebuilds(ebuildid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_ebuildrdeps_pkg; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY ebuild_rdeps - ADD CONSTRAINT fk_ebuildrdeps_pkg FOREIGN KEY (packageid) REFERENCES packages(packageid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_ebuilduses_file; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY ebuild_uses - ADD CONSTRAINT fk_ebuilduses_file FOREIGN KEY (ebuildid) REFERENCES ebuilds(ebuildid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_files_type; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY files - ADD CONSTRAINT fk_files_type FOREIGN KEY (filetypeid) REFERENCES filetypes(filetypeid) ON UPDATE CASCADE; --- Name: fk_packagebugs_bug; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY package_bugs - ADD CONSTRAINT fk_packagebugs_bug FOREIGN KEY (bugid) REFERENCES bugs(bugid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_packagebugs_package; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY package_bugs - ADD CONSTRAINT fk_packagebugs_package FOREIGN KEY (packageid) REFERENCES packages(packageid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_packagechangelogs_package; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY package_changelogs - ADD CONSTRAINT fk_packagechangelogs_package FOREIGN KEY (packageid) REFERENCES packages(packageid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_packagechangelogs_repo; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY package_changelogs - ADD CONSTRAINT fk_packagechangelogs_repo FOREIGN KEY (repoid) REFERENCES repos(repoid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_packageurls_package; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY package_urls - ADD CONSTRAINT fk_packageurls_package FOREIGN KEY (packageid) REFERENCES packages(packageid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_pkg_grp; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY packages - ADD CONSTRAINT fk_pkg_grp FOREIGN KEY (categoryid) REFERENCES categories(categoryid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_pkgurls_pkg; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY package_urls - ADD CONSTRAINT fk_pkgurls_pkg FOREIGN KEY (packageid) REFERENCES packages(packageid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_usegroup_groupid; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY use_group - ADD CONSTRAINT fk_usegroup_groupid FOREIGN KEY (usegroupid) REFERENCES use_groups(usegroupid) ON DELETE CASCADE; --- Name: fk_uselocal_package; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY use_local - ADD CONSTRAINT fk_uselocal_package FOREIGN KEY (packageid) REFERENCES packages(packageid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_userebuildemails_ebuild; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY user_ebuild_emails - ADD CONSTRAINT fk_userebuildemails_ebuild FOREIGN KEY (ebuildid) REFERENCES ebuilds(ebuildid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_userebuildemails_user; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY user_ebuild_emails - ADD CONSTRAINT fk_userebuildemails_user FOREIGN KEY (userid) REFERENCES users(userid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_userpackage_package; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY user_packages - ADD CONSTRAINT fk_userpackage_package FOREIGN KEY (packageid) REFERENCES packages(packageid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_userpackage_user; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY user_packages - ADD CONSTRAINT fk_userpackage_user FOREIGN KEY (userid) REFERENCES users(userid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: fk_userpackages_package; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo -ALTER TABLE ONLY user_packages - ADD CONSTRAINT fk_userpackages_package FOREIGN KEY (packageid) REFERENCES packages(packageid) ON UPDATE CASCADE ON DELETE CASCADE; --- Name: gentoobrowse; Type: ACL; Schema: -; Owner: gentoo -REVOKE ALL ON SCHEMA gentoobrowse FROM PUBLIC; -REVOKE ALL ON SCHEMA gentoobrowse FROM gentoo; -GRANT USAGE ON SCHEMA gentoobrowse TO apache; -GRANT USAGE ON SCHEMA gentoobrowse TO gentoo; --- Name: bugs; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE bugs FROM PUBLIC; -REVOKE ALL ON TABLE bugs FROM gentoo; -GRANT ALL ON TABLE bugs TO gentoo; -GRANT SELECT ON TABLE bugs TO apache; --- Name: packages; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE packages FROM PUBLIC; -REVOKE ALL ON TABLE packages FROM gentoo; -GRANT ALL ON TABLE packages TO gentoo; -GRANT SELECT ON TABLE packages TO apache; --- Name: categories; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE categories FROM PUBLIC; -REVOKE ALL ON TABLE categories FROM gentoo; -GRANT ALL ON TABLE categories TO gentoo; -GRANT SELECT ON TABLE categories TO apache; --- Name: ebuild_archs; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE ebuild_archs FROM PUBLIC; -REVOKE ALL ON TABLE ebuild_archs FROM gentoo; -GRANT ALL ON TABLE ebuild_archs TO gentoo; -GRANT SELECT ON TABLE ebuild_archs TO apache; --- Name: ebuild_deps; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE ebuild_deps FROM PUBLIC; -REVOKE ALL ON TABLE ebuild_deps FROM gentoo; -GRANT ALL ON TABLE ebuild_deps TO gentoo; -GRANT SELECT ON TABLE ebuild_deps TO apache; --- Name: ebuild_masks; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE ebuild_masks FROM PUBLIC; -REVOKE ALL ON TABLE ebuild_masks FROM gentoo; -GRANT ALL ON TABLE ebuild_masks TO gentoo; -GRANT SELECT ON TABLE ebuild_masks TO apache; --- Name: ebuild_rdeps; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE ebuild_rdeps FROM PUBLIC; -REVOKE ALL ON TABLE ebuild_rdeps FROM gentoo; -GRANT ALL ON TABLE ebuild_rdeps TO gentoo; -GRANT SELECT ON TABLE ebuild_rdeps TO apache; --- Name: ebuild_uses; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE ebuild_uses FROM PUBLIC; -REVOKE ALL ON TABLE ebuild_uses FROM gentoo; -GRANT ALL ON TABLE ebuild_uses TO gentoo; -GRANT SELECT ON TABLE ebuild_uses TO apache; --- Name: ebuilds; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE ebuilds FROM PUBLIC; -REVOKE ALL ON TABLE ebuilds FROM gentoo; -GRANT ALL ON TABLE ebuilds TO gentoo; -GRANT SELECT ON TABLE ebuilds TO apache; --- Name: files; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE files FROM PUBLIC; -REVOKE ALL ON TABLE files FROM gentoo; -GRANT ALL ON TABLE files TO gentoo; -GRANT SELECT ON TABLE files TO apache; --- Name: filetypes; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE filetypes FROM PUBLIC; -REVOKE ALL ON TABLE filetypes FROM gentoo; -GRANT ALL ON TABLE filetypes TO gentoo; -GRANT SELECT ON TABLE filetypes TO apache; --- Name: masksets; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE masksets FROM PUBLIC; -REVOKE ALL ON TABLE masksets FROM gentoo; -GRANT ALL ON TABLE masksets TO gentoo; -GRANT SELECT ON TABLE masksets TO apache; --- Name: package_bugs; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE package_bugs FROM PUBLIC; -REVOKE ALL ON TABLE package_bugs FROM gentoo; -GRANT ALL ON TABLE package_bugs TO gentoo; -GRANT SELECT ON TABLE package_bugs TO apache; --- Name: package_changelogs; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE package_changelogs FROM PUBLIC; -REVOKE ALL ON TABLE package_changelogs FROM gentoo; -GRANT ALL ON TABLE package_changelogs TO gentoo; -GRANT SELECT ON TABLE package_changelogs TO apache; --- Name: package_urls; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE package_urls FROM PUBLIC; -REVOKE ALL ON TABLE package_urls FROM gentoo; -GRANT ALL ON TABLE package_urls TO gentoo; -GRANT SELECT ON TABLE package_urls TO apache; --- Name: repos; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE repos FROM PUBLIC; -REVOKE ALL ON TABLE repos FROM gentoo; -GRANT ALL ON TABLE repos TO gentoo; -GRANT SELECT ON TABLE repos TO apache; --- Name: use_global; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE use_global FROM PUBLIC; -REVOKE ALL ON TABLE use_global FROM gentoo; -GRANT ALL ON TABLE use_global TO gentoo; -GRANT SELECT ON TABLE use_global TO apache; --- Name: use_group; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE use_group FROM PUBLIC; -REVOKE ALL ON TABLE use_group FROM gentoo; -GRANT ALL ON TABLE use_group TO gentoo; -GRANT SELECT ON TABLE use_group TO apache; --- Name: use_groups; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE use_groups FROM PUBLIC; -REVOKE ALL ON TABLE use_groups FROM gentoo; -GRANT ALL ON TABLE use_groups TO gentoo; -GRANT SELECT ON TABLE use_groups TO apache; --- Name: use_local; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE use_local FROM PUBLIC; -REVOKE ALL ON TABLE use_local FROM gentoo; -GRANT ALL ON TABLE use_local TO gentoo; -GRANT SELECT ON TABLE use_local TO apache; --- Name: user_ebuild_emails; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE user_ebuild_emails FROM PUBLIC; -REVOKE ALL ON TABLE user_ebuild_emails FROM gentoo; -GRANT ALL ON TABLE user_ebuild_emails TO gentoo; -GRANT SELECT ON TABLE user_ebuild_emails TO apache; --- Name: user_packages; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE user_packages FROM PUBLIC; -REVOKE ALL ON TABLE user_packages FROM gentoo; -GRANT ALL ON TABLE user_packages TO gentoo; -GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE user_packages TO apache; --- Name: users; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON TABLE users FROM PUBLIC; -REVOKE ALL ON TABLE users FROM gentoo; -GRANT ALL ON TABLE users TO gentoo; -GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE users TO apache; --- Name: users_userid_seq; Type: ACL; Schema: gentoobrowse; Owner: gentoo -REVOKE ALL ON SEQUENCE users_userid_seq FROM PUBLIC; -REVOKE ALL ON SEQUENCE users_userid_seq FROM gentoo; -GRANT ALL ON SEQUENCE users_userid_seq TO gentoo; -GRANT ALL ON SEQUENCE users_userid_seq TO apache; --- PostgreSQL database dump complete diff --git a/gentoobrowse/emails/.htaccess b/gentoobrowse/emails/.htaccess deleted file mode 100644 index e13f618..0000000 --- a/gentoobrowse/emails/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Order allow,deny diff --git a/gentoobrowse/emails/base.xslt b/gentoobrowse/emails/base.xslt deleted file mode 100644 index a8ceaac..0000000 --- a/gentoobrowse/emails/base.xslt +++ /dev/null @@ -1,69 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:project2="http://project2.randomdan.homeip.net" exclude-result-prefixes="project2" > - <xsl:output encoding="utf-8" method="html" media-type="text/html" indent="yes" /> - - <xsl:template match="/*"> - <xsl:text disable-output-escaping="yes"><!DOCTYPE html> </xsl:text> - <html lang="en"> - <head> - <meta charset="utf-8" /> - <link href="http://gentoobrowse.randomdan.homeip.net/css/bootstrap.min.css" rel="stylesheet" media="screen" /> - <link href="http://gentoobrowse.randomdan.homeip.net/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen" /> - <link href="http://gentoobrowse.randomdan.homeip.net/css/general.css" rel="stylesheet" media="screen" /> - <xsl:call-template name="head" /> - </head> - <body data-spy="scroll" data-target=".bs-docs-sidebar"> - <!-- nav --> - <nav class="navbar navbar-inverse navbar-fixed-top"> - <div class="navbar-inner"> - <div class="container"> - <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - </button> - <a class="brand" href="http://gentoobrowse.randomdan.homeip.net/">Gentoo Browse</a> - <div class="nav-collapse collapse"> - <ul class="nav"> - <li><a href="http://gentoobrowse.randomdan.homeip.net/">Home</a></li> - <li><a href="http://gentoobrowse.randomdan.homeip.net/categories">Browse</a></li> - <li><a href="http://gentoobrowse.randomdan.homeip.net/popular">Popular</a></li> - </ul> - </div> - </div> - </div> - </nav> - - <!-- page content --> - <header class="jumbotron subhead"> - <div class="container"> - <xsl:call-template name="header" /> - </div> - </header> - <div class="container"> - <article class="row"> - <xsl:call-template name="content" /> - </article> - </div> - - <!-- footer --> - <footer class="footer"> - <div class="container"> - <p>Gentoo Browse is not an official Gentoo website. The name "Gentoo" and the "g" logo are trademarks of the Gentoo Foundation, Inc.</p> - </div> - </footer> - - <script src="http://code.jquery.com/jquery-latest.js"></script> - <script src="http://gentoobrowse.randomdan.homeip.net/js/bootstrap.min.js"></script> - <script src="http://gentoobrowse.randomdan.homeip.net/js/js.js"></script> - </body> - </html> - </xsl:template> - - <xsl:template name="head"> - </xsl:template> - - <xsl:template name="header"> - </xsl:template> -</xsl:stylesheet> diff --git a/gentoobrowse/emails/newpackageversions.xml b/gentoobrowse/emails/newpackageversions.xml deleted file mode 100644 index 08825e3..0000000 --- a/gentoobrowse/emails/newpackageversions.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0"?> -<view root="newpackageversions" style="emails/newpackageversions.xslt" xmlns:xi="http://www.w3.org/2001/XInclude" - xmlns:project2="http://project2.randomdan.homeip.net"> - <project2:sqlrows name="newpackageversions" datasource="postgres"> - <sql> - select ut.cname, ut.pname, ut.version, ut.description - from ( - select e.ebuildid, up.userid, u.useremail, p.name as pname, c.name as cname, e.version, p.description - from ebuilds e, user_packages up, users u, packages p, categories c - where e.packageid = up.packageid - and u.userid = up.userid - and u.userid = <param name="userid" /> - and e.packageid = p.packageid - and c.categoryid = p.categoryid - and e.firstseen > up.trackedsince) as ut left outer join user_ebuild_emails ebe - on ebe.userid = ut.userid and ebe.ebuildid = ut.ebuildid - where ebe.userid is null - order by ut.cname, ut.pname, ut.version - </sql> - </project2:sqlrows> - <project2:autotree name="newpackageversionsforuser" source="newpackageversions"> - <parameters> - <userid source="parent" name="userid" depth="1" /> - </parameters> - <tree rootname="categories" objectname="category"> - <key source="parent" name="cname" /> - <tree rootname="packages" objectname="package"> - <key source="parent" name="pname" /> - <include source="parent" name="description" /> - <tree rootname="versions"> - <key source="parent" name="version" /> - </tree> - </tree> - </tree> - </project2:autotree> -</view> - diff --git a/gentoobrowse/emails/newpackageversions.xslt b/gentoobrowse/emails/newpackageversions.xslt deleted file mode 100644 index 928edd5..0000000 --- a/gentoobrowse/emails/newpackageversions.xslt +++ /dev/null @@ -1,48 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://exslt.org/strings" xmlns:project2="http://project2.randomdan.homeip.net" version="1.0" exclude-result-prefixes="project2 fn"> - <xsl:import href="base.xslt"/> - <xsl:output encoding="utf-8" method="html" media-type="text/html" indent="yes"/> - - <xsl:template name="header"> - <h2>New versions of packages you're tracking.</h2> - </xsl:template> - - <xsl:template name="content"> - <div class="span3 bs-docs-sidebar"> - <ul class="nav nav-list bs-docs-sidenav"> - <xsl:for-each select="categories/category"> - <li> - <a> - <xsl:attribute name="href">#<xsl:value-of select="cname" /></xsl:attribute> - <i class="icon-chevron-right"></i> <xsl:value-of select="cname" /> - </a> - </li> - </xsl:for-each> - </ul> - </div> - <div class="span9"> - <xsl:for-each select="categories//package"> - <section> - <xsl:if test="count(preceding-sibling::package) = 0"> - <xsl:attribute name="id"><xsl:value-of select="../../cname" /></xsl:attribute> - </xsl:if> - <h3> - <xsl:value-of select="../../cname"/> / - <a> - <xsl:attribute name="href">http://gentoobrowse.randomdan.homeip.net/package/<xsl:value-of select="../../cname"/>/<xsl:value-of select="pname"/></xsl:attribute> - <xsl:value-of select="pname"/> - </a> - </h3> - <p> - <xsl:value-of select="description"/> - </p> - <ul> - <xsl:for-each select="versions/version"> - <li><xsl:value-of select="../../../../cname"/>/<xsl:value-of select="../../pname"/>-<xsl:value-of select="."/></li> - </xsl:for-each> - </ul> - </section> - </xsl:for-each> - </div> - </xsl:template> -</xsl:stylesheet> diff --git a/gentoobrowse/emails/signup.xslt b/gentoobrowse/emails/signup.xslt deleted file mode 100644 index d0a0823..0000000 --- a/gentoobrowse/emails/signup.xslt +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:project2="http://project2.randomdan.homeip.net" exclude-result-prefixes="project2" > - <xsl:output encoding="utf-8" method="html" media-type="text/html" indent="yes" - doctype-system="http://www.w3.org/TR/html4/loose.dtd" - doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" /> - <xsl:template match="/signup"> - <html> - <head> - <title>Welcome to Gentoo Browse - - -

Welcome to Gentoo Browse!

-

- Click http://gentoobrowse.randomdan.homeip.net/confirm?verifyguid= - this link to confirm your account. -

-

Or alternatively, copy and paste this code into the confirmation page:

- - - - - diff --git a/gentoobrowse/emails/welcome.xml b/gentoobrowse/emails/welcome.xml deleted file mode 100644 index e245a34..0000000 --- a/gentoobrowse/emails/welcome.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - SELECT userid, CAST(verifyguid AS TEXT) AS guid - FROM users u - WHERE useremail = - AND verifyguid IS NOT NULL - - - - - - - - diff --git a/gentoobrowse/gentoobrowse-cgi b/gentoobrowse/gentoobrowse-cgi new file mode 120000 index 0000000..190d839 --- /dev/null +++ b/gentoobrowse/gentoobrowse-cgi @@ -0,0 +1 @@ +src/bin/gcc-5.4.0/release/allow-ice-yes/slicer-yes/strip-on/gentoobrowse-cgi \ No newline at end of file diff --git a/gentoobrowse/js/pkgtracking.js b/gentoobrowse/js/pkgtracking.js index 1c171b6..523c102 100644 --- a/gentoobrowse/js/pkgtracking.js +++ b/gentoobrowse/js/pkgtracking.js @@ -1,27 +1,20 @@ -function track(pid) +function track() { - xmlhttp = new XMLHttpRequest(); - xmlhttp.open("POST", "/track", false); - xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); - xmlhttp.send("packageid=" + pid); - if (xmlhttp.status == 200) { - toggleTracking(); - } + toggleTracking('PUT'); } -function untrack(pid) +function untrack() { - xmlhttp = new XMLHttpRequest(); - xmlhttp.open("POST", "/untrack", false); - xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); - xmlhttp.send("packageid=" + pid); - if (xmlhttp.status == 200) { - toggleTracking(); - } + toggleTracking('DELETE'); } -function toggleTracking() +function toggleTracking(method) { - $('#dotrack').toggle(); - $('#dountrack').toggle(); + $.ajax(window.location.pathname + '/tracked', { + method: method, + success: function() { + $('#dotrack').toggle(); + $('#dountrack').toggle(); + } + }); } diff --git a/gentoobrowse/present/.htaccess b/gentoobrowse/present/.htaccess deleted file mode 100644 index e13f618..0000000 --- a/gentoobrowse/present/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Order allow,deny diff --git a/gentoobrowse/present/accountHome.xml b/gentoobrowse/present/accountHome.xml deleted file mode 100644 index e28caf8..0000000 --- a/gentoobrowse/present/accountHome.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - -
-

View my tracked packages

- - - diff --git a/gentoobrowse/present/accountTracked.xml b/gentoobrowse/present/accountTracked.xml deleted file mode 100644 index 14eaf2f..0000000 --- a/gentoobrowse/present/accountTracked.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/gentoobrowse/present/atom.xml b/gentoobrowse/present/atom.xml deleted file mode 100644 index 48d12dd..0000000 --- a/gentoobrowse/present/atom.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/gentoobrowse/present/categories.xml b/gentoobrowse/present/categories.xml deleted file mode 100644 index 94f827e..0000000 --- a/gentoobrowse/present/categories.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - diff --git a/gentoobrowse/present/category.xml b/gentoobrowse/present/category.xml deleted file mode 100644 index aed525d..0000000 --- a/gentoobrowse/present/category.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - diff --git a/gentoobrowse/present/confirm.xml b/gentoobrowse/present/confirm.xml deleted file mode 100644 index 98b7240..0000000 --- a/gentoobrowse/present/confirm.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - -

Please enter the confirmation code from your welcome email.

- - - -
-
- - diff --git a/gentoobrowse/present/herd.xml b/gentoobrowse/present/herd.xml deleted file mode 100644 index dca80b5..0000000 --- a/gentoobrowse/present/herd.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - diff --git a/gentoobrowse/present/index.xml b/gentoobrowse/present/index.xml deleted file mode 100644 index 64e62a7..0000000 --- a/gentoobrowse/present/index.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/gentoobrowse/present/login.xml b/gentoobrowse/present/login.xml deleted file mode 100644 index 09a7e37..0000000 --- a/gentoobrowse/present/login.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - -
- - -
- -

- I don't have an account... so I'll signup... -

-
-
-
- diff --git a/gentoobrowse/present/package.xml b/gentoobrowse/present/package.xml deleted file mode 100644 index 4e266e4..0000000 --- a/gentoobrowse/present/package.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/gentoobrowse/present/popular.xml b/gentoobrowse/present/popular.xml deleted file mode 100644 index 9fc59b2..0000000 --- a/gentoobrowse/present/popular.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - diff --git a/gentoobrowse/present/search.xml b/gentoobrowse/present/search.xml deleted file mode 100644 index 3bcb9cb..0000000 --- a/gentoobrowse/present/search.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/gentoobrowse/present/signup.xml b/gentoobrowse/present/signup.xml deleted file mode 100644 index fcf3d8c..0000000 --- a/gentoobrowse/present/signup.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - -
- - - - -
-
-
- diff --git a/gentoobrowse/present/sitemap.xml.xml b/gentoobrowse/present/sitemap.xml.xml deleted file mode 100644 index 900fcc0..0000000 --- a/gentoobrowse/present/sitemap.xml.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - diff --git a/gentoobrowse/present/use.xml b/gentoobrowse/present/use.xml deleted file mode 100644 index 760dc7c..0000000 --- a/gentoobrowse/present/use.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/gentoobrowse/request/.htaccess b/gentoobrowse/request/.htaccess deleted file mode 100644 index e13f618..0000000 --- a/gentoobrowse/request/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Order allow,deny diff --git a/gentoobrowse/request/doconfirm.xml b/gentoobrowse/request/doconfirm.xml deleted file mode 100644 index 2e73a08..0000000 --- a/gentoobrowse/request/doconfirm.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - SELECT COUNT(*) - FROM users - WHERE verifyguid = - - - - - - - - - - - - - - - UPDATE users SET verifyguid = NULL WHERE verifyguid = - - diff --git a/gentoobrowse/request/dologin.xml b/gentoobrowse/request/dologin.xml deleted file mode 100644 index 0bd5517..0000000 --- a/gentoobrowse/request/dologin.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - SELECT COUNT(*) - FROM users - WHERE username = - AND userpassword = - - - - - - - SELECT COUNT(*) - FROM users - WHERE username = - AND verifyguid IS NULL - - - - - - - - - - - - - - - - diff --git a/gentoobrowse/request/dologout.xml b/gentoobrowse/request/dologout.xml deleted file mode 100644 index c83d4f8..0000000 --- a/gentoobrowse/request/dologout.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - diff --git a/gentoobrowse/request/dosignup.xml b/gentoobrowse/request/dosignup.xml deleted file mode 100644 index 5082fe0..0000000 --- a/gentoobrowse/request/dosignup.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - SELECT COUNT(*) - FROM users - WHERE username = - - - - - - - SELECT COUNT(*) - FROM users - WHERE useremail = - - - - - - INSERT INTO users(username, userrealname, userpassword, useremail, verifyguid) - VALUES(, , - , , uuid_generate_v4()) - - - - - - diff --git a/gentoobrowse/request/track.xml b/gentoobrowse/request/track.xml deleted file mode 100644 index 5bd9ae4..0000000 --- a/gentoobrowse/request/track.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - SELECT COUNT(*) - FROM user_packages - WHERE packageid = - AND userid = - - - - - - INSERT INTO user_packages(packageid, userid, trackedsince) VALUES( - , , NOW()) - - - diff --git a/gentoobrowse/request/untrack.xml b/gentoobrowse/request/untrack.xml deleted file mode 100644 index 69acd33..0000000 --- a/gentoobrowse/request/untrack.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - DELETE FROM user_packages - WHERE packageid = - AND userid = - - - - diff --git a/gentoobrowse/robots.txt b/gentoobrowse/robots.txt index bc11640..c2a49f4 100644 --- a/gentoobrowse/robots.txt +++ b/gentoobrowse/robots.txt @@ -1,3 +1,2 @@ -User-agent: * -Allow: / - +User-agent: * +Allow: / diff --git a/gentoobrowse/src/Jamfile.jam b/gentoobrowse/src/Jamfile.jam new file mode 100644 index 0000000..96b77e5 --- /dev/null +++ b/gentoobrowse/src/Jamfile.jam @@ -0,0 +1,59 @@ +import icespider ; + +lib icespider-common ; +lib icespider-xslt : : : : ../..//libxmlpp ; +lib icespider-fcgi ; +lib icespider-filesessions ; +lib adhocutil ; +lib Ice ; +lib IceUtil ; +lib pthread ; +lib boost_system ; +lib slicer ; +lib slicer-json ; +lib slicer-xml ; +lib slicer-db ; +lib gentoobrowse-domain ; +lib gentoobrowse : : + gentoobrowse-api + : : + /usr/share/gentoobrowse-api + /usr/share/slicer/ice + /usr/include/gentoobrowse-api + /usr/include/slicer/db + /usr/include/slicer/slicer + gentoobrowse-domain + slicer-db + ; +lib icespider : : + icespider-core + : : + /usr/include/icespider + /usr/include/slicer + /usr/include/adhocutil + /usr/share/icespider/ice + icespider-common + icespider-xslt + icespider-fcgi + icespider-filesessions + adhocutil + Ice + IceUtil + pthread + slicer + boost_system + yes + ; + +exe gentoobrowse-cgi : + [ glob *.cpp *.ice *.json ] + : + release:-flto=3 + release:-flto=3 + yes + . + icespider + gentoobrowse + slicer-json + slicer-xml + ; diff --git a/gentoobrowse/src/base.cpp b/gentoobrowse/src/base.cpp new file mode 100644 index 0000000..9656a1f --- /dev/null +++ b/gentoobrowse/src/base.cpp @@ -0,0 +1,67 @@ +#ifndef GENTOOBROWSE_BASE_H +#define GENTOOBROWSE_BASE_H + +#include +#include +#include + +namespace GentooBrowse { + ::Gentoo::UserPtr + common::currentUser(const IceSpider::IHttpRequest * request) const + { + if (auto sid = request->getCookieParam("sessionId")) { + if (auto s = prx0->getSession(*sid)) { + auto uid = s->variables.find("userId"); + if (uid != s->variables.end()) { + return prx1->get(boost::lexical_cast(uid->second)); + } + } + } + return nullptr; + } + + void + common::addUser(const IceSpider::IHttpRequest * request, const PageBasePtr & model) const + { + model->user = currentUser(request); + } + + void + common::trimCategories(Gentoo::Categories & categories, const Gentoo::Packages & packages) const + { + std::set ids; + std::transform(packages.begin(), packages.end(), std::inserter(ids, ids.begin()), [](auto p) { + return p->categoryid; + }); + categories.erase(std::remove_if(categories.begin(), categories.end(), [&ids](auto category) { + return ids.find(category->categoryid) == ids.end(); + }), categories.end()); + } + + void + common::trimCategories(Gentoo::Categories & categories, const Gentoo::SearchResultPackages & packages) const + { + std::set ids; + std::transform(packages.begin(), packages.end(), std::inserter(ids, ids.begin()), [](auto p) { + return p->categoryid; + }); + categories.erase(std::remove_if(categories.begin(), categories.end(), [&ids](auto category) { + return ids.find(category->categoryid) == ids.end(); + }), categories.end()); + } + + void + common::trimPackages(Gentoo::Packages & packages, const Gentoo::Ebuilds & ebuilds) const + { + std::set ids; + std::transform(ebuilds.begin(), ebuilds.end(), std::inserter(ids, ids.begin()), [](auto e) { + return e->packageid; + }); + packages.erase(std::remove_if(packages.begin(), packages.end(), [&ids](auto package) { + return ids.find(package->packageid) == ids.end(); + }), packages.end()); + } +} + +#endif + diff --git a/gentoobrowse/src/base.json b/gentoobrowse/src/base.json new file mode 100644 index 0000000..c1164ee --- /dev/null +++ b/gentoobrowse/src/base.json @@ -0,0 +1,21 @@ +{ + "name": "GentooBrowse", + "routeBases": { + "common": { + "proxies": [ "IceSpider.SessionManager", "Gentoo.Users" ], + "functions": [ + "::Gentoo::UserPtr currentUser(const IceSpider::IHttpRequest *) const", + "void trimCategories(Gentoo::Categories &, const Gentoo::Packages &) const", + "void trimCategories(Gentoo::Categories &, const Gentoo::SearchResultPackages &) const", + "void trimPackages(Gentoo::Packages &, const Gentoo::Ebuilds &) const", + "template void trimCategories(const IceSpider::IHttpRequest *, const IceInternal::Handle & p) const { trimCategories(p->categories, p->packages); }", + "void addUser(const IceSpider::IHttpRequest *, const PageBasePtr &) const" + ] + } + }, + "slices": [ + "mash.ice", + "session.ice", + "users.ice" + ] +} diff --git a/gentoobrowse/src/mash.ice b/gentoobrowse/src/mash.ice new file mode 100644 index 0000000..98d4cc1 --- /dev/null +++ b/gentoobrowse/src/mash.ice @@ -0,0 +1,107 @@ +#include +#include +#include + +module GentooBrowse { + module Wrappers { + struct PK { + ["slicer:xml:attribute"] + bool tracked; + ["slicer:xml:text"] + string name; + }; + + struct Package { + Gentoo::Package detail; + Gentoo::Ebuilds ebuilds; + }; + + ["slicer:key:id","slicer:value:package","slicer:item:package"] + dictionary Packages; + + ["slicer:key:id","slicer:value:packages","slicer:item:category"] + dictionary Categories; + + ["slicer:key:timestamp","slicer:value:categories","slicer:item:sync"] + dictionary Syncs; + + struct SiteMapCategory { + ["slicer:name:detail"] + Gentoo::OverviewCategory category; + Gentoo::Packages packages; + }; + + ["slicer:element:category"] + sequence SiteMapCategories; + }; + + ["slicer:root:gentoo"] + class Index extends PageBase { + Wrappers::Syncs syncs; + }; + + ["slicer:root:gentoo"] + class Browse extends PageBase { + Gentoo::OverviewCategoriesBySuper categories; + }; + + ["slicer:root:gentoo"] + class Popular extends PageBase { + Gentoo::Categories categories; + Gentoo::Packages packages; + }; + + ["slicer:root:gentoo"] + class UserTracked extends Popular { + Gentoo::Ebuilds versions; + }; + + ["slicer:root:gentoo"] + class Sitemap extends PageBase { + Wrappers::SiteMapCategories categories; + }; + + ["slicer:root:gentoo"] + class Search extends PageBase { + Gentoo::Categories categories; + Gentoo::SearchResultPackages packages; + Gentoo::SearchResultBugs bugs; + Gentoo::News news; + Gentoo::Uses uses; + string query; + }; + + ["slicer:root:gentoo"] + class Category extends PageBase { + Gentoo::Category category; + Gentoo::Packages packages; + }; + + ["slicer:root:gentoo"] + class Package extends PageBase { + Gentoo::Categories categories; + Gentoo::Package package; + Gentoo::ChangeLog changelog; + Gentoo::EbuildDetails ebuilds; + Gentoo::PackageDependencyPackages dependencies; + Gentoo::PackageDependencyPackages rdependencies; + Gentoo::PackageDependencyPackages depending; + Gentoo::PackageMasks masks; + Gentoo::Uses uses; + Gentoo::Bugs bugs; + Gentoo::Repositories repos; + bool tracked = false; + }; + + ["slicer:root:gentoo"] + class Use extends PageBase { + Gentoo::Categories categories; + Gentoo::Uses usage; + Gentoo::Packages packages; + }; + + ["slicer:root:gentoo"] + class UseIndex extends PageBase { + Gentoo::Uses uses; + }; +}; diff --git a/gentoobrowse/src/news.ice b/gentoobrowse/src/news.ice new file mode 100644 index 0000000..18af2a9 --- /dev/null +++ b/gentoobrowse/src/news.ice @@ -0,0 +1,14 @@ +#include +#include + +module GentooBrowse { + class NewsRecent extends PageBase { + ["slicer:root:gentoo"] + Gentoo::News articles; + }; + class NewsArticle extends PageBase { + ["slicer:root:gentoo"] + Gentoo::NewsItem article; + }; +}; + diff --git a/gentoobrowse/src/news.json b/gentoobrowse/src/news.json new file mode 100644 index 0000000..ce05e2a --- /dev/null +++ b/gentoobrowse/src/news.json @@ -0,0 +1,52 @@ +{ + "name": "GentooBrowse", + "headers": [ "xsltStreamSerializer.h", "icespider-routes-base.h" ], + "routes": { + "news": { + "path": "/news", + "bases": [ "common" ], + "mutators": [ "addUser" ], + "outputSerializers": { + "text/html": { + "serializer": "IceSpider.XsltStreamSerializer", + "params": [ "\"xslt/news.xslt\"" ] + }, + "application/atom+xml": { + "serializer": "IceSpider.XsltStreamSerializer", + "params": [ "\"xslt/news-atom.xslt\"" ] + } + }, + "operations": { + "articles": { + "operation": "Gentoo.Portage.getNewsRecent" + } + }, + "type": "GentooBrowse.NewsRecent", + "params": { + "items": { + "default": "10" + } + } + }, + "newsitem": { + "path": "/news/{newsid}", + "bases": [ "common" ], + "mutators": [ "addUser" ], + "outputSerializers": { + "text/html": { + "serializer": "IceSpider.XsltStreamSerializer", + "params": [ "\"xslt/newsitem.xslt\"" ] + } + }, + "operations": { + "article": { + "operation": "Gentoo.Portage.getNewsItem" + } + }, + "type": "GentooBrowse.NewsArticle" + } + }, + "slices": [ + "news.ice" + ] +} diff --git a/gentoobrowse/src/packages.cpp b/gentoobrowse/src/packages.cpp new file mode 100644 index 0000000..f652900 --- /dev/null +++ b/gentoobrowse/src/packages.cpp @@ -0,0 +1,323 @@ +// Standard headers. +#include +#include +#include +#include + +// Interface headers. +#include +#include + +// Extra headers. +#include +#include +#include + +namespace GentooBrowse { + template std::map makeMap(const std::vector & items, const boost::function & id) + { + std::map rtn; + for (const auto & item : items) { + rtn.insert({ id(item), item }); + } + return rtn; + } + + // Implementation classes. + + // Route name: index + // path: / + class index : public IceSpider::IRouteHandler, + public common { + public: + index(const IceSpider::Core * core) : + IceSpider::IRouteHandler(IceSpider::HttpMethod::GET, "/"), + common(core), + prx0(core->getProxy()), + prx1(core->getProxy()), + _pd_syncs(3) + { + addRouteSerializer({ "application", "atom+xml" }, new IceSpider::XsltStreamSerializer::IceSpiderFactory("xslt/home-atom.xslt")); + addRouteSerializer({ "text", "html" }, new IceSpider::XsltStreamSerializer::IceSpiderFactory("xslt/home.xslt")); + } + + ~index() + { + removeRouteSerializer({ "application", "atom+xml" }); + removeRouteSerializer({ "text", "html" }); + } + + void execute(IceSpider::IHttpRequest * request) const + { + ::GentooBrowse::IndexPtr _responseModel = new ::GentooBrowse::Index(); + auto _ar_categories = prx0->begin_getCategoriesWithRecentAdditions(_pd_syncs, request->getContext()); + auto _ar_ebuilds = prx0->begin_getRecentAdditions(_pd_syncs, request->getContext()); + auto _ar_packages = prx0->begin_getPackagesWithRecentAdditions(_pd_syncs, request->getContext()); + addUser(request, _responseModel); + Ice::AsyncResultPtr _ar_t; + if (_responseModel->user) { + _ar_t = prx1->begin_tracked(_responseModel->user->userid); + } + auto ebuilds = prx0->end_getRecentAdditions(_ar_ebuilds); + auto packages = GentooBrowse::makeMap(prx0->end_getPackagesWithRecentAdditions(_ar_packages), [](auto p){ return p->packageid; }); + auto categories = GentooBrowse::makeMap(prx0->end_getCategoriesWithRecentAdditions(_ar_categories), [](auto c){ return c->categoryid; }); + decltype(prx1->end_tracked(_ar_t)) tracked; + if (_ar_t) { + tracked = prx1->end_tracked(_ar_t); + } + for(const auto & ebuild : ebuilds) { + auto & p = packages[ebuild->packageid]; + auto & c = categories[p->categoryid]; + auto & s = _responseModel->syncs[ebuild->moddate.substr(0, 10)]; + bool isTracked = std::find(tracked.begin(), tracked.end(), p->packageid) != tracked.end(); + auto & pw = s[{ isTracked, c->name }][{ isTracked, p->name }]; + if (!pw.detail) pw.detail = p; + pw.ebuilds.push_back(ebuild); + } + request->response(this, _responseModel); + } + + private: + const Gentoo::PortagePrx prx0; + const Gentoo::UsersPrx prx1; + const ::Ice::Int _pd_syncs; + }; + + // Route name: category + // path: /packages/{category} + class category : public IceSpider::IRouteHandler, + public common { + public: + category(const IceSpider::Core * core) : + IceSpider::IRouteHandler(IceSpider::HttpMethod::GET, "/packages/{category}"), + common(core), + prx0(core->getProxy()), + _pi_category(1) + { + addRouteSerializer({ "text", "html" }, new IceSpider::XsltStreamSerializer::IceSpiderFactory("xslt/category.xslt")); + } + + ~category() + { + removeRouteSerializer({ "text", "html" }); + } + + void execute(IceSpider::IHttpRequest * request) const + { + auto _p_category(request->getURLParam<::std::string>(_pi_category)); + auto cat = prx0->findCategory(_p_category, request->getContext()); + auto _ar_pkgs = prx0->begin_getPackagesInCategory(cat->categoryid, request->getContext()); + ::GentooBrowse::CategoryPtr model = new ::GentooBrowse::Category(); + model->category = cat; + model->packages = prx0->end_getPackagesInCategory(_ar_pkgs); + addUser(request, model); + request->response(this, model); + } + + private: + const Gentoo::PortagePrx prx0; + const ::Ice::Int _pi_category; + }; + + // Route name: package + // path: /packages/{category}/{package} + class package : public IceSpider::IRouteHandler, + public common { + public: + package(const IceSpider::Core * core) : + IceSpider::IRouteHandler(IceSpider::HttpMethod::GET, "/packages/{category}/{package}"), + common(core), + prx0(core->getProxy()), + prx1(core->getProxy()), + _pi_category(1), + _pi_package(2) + { + addRouteSerializer({ "text", "html" }, new IceSpider::XsltStreamSerializer::IceSpiderFactory("xslt/package.xslt")); + } + + ~package() + { + removeRouteSerializer({ "text", "html" }); + } + + void execute(IceSpider::IHttpRequest * request) const + { + auto _p_category(request->getURLParam<::std::string>(_pi_category)); + auto _p_package(request->getURLParam<::std::string>(_pi_package)); + auto _ar_p = prx0->begin_findPackage(_p_category, _p_package, request->getContext()); + auto _ar_r = prx0->begin_getRepositories(request->getContext()); + auto _ar_cats = prx0->begin_getAllCategories(request->getContext()); + ::GentooBrowse::PackagePtr model = new ::GentooBrowse::Package(); + model->package = prx0->end_findPackage(_ar_p); + Ice::AsyncResultPtr _ar_t; + auto _ar_cl = prx0->begin_getPackageChangeLog(model->package->packageid, request->getContext()); + auto _ar_ebuilds = prx0->begin_getPackageVersionDetails(model->package->packageid, request->getContext()); + auto _ar_bugs = prx0->begin_getPackageBugs(model->package->packageid, request->getContext()); + auto _ar_d = prx0->begin_getPackageDependencies(model->package->packageid, request->getContext()); + auto _ar_rd = prx0->begin_getPackageRuntimeDependencies(model->package->packageid, request->getContext()); + auto _ar_dp = prx0->begin_getPackagesDepending(model->package->packageid, request->getContext()); + auto _ar_m = prx0->begin_getPackageMasks(model->package->packageid, request->getContext()); + auto _ar_u = prx0->begin_getPackageUses(model->package->packageid, request->getContext()); + addUser(request, model); + if (model->user) { + _ar_t = prx1->begin_tracked(model->user->userid); + } + model->categories = prx0->end_getAllCategories(_ar_cats); + model->changelog = prx0->end_getPackageChangeLog(_ar_cl); + model->ebuilds = prx0->end_getPackageVersionDetails(_ar_ebuilds); + model->bugs = prx0->end_getPackageBugs(_ar_bugs); + model->dependencies = prx0->end_getPackageDependencies(_ar_d); + model->rdependencies = prx0->end_getPackageRuntimeDependencies(_ar_rd); + model->depending = prx0->end_getPackagesDepending(_ar_dp); + model->masks = prx0->end_getPackageMasks(_ar_m); + model->uses = prx0->end_getPackageUses(_ar_u); + model->repos = prx0->end_getRepositories(_ar_r); + std::set ids({ model->package->categoryid }); + collateCategoryIds(ids, model->dependencies); + collateCategoryIds(ids, model->depending); + collateCategoryIds(ids, model->rdependencies); + model->categories.erase(std::remove_if(model->categories.begin(), model->categories.end(), [&ids](auto category) { + return ids.find(category->categoryid) == ids.end(); + }), model->categories.end()); + if (_ar_t) { + model->tracked = AdHoc::containerContains(prx1->end_tracked(_ar_t), model->package->packageid); + } + request->response(this, model); + } + + private: + template + static void collateCategoryIds(std::set & ids, const std::vector & packages) + { + std::transform(packages.begin(), packages.end(), std::inserter(ids, ids.begin()), [](auto p) { + return p->categoryid; + }); + } + const Gentoo::PortagePrx prx0; + const Gentoo::UsersPrx prx1; + const ::Ice::Int _pi_category; + const ::Ice::Int _pi_package; + }; + + + // Route name: track package + // path: /packages/{category}/{package}/tracked + class packageTrack : public IceSpider::IRouteHandler, + public common { + public: + packageTrack(const IceSpider::Core * core) : + IceSpider::IRouteHandler(IceSpider::HttpMethod::PUT, "/packages/{category}/{package}/tracked"), + common(core), + prx0(core->getProxy()), + prx1(core->getProxy()), + _pi_category(1), + _pi_package(2) + { + } + + void execute(IceSpider::IHttpRequest * request) const + { + auto _p_category(request->getURLParam<::std::string>(_pi_category)); + auto _p_package(request->getURLParam<::std::string>(_pi_package)); + auto p = prx0->findPackage(_p_category, _p_package, request->getContext()); + auto u = this->currentUser(request); + prx1->track(u->userid, p->packageid); + request->response(204, "Tracked"); + } + + private: + const Gentoo::PortagePrx prx0; + const Gentoo::UsersPrx prx1; + const ::Ice::Int _pi_category; + const ::Ice::Int _pi_package; + }; + + + // Route name: untrack package + // path: /packages/{category}/{package}/tracked + class packageUntrack : public IceSpider::IRouteHandler, + public common { + public: + packageUntrack(const IceSpider::Core * core) : + IceSpider::IRouteHandler(IceSpider::HttpMethod::DELETE, "/packages/{category}/{package}/tracked"), + common(core), + prx0(core->getProxy()), + prx1(core->getProxy()), + _pi_category(1), + _pi_package(2) + { + } + + void execute(IceSpider::IHttpRequest * request) const + { + auto _p_category(request->getURLParam<::std::string>(_pi_category)); + auto _p_package(request->getURLParam<::std::string>(_pi_package)); + auto p = prx0->findPackage(_p_category, _p_package, request->getContext()); + auto u = this->currentUser(request); + prx1->untrack(u->userid, p->packageid); + request->response(204, "Untracked"); + } + + private: + const Gentoo::PortagePrx prx0; + const Gentoo::UsersPrx prx1; + const ::Ice::Int _pi_category; + const ::Ice::Int _pi_package; + }; + + + // Route name: userAtom + // path: /atom/{username} + class userAtom : public IceSpider::IRouteHandler, + public common { + public: + userAtom(const IceSpider::Core * core) : + IceSpider::IRouteHandler(IceSpider::HttpMethod::GET, "/atom/{username}"), + common(core), + prx0(core->getProxy()), + prx1(core->getProxy()), + _pi_username(1) + { + addRouteSerializer({ "application", "atom+xml" }, new IceSpider::XsltStreamSerializer::IceSpiderFactory("xslt/user-atom.xslt")); + removeRouteSerializer({ "application", "xml" }); + removeRouteSerializer({ "application", "json" }); + } + + ~userAtom() + { + removeRouteSerializer({ "application", "atom+xml" }); + } + + void execute(IceSpider::IHttpRequest * request) const + { + auto _p_username(request->getURLParam<::std::string>(_pi_username)); + auto user = prx1->find(_p_username); + auto _ar_cs = prx0->begin_getAllCategories(request->getContext()); + auto _ar_ps = prx0->begin_getUserTrackedPackages(user->userid, request->getContext()); + auto _ar_vs = prx0->begin_getUserTrackedRecentVersions(user->userid, 50, request->getContext()); + GentooBrowse::UserTrackedPtr ut = new GentooBrowse::UserTracked(); + ut->categories = prx0->end_getAllCategories(_ar_cs); + ut->packages = prx0->end_getUserTrackedPackages(_ar_ps); + ut->versions = prx0->end_getUserTrackedRecentVersions(_ar_vs); + common::trimPackages(ut->packages, ut->versions); + common::trimCategories(ut->categories, ut->packages); + request->response(this, ut); + } + + private: + const Gentoo::PortagePrx prx0; + const Gentoo::UsersPrx prx1; + const ::Ice::Int _pi_username; + }; + + +} // namespace gentoobrowse + +// Register route handlers. +FACTORY(GentooBrowse::index, IceSpider::RouteHandlerFactory); +FACTORY(GentooBrowse::category, IceSpider::RouteHandlerFactory); +FACTORY(GentooBrowse::package, IceSpider::RouteHandlerFactory); +FACTORY(GentooBrowse::packageTrack, IceSpider::RouteHandlerFactory); +FACTORY(GentooBrowse::packageUntrack, IceSpider::RouteHandlerFactory); +FACTORY(GentooBrowse::userAtom, IceSpider::RouteHandlerFactory); + diff --git a/gentoobrowse/src/packages.json b/gentoobrowse/src/packages.json new file mode 100644 index 0000000..aa65b0b --- /dev/null +++ b/gentoobrowse/src/packages.json @@ -0,0 +1,52 @@ +{ + "name": "GentooBrowse", + "headers": [ "xsltStreamSerializer.h", "icespider-routes-base.h" ], + "routes": { + "browse": { + "path": "/packages", + "bases": [ "common" ], + "mutators": [ "addUser" ], + "outputSerializers": { + "text/html": { + "serializer": "IceSpider.XsltStreamSerializer", + "params": [ "\"xslt/categories.xslt\"" ] + } + }, + "operations": { + "categories": { + "operation": "Gentoo.Portage.getAllOverviewCategories" + } + }, + "type": "GentooBrowse.Browse" + }, + "popular": { + "path": "/packages/popular", + "bases": [ "common" ], + "mutators": [ "addUser", "trimCategories" ], + "outputSerializers": { + "text/html": { + "serializer": "IceSpider.XsltStreamSerializer", + "params": [ "\"xslt/popular.xslt\"" ] + } + }, + "operations": { + "categories": { + "operation": "Gentoo.Portage.getAllCategories" + }, + "packages": { + "operation": "Gentoo.Portage.getTopTrackedPackages" + } + }, + "type": "GentooBrowse.Popular", + "params": { + "n": { + "default": "50" + } + } + } + }, + "slices": [ + "mash.ice", + "portage.ice" + ] +} diff --git a/gentoobrowse/src/pagebase.ice b/gentoobrowse/src/pagebase.ice new file mode 100644 index 0000000..7fbb953 --- /dev/null +++ b/gentoobrowse/src/pagebase.ice @@ -0,0 +1,26 @@ +#ifndef GENTOOBRWOSE_PAGEBASE_ICE +#define GENTOOBRWOSE_PAGEBASE_ICE + +#include + +module GentooBrowse { + const string USERID = "userId"; + const string SESSIONID = "sessionId"; + + class PageBase { + Gentoo::User user; + }; + + class Credentials { + string username; + string password; + }; + + class SignUp extends Credentials { + string realname; + string email; + }; +}; + +#endif + diff --git a/gentoobrowse/src/search.cpp b/gentoobrowse/src/search.cpp new file mode 100644 index 0000000..c435df1 --- /dev/null +++ b/gentoobrowse/src/search.cpp @@ -0,0 +1,67 @@ +// Standard headers. +#include +#include +#include +#include + +// Interface headers. +#include +#include + +// Extra headers. +#include +#include +#include + +namespace GentooBrowse { + // Base classes. + +} // namespace GentooBrowse + + +namespace GentooBrowse { + // Route name: sitemap + // path: /sitemap.xml + class sitemap : public IceSpider::IRouteHandler { + public: + sitemap(const IceSpider::Core * core) : + IceSpider::IRouteHandler(IceSpider::HttpMethod::GET, "/sitemap.xml"), + prx0(core->getProxy()) + { + addRouteSerializer({ "application", "xml" }, new IceSpider::XsltStreamSerializer::IceSpiderFactory("xslt/sitemap.xslt")); + } + + ~sitemap() + { + removeRouteSerializer({ "application", "xml" }); + } + + void execute(IceSpider::IHttpRequest * request) const + { + auto _ar_categories = prx0->begin_getAllOverviewCategories(request->getContext()); + auto _ar_packages = prx0->begin_getAllPackages(request->getContext()); + ::GentooBrowse::SitemapPtr _responseModel = new ::GentooBrowse::Sitemap(); + auto categories = prx0->end_getAllOverviewCategories(_ar_categories); + auto packages = prx0->end_getAllPackages(_ar_packages); + for (const auto & super : categories) { + std::transform(super.second.begin(), super.second.end(), + std::inserter(_responseModel->categories, _responseModel->categories.begin()), [&packages](auto c) { + Gentoo::Packages ps; + std::copy_if(packages.begin(), packages.end(), std::inserter(ps, ps.begin()), [&c](auto p) { + return p->categoryid == c->categoryid; + }); + return GentooBrowse::Wrappers::SiteMapCategory({ c, ps }); + }); + } + request->response(this, _responseModel); + } + + private: + const Gentoo::PortagePrx prx0; + }; + +} // namespace GentooBrowse + +// Register route handlers. +FACTORY(GentooBrowse::sitemap, IceSpider::RouteHandlerFactory); + diff --git a/gentoobrowse/src/search.json b/gentoobrowse/src/search.json new file mode 100644 index 0000000..aea47c3 --- /dev/null +++ b/gentoobrowse/src/search.json @@ -0,0 +1,45 @@ +{ + "name": "GentooBrowse", + "headers": [ "xsltStreamSerializer.h", "icespider-routes-base.h" ], + "routes": { + "search": { + "path": "/search", + "bases": [ "common" ], + "mutators": [ "addUser", "trimCategories" ], + "outputSerializers": { + "text/html": { + "serializer": "IceSpider.XsltStreamSerializer", + "params": [ "\"xslt/search.xslt\"" ] + } + }, + "operations": { + "categories": { + "operation": "Gentoo.Portage.getAllCategories" + }, + "packages": { + "operation": "Gentoo.Portage.getPackagesSearch" + }, + "bugs": { + "operation": "Gentoo.Portage.getBugsSearch" + }, + "uses": { + "operation": "Gentoo.Portage.getUsesSearch" + }, + "news": { + "operation": "Gentoo.Portage.getNewsSearch" + } + }, + "type": "GentooBrowse.Search", + "params": { + "query": { + "source": "QueryString", + "key": "criteria" + } + } + } + }, + "slices": [ + "mash.ice", + "portage.ice" + ] +} diff --git a/gentoobrowse/src/use.json b/gentoobrowse/src/use.json new file mode 100644 index 0000000..63a9161 --- /dev/null +++ b/gentoobrowse/src/use.json @@ -0,0 +1,50 @@ +{ + "name": "GentooBrowse", + "headers": [ "xsltStreamSerializer.h", "icespider-routes-base.h" ], + "routes": { + "useIndex": { + "path": "/use", + "bases": [ "common" ], + "mutators": [ "addUser" ], + "outputSerializers": { + "text/html": { + "serializer": "IceSpider.XsltStreamSerializer", + "params": [ "\"xslt/use.xslt\"" ] + } + }, + "operations": { + "uses": { + "operation": "Gentoo.Portage.getGlobalUses" + } + }, + "type": "GentooBrowse.UseIndex" + }, + "useDetail": { + "path": "/use/{flag}", + "bases": [ "common" ], + "mutators": [ "addUser", "trimCategories" ], + "outputSerializers": { + "text/html": { + "serializer": "IceSpider.XsltStreamSerializer", + "params": [ "\"xslt/use-detail.xslt\"" ] + } + }, + "operations": { + "categories": { + "operation": "Gentoo.Portage.getAllCategories" + }, + "packages": { + "operation": "Gentoo.Portage.getUsePackages" + }, + "usage": { + "operation": "Gentoo.Portage.getUseUsage" + } + }, + "type": "GentooBrowse.Use" + } + }, + "slices": [ + "mash.ice", + "portage.ice" + ] +} diff --git a/gentoobrowse/src/user.cpp b/gentoobrowse/src/user.cpp new file mode 100644 index 0000000..1bd5b88 --- /dev/null +++ b/gentoobrowse/src/user.cpp @@ -0,0 +1,236 @@ +// Standard headers. +#include +#include +#include + +// Interface headers. +#include +#include +#include + +// Extra headers. +#include +#include + +namespace GentooBrowse { + // Implementation classes. + + // Route name: login + // path: /user/login + class login : public IceSpider::IRouteHandler { + public: + login(const IceSpider::Core * core) : + IceSpider::IRouteHandler(IceSpider::HttpMethod::POST, "/user/login"), + prx0(core->getProxy()), + prx1(core->getProxy()) + { + } + + void execute(IceSpider::IHttpRequest * request) const + { + auto credentials = *request->getBody(); + auto user = prx1->authenticate(credentials->username, credentials->password); + auto s = prx0->createSession(); + s->variables[USERID] = boost::lexical_cast(user->userid); + prx0->updateSession(s); + request->setCookie(SESSIONID, s->id, IceUtil::None, "/"); + request->responseRedirect("/user/home", "Authenticated"); + } + + private: + const IceSpider::SessionManagerPrx prx0; + const Gentoo::UsersPrx prx1; + }; + + // Route name: signup + // path: /user/signup + class signup : public IceSpider::IRouteHandler { + public: + signup(const IceSpider::Core *) : + IceSpider::IRouteHandler(IceSpider::HttpMethod::GET, "/user/signup") + { + addRouteSerializer({ "text", "html" }, new IceSpider::XsltStreamSerializer::IceSpiderFactory("xslt/user-signup.xslt")); + } + + void execute(IceSpider::IHttpRequest * request) const + { + PageBasePtr p = new PageBase(); + request->response(this, p); + } + }; + + // Route name: signup post + // path: /user/signup + class signupPost : public IceSpider::IRouteHandler { + public: + signupPost(const IceSpider::Core * core) : + IceSpider::IRouteHandler(IceSpider::HttpMethod::POST, "/user/signup"), + prx1(core->getProxy()) + { + } + + void execute(IceSpider::IHttpRequest * request) const + { + auto signup = *request->getBody(); + auto user = prx1->create(signup->username, signup->password, signup->realname, signup->email); + request->responseRedirect("/user/verification", "Pending verification"); + } + + private: + const Gentoo::UsersPrx prx1; + }; + + // Route name: verification + // path: /user/verification + class verification : public IceSpider::IRouteHandler { + public: + verification(const IceSpider::Core *) : + IceSpider::IRouteHandler(IceSpider::HttpMethod::GET, "/user/verification") + { + addRouteSerializer({ "text", "html" }, new IceSpider::XsltStreamSerializer::IceSpiderFactory("xslt/user-verification.xslt")); + } + + void execute(IceSpider::IHttpRequest * request) const + { + PageBasePtr p = new PageBase(); + request->response(this, p); + } + }; + + // Route name: verification post + // path: /user/verification + class verificationPost : public IceSpider::IRouteHandler { + public: + verificationPost(const IceSpider::Core * core) : + IceSpider::IRouteHandler(IceSpider::HttpMethod::POST, "/user/verification"), + prx0(core->getProxy()), + prx1(core->getProxy()), + _pn_username("username"), + _pn_guid("guid") + { + } + + void execute(IceSpider::IHttpRequest * request) const + { + auto _pbody(request->getBody()); + auto _p_username(request->getBodyParam<::std::string>(_pbody, _pn_username) / + [this]() { return requiredParameterNotFound<::std::string>("Body", _pn_username); }); + auto _p_guid(request->getBodyParam<::std::string>(_pbody, _pn_guid) / + [this]() { return requiredParameterNotFound<::std::string>("Body", _pn_guid); }); + auto user = prx1->verify(_p_username, _p_guid, request->getContext()); + auto s = prx0->createSession(); + s->variables[USERID] = boost::lexical_cast(user->userid); + prx0->updateSession(s); + request->setCookie(SESSIONID, s->id, IceUtil::None, "/"); + request->responseRedirect("/user/home", "Verified, welcome!"); + } + + private: + const IceSpider::SessionManagerPrx prx0; + const Gentoo::UsersPrx prx1; + const std::string _pn_username; + const std::string _pn_guid; + }; + + // Route name: home + // path: /user/home + class home : public IceSpider::IRouteHandler, + public common { + public: + home(const IceSpider::Core * core) : + IceSpider::IRouteHandler(IceSpider::HttpMethod::GET, "/user/home"), + common(core), + prx0(core->getProxy()), + prx1(core->getProxy()) + { + addRouteSerializer({ "text", "html" }, new IceSpider::XsltStreamSerializer::IceSpiderFactory("xslt/user-home.xslt")); + } + + ~home() + { + removeRouteSerializer({ "text", "html" }); + } + + void execute(IceSpider::IHttpRequest * request) const + { + PageBasePtr p = new PageBase(); + addUser(request, p); + request->response(this, p); + } + + private: + const IceSpider::SessionManagerPrx prx0; + const Gentoo::UsersPrx prx1; + }; + + // Route name: tracked + // path: /user/tracked + class tracked : public IceSpider::IRouteHandler, + public common { + public: + tracked(const IceSpider::Core * core) : + IceSpider::IRouteHandler(IceSpider::HttpMethod::GET, "/user/tracked"), + common(core), + prx0(core->getProxy()), + prx1(core->getProxy()), + prx2(core->getProxy()) + { + addRouteSerializer({ "text", "html" }, new IceSpider::XsltStreamSerializer::IceSpiderFactory("xslt/user-tracked.xslt")); + } + + ~tracked() + { + removeRouteSerializer({ "text", "html" }); + } + + void execute(IceSpider::IHttpRequest * request) const + { + PopularPtr u = new Popular(); + auto _ar_c = prx2->begin_getAllCategories(request->getContext()); + addUser(request, u); + auto _ar_p = prx2->begin_getUserTrackedPackages(u->user->userid, request->getContext()); + u->categories = prx2->end_getAllCategories(_ar_c); + u->packages = prx2->end_getUserTrackedPackages(_ar_p); + request->response(this, u); + } + + private: + const IceSpider::SessionManagerPrx prx0; + const Gentoo::UsersPrx prx1; + const Gentoo::PortagePrx prx2; + }; + + // Route name: logout + // path: /user/logout + class logout : public IceSpider::IRouteHandler { + public: + logout(const IceSpider::Core * core) : + IceSpider::IRouteHandler(IceSpider::HttpMethod::GET, "/user/logout"), + prx0(core->getProxy()) + { + } + + void execute(IceSpider::IHttpRequest * request) const + { + prx0->destroySession(*request->getCookieParam(SESSIONID)); + request->setCookie(SESSIONID, std::string(), IceUtil::None, "/", false, 0); + request->responseRedirect("/", "Logged out"); + } + + private: + const IceSpider::SessionManagerPrx prx0; + }; + + +} // namespace gentoobrowse + +// Register route handlers. +FACTORY(GentooBrowse::login, IceSpider::RouteHandlerFactory); +FACTORY(GentooBrowse::home, IceSpider::RouteHandlerFactory); +FACTORY(GentooBrowse::tracked, IceSpider::RouteHandlerFactory); +FACTORY(GentooBrowse::logout, IceSpider::RouteHandlerFactory); +FACTORY(GentooBrowse::signup, IceSpider::RouteHandlerFactory); +FACTORY(GentooBrowse::signupPost, IceSpider::RouteHandlerFactory); +FACTORY(GentooBrowse::verification, IceSpider::RouteHandlerFactory); +FACTORY(GentooBrowse::verificationPost, IceSpider::RouteHandlerFactory); + diff --git a/gentoobrowse/tasks/.htaccess b/gentoobrowse/tasks/.htaccess deleted file mode 100644 index e13f618..0000000 --- a/gentoobrowse/tasks/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Order allow,deny diff --git a/gentoobrowse/views/.htaccess b/gentoobrowse/views/.htaccess deleted file mode 100644 index e13f618..0000000 --- a/gentoobrowse/views/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Order allow,deny diff --git a/gentoobrowse/views/categories.xml b/gentoobrowse/views/categories.xml deleted file mode 100644 index c6fb59e..0000000 --- a/gentoobrowse/views/categories.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - SELECT c.categoryid, MIN(c.name) AS catname, COUNT(*) AS packages, MIN(c.summary) AS summary, MAX(p.firstseen) AS pkgfirstseen, - split_part(MIN(c.name), '-', 1) super - FROM categories c, packages p - WHERE c.categoryid = p.categoryid - GROUP BY c.categoryid - ORDER BY MIN(c.name) - - - diff --git a/gentoobrowse/views/category.xml b/gentoobrowse/views/category.xml deleted file mode 100644 index c14c2d2..0000000 --- a/gentoobrowse/views/category.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - SELECT c.name AS catname, p.name AS pkgname, p.description, COALESCE(herd, '-none-') herd - FROM categories c, packages p - WHERE c.categoryid = p.categoryid - AND c.name = - AND c.categoryid = - ORDER BY p.name - - - diff --git a/gentoobrowse/views/newebuilds.xml b/gentoobrowse/views/newebuilds.xml deleted file mode 100644 index de546c9..0000000 --- a/gentoobrowse/views/newebuilds.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - SELECT description, moddate, p.name AS pkgname, c.name AS catname, e.version, e.firstseen sync, - up.trackedsince IS NOT NULL AS tracked, p.packageid - FROM ebuilds e, categories c, packages p LEFT OUTER JOIN user_packages up - ON up.userid = - AND up.packageid = p.packageid - WHERE e.packageid = p.packageid - AND p.categoryid = c.categoryid - AND e.firstseen IN ( - SELECT DISTINCT e.firstseen - FROM ebuilds e - ORDER BY e.firstseen DESC - LIMIT ) - ORDER BY tracked DESC, e.firstseen, c.name, p.name, e.versioninst - - - - - SELECT DISTINCT e.firstseen AS synctime - FROM ebuilds e - ORDER BY e.firstseen DESC - LIMIT - - - diff --git a/gentoobrowse/views/newebuildsatom.xml b/gentoobrowse/views/newebuildsatom.xml deleted file mode 100644 index fcc7e8f..0000000 --- a/gentoobrowse/views/newebuildsatom.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - SELECT version, description, moddate, p.name AS pkgname, c.name AS catname, e.firstseen sync - FROM ebuilds e, categories c, packages p, user_packages up, users u - WHERE e.packageid = p.packageid - AND p.categoryid = c.categoryid - AND up.userid = u.userid - AND u.username = - AND up.packageid = p.packageid - AND e.firstseen >= up.trackedsince - ORDER BY e.firstseen DESC, c.name, p.name, e.versioninst - LIMIT 50 - - - - diff --git a/gentoobrowse/views/package.xml b/gentoobrowse/views/package.xml deleted file mode 100644 index e581430..0000000 --- a/gentoobrowse/views/package.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - SELECT c.name AS catname, p.name AS pkgname, MAX(e.moddate) AS moddate - FROM categories c, packages p, ebuilds e - WHERE p.packageid = e.packageid - AND c.categoryid = p.categoryid - GROUP BY c.name, p.name - - - - - SELECT p.packageid, p.name AS pkgname, p.description, p.firstseen, c.name AS catname, p.herd, p.summary, p.image - FROM packages p, categories c - WHERE p.categoryid = c.categoryid - - AND c.name = - AND p.name = - - - - - - SELECT up.packageid, up.trackedsince, up.userid - FROM user_packages up - - WHERE up.packageid = - AND up.userid = - - - - - - SELECT e.ebuildid, e.version, e.moddate, e.slot, e.license, r.name AS reponame - FROM ebuilds e, repos r - WHERE e.repoid = r.repoid - - AND e.packageid = - - ORDER BY versioninst desc - - - - - SELECT pu.url - FROM package_urls pu - - WHERE pu.packageid = - - ORDER BY pu.url - - - - - SELECT u.* - FROM ebuilds e, ebuild_uses u - LEFT OUTER JOIN use_groups ug ON LTRIM(u.use, '+') LIKE ug.name || '%' - WHERE e.ebuildid = u.ebuildid - AND ug.usegroupid IS NULL - - AND e.packageid = - - ORDER BY version - - - - - SELECT a.* - FROM ebuilds e, ebuild_archs a - WHERE e.ebuildid = a.ebuildid - - AND e.packageid = - - ORDER BY version - - - - - SELECT b.bugid, b.summary - FROM bugs b, categories c, packages p - WHERE p.categoryid = c.categoryid - AND gentoobrowse.bugpackages(b) @> array[c.name || '/' || p.name] - - AND p.packageid = - - ORDER BY b.bugid - - - - - SELECT DISTINCT cd.name AS catname, pd.name AS pkgname, pd.description - FROM ebuilds e, ebuild_deps d, packages pd, categories cd - WHERE d.ebuildid = e.ebuildid - AND pd.packageid = d.packageid - AND pd.categoryid = cd.categoryid - - AND e.packageid = - - ORDER BY cd.name, pd.name - - - - - SELECT DISTINCT cd.name AS catname, pd.name AS pkgname, pd.description - FROM ebuilds e, ebuild_rdeps d, packages pd, categories cd - WHERE d.ebuildid = e.ebuildid - AND pd.packageid = d.packageid - AND pd.categoryid = cd.categoryid - - AND e.packageid = - - ORDER BY cd.name, pd.name - - - - - SELECT DISTINCT cd.name AS catname, pd.name AS pkgname, pd.description - FROM ebuilds e, ( - SELECT ebuildid - FROM ebuild_rdeps d - - WHERE d.packageid = - - UNION - SELECT ebuildid - FROM ebuild_deps d - - WHERE d.packageid = - ) d, packages pd, categories cd - WHERE d.ebuildid = e.ebuildid - AND pd.packageid = e.packageid - AND pd.categoryid = cd.categoryid - ORDER BY cd.name, pd.name - - - - - SELECT em.ebuildid, DENSE_RANK() OVER(ORDER BY em.setno) AS setno - FROM ebuild_masks em, ebuilds e - WHERE em.ebuildid = e.ebuildid - - AND e.packageid = - - - - - - SELECT DISTINCT DENSE_RANK() OVER(ORDER BY em.setno), ms.person, ms.message, ms.dateadded - FROM ebuild_masks em, ebuilds e, masksets ms - WHERE em.ebuildid = e.ebuildid - AND ms.setno = em.setno - - AND e.packageid = - - ORDER BY DENSE_RANK() OVER(ORDER BY em.setno) - - - - - SELECT committime AS date, authorname person, authoremail email, cl.summary AS comment, r.name AS reponame - FROM changelog cl, categories c, packages p, repos r - WHERE p.categoryid = c.categoryid - AND cl.repoid = r.repoid - AND gentoobrowse.changelogpackages(cl) @> array[c.name || '/' || p.name] - - AND packageid = - - AND cl.authoremail != 'repo-qa-checks@gentoo.org' - ORDER BY cl.committime DESC, cl.repoid - - - diff --git a/gentoobrowse/views/popular.xml b/gentoobrowse/views/popular.xml deleted file mode 100644 index 9668a7d..0000000 --- a/gentoobrowse/views/popular.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - SELECT p.packageid, MIN(c.name) AS catname, MIN(p.name) AS pkgname, MIN(p.description) AS description, COUNT(*) AS trackers - FROM user_packages up, packages p, categories c - WHERE up.packageid = p.packageid - AND p.categoryid = c.categoryid - GROUP BY p.packageid - ORDER BY COUNT(*) DESC, MIN(c.name), MIN(p.name) - LIMIT 50 - - - diff --git a/gentoobrowse/views/poweredBy.xml b/gentoobrowse/views/poweredBy.xml deleted file mode 100644 index abec8a9..0000000 --- a/gentoobrowse/views/poweredBy.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/gentoobrowse/views/search.xml b/gentoobrowse/views/search.xml deleted file mode 100644 index 063098d..0000000 --- a/gentoobrowse/views/search.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - select c.name as catname, p.name as pkgname, description - , - ts_rank(packagefts(p), plainto_tsquery('english', )) as rank - - from packages p, categories c - where p.categoryid = c.categoryid - - and packagefts(p) @@ plainto_tsquery('english', ) - order by rank desc, p.name - - - - - - SELECT b.bugid, b.severity, b.status, b.summary, b.firstseen - , - ts_rank(bugfts(b), plainto_tsquery('english', )) as rank - - FROM bugs b - - WHERE bugfts(b) @@ plainto_tsquery('english', ) - ORDER BY rank DESC, bugid DESC - - - - - - SELECT DISTINCT p.packageid, c.name AS catname, p.name AS pkgname, description - FROM ebuild_uses eu, ebuilds e, packages p, categories c - WHERE e.ebuildid = eu.ebuildid - AND e.packageid = p.packageid - AND p.categoryid = c.categoryid - - AND LTRIM(eu.use, '+') = - - ORDER BY c.name, p.name - - - - - SELECT c.name as catname, p.name as pkgname, description - FROM packages p, categories c - WHERE p.categoryid = c.categoryid - - AND p.herd = - - ORDER BY c.name, p.name - - - diff --git a/gentoobrowse/views/tracked.xml b/gentoobrowse/views/tracked.xml deleted file mode 100644 index c36f2a8..0000000 --- a/gentoobrowse/views/tracked.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - SELECT c.name as catname, p.name as pkgname, description - FROM user_packages up, packages p, categories c - WHERE up.packageid = p.packageid - AND c.categoryid = p.categoryid - AND up.userid = - ORDER BY c.name, p.name - - - - diff --git a/gentoobrowse/views/use.xml b/gentoobrowse/views/use.xml deleted file mode 100644 index 67a4c63..0000000 --- a/gentoobrowse/views/use.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - SELECT LTRIM(p.use, '+') AS use, COALESCE(MIN(l.description), MIN(g.description), MIN(ug.description)) AS description, - MIN(gs.name) AS usegroup - FROM (SELECT e.packageid, u.use - FROM ebuilds e, ebuild_uses u - WHERE e.ebuildid = u.ebuildid - - AND e.packageid = - ) AS p - LEFT OUTER JOIN use_global g ON LTRIM(p.use, '+') = g.use - LEFT OUTER JOIN use_local l ON LTRIM(p.use, '+') = l.use - AND (l.packageid = p.packageid OR l.packageid IS NULL) - AND (l.description IS NOT NULL OR g.description IS NOT NULL) - LEFT OUTER JOIN use_groups gs ON LTRIM(p.use, '+') LIKE gs.name || '%' - LEFT OUTER JOIN use_group ug ON gs.usegroupid = ug.usegroupid - AND gs.name || '_' || ug.use = LTRIM(p.use, '+') - GROUP BY LTRIM(p.use, '+') - ORDER BY LTRIM(p.use, '+') - - - - - SELECT use, description - FROM use_global - - WHERE LTRIM(use, '+') = - - - - - - SELECT packageid, use, description - FROM use_local - - WHERE LTRIM(use, '+') = - ORDER BY packageid - - - WHERE packageid = - ORDER BY use - - - - diff --git a/gentoobrowse/views/user.xml b/gentoobrowse/views/user.xml deleted file mode 100644 index f989514..0000000 --- a/gentoobrowse/views/user.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - SELECT u.* - FROM users u - WHERE u.username = - WHERE u.verifyguid = - - - - diff --git a/gentoobrowse/views/webcommon.xml b/gentoobrowse/views/webcommon.xml deleted file mode 100644 index fd84a41..0000000 --- a/gentoobrowse/views/webcommon.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/gentoobrowse/xslt/atom.xslt b/gentoobrowse/xslt/atom.xslt new file mode 100644 index 0000000..d0ed8c0 --- /dev/null +++ b/gentoobrowse/xslt/atom.xslt @@ -0,0 +1,22 @@ + + + + + + + T + + + : + + : + + + + 00:00:00 + + Z + + diff --git a/gentoobrowse/xslt/atomebuilds.xslt b/gentoobrowse/xslt/atomebuilds.xslt deleted file mode 100644 index 4d647f4..0000000 --- a/gentoobrowse/xslt/atomebuilds.xslt +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - Gentoo Browse | New ebuilds - http://gentoobrowse.randomdan.homeip.net/ - - http:///atom/ - - Unofficial Gentoo package browser - en-gb - - - - Copyright: (C) Gentoo Foundation, Inc. - 15 - - - - - - <xsl:value-of select="catname" />/<xsl:value-of select="pkgname" />-<xsl:value-of select="version" /> - - http:///package// - http:///package//- - - ebuild - - - diff --git a/gentoobrowse/xslt/base.xslt b/gentoobrowse/xslt/base.xslt index 5dd2cf7..1efd644 100644 --- a/gentoobrowse/xslt/base.xslt +++ b/gentoobrowse/xslt/base.xslt @@ -1,9 +1,58 @@ + xmlns:date="http://exslt.org/dates-and-times" + exclude-result-prefixes="str date"> + + + + + + + + + + + + + + + + <!DOCTYPE html> @@ -32,14 +81,21 @@ @@ -65,51 +121,51 @@

Gentoo Browse is not an official Gentoo website. The name "Gentoo" and the "g" logo are trademarks of the Gentoo Foundation, Inc.

Many thanks to the people behind the tech powering Gentoo Browse.

- - + + + + + + + +
+ + +

Sign up

+
+
+
@@ -127,23 +183,27 @@
+

+ + block + - /category/ - - + /packages/ + + / - /package// + /packages// - + : - +

    - +
  • diff --git a/gentoobrowse/xslt/categories.xslt b/gentoobrowse/xslt/categories.xslt index d25d135..c800717 100644 --- a/gentoobrowse/xslt/categories.xslt +++ b/gentoobrowse/xslt/categories.xslt @@ -1,6 +1,5 @@ - + @@ -8,59 +7,61 @@ Category List · Gentoo Browse - +

    Package categories

    - + package categories in - + groups.

    - + - +
    - +
    - + - +
    - - + +

    - +

    Contains - /category/ - packages + /packages/ + packages last updated - . + + + .

    diff --git a/gentoobrowse/xslt/category.xslt b/gentoobrowse/xslt/category.xslt index f7dedc5..622b9eb 100644 --- a/gentoobrowse/xslt/category.xslt +++ b/gentoobrowse/xslt/category.xslt @@ -1,24 +1,23 @@ - + - <xsl:value-of select="/gentoo/project2:uriElems/uriElem[2]" /> Package List · Gentoo Browse + <xsl:value-of select="/gentoo/category/name" /> Package List · Gentoo Browse - Complete list of Gentoo Linux packages in the category + Complete list of Gentoo Linux packages in the category -

    packages

    +

    packages

    - - packages from - - herds. + packages - + + +

    @@ -29,26 +28,14 @@
    - -
    - - - -
    -
    +

    +

    +
    diff --git a/gentoobrowse/xslt/error.xslt b/gentoobrowse/xslt/error.xslt index e20973a..0ba1530 100644 --- a/gentoobrowse/xslt/error.xslt +++ b/gentoobrowse/xslt/error.xslt @@ -1,6 +1,5 @@ - + diff --git a/gentoobrowse/xslt/form.xslt b/gentoobrowse/xslt/form.xslt index df4ff98..9f83b4b 100644 --- a/gentoobrowse/xslt/form.xslt +++ b/gentoobrowse/xslt/form.xslt @@ -1,58 +1,69 @@ + xmlns:common="http://exslt.org/common" extension-element-prefixes="common"> - - - - - + + + + - - + + + +
    - - +
    - - - - - - - - - - - -
    - - - - form_ - - - - -
    - -

    -
    -
    - - +
    + +
    + +
    +
    + + + -
    + + + +
    + + + + + +
    +
    - +
    diff --git a/gentoobrowse/xslt/herd.xslt b/gentoobrowse/xslt/herd.xslt deleted file mode 100644 index bb7b291..0000000 --- a/gentoobrowse/xslt/herd.xslt +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - Packages in the <xsl:value-of select="/gentoo/project2:uriElems/uriElem[2]" /> herd · Gentoo Browse - - Packages in the herd - - - - -

    The herd

    -

    - - packages in - - categories. -

    -
    - - - - - - -
    - -
    -
    - -
    - - - -
    -
    -
    -
    -
    diff --git a/gentoobrowse/xslt/home-atom.xslt b/gentoobrowse/xslt/home-atom.xslt new file mode 100644 index 0000000..11ea8d1 --- /dev/null +++ b/gentoobrowse/xslt/home-atom.xslt @@ -0,0 +1,66 @@ + + + + + + + + Recent updates · Gentoo Browse + Packages + + http://gentoobrowse.randomdan.homeip.net/ + + + + + + + + + + + + + + + + + + <xsl:value-of select="$category/id" />/<xsl:value-of select="id" /> + + + + http://gentoobrowse.randomdan.homeip.net/packages/ + + / + + + + + http://gentoobrowse.randomdan.homeip.net/ + + / + + / + + + + + + + + + + + + + + + + + + + + + diff --git a/gentoobrowse/xslt/home.xslt b/gentoobrowse/xslt/home.xslt index 4d85870..bc7e657 100644 --- a/gentoobrowse/xslt/home.xslt +++ b/gentoobrowse/xslt/home.xslt @@ -1,5 +1,7 @@ - + @@ -7,78 +9,91 @@ Newest ebuilds · Gentoo Browse + + + + + /atom/ + + + +

    Newest ebuilds

    - + new ebuilds in today.

    - - - - +
    - - + +
    - + - + + + + +

    + +

    + + +

    + + /packages/ + + + / + + /packages// + + + : + +

    + +

    + v + - + (updated + + + ) +

    +
    +
    +
    - - - -

    - -

    -
    - -

    - - - - - - /category/ - - - / - - /package// - - - : - -

    -
    -

    - v - (updated ) -

    -
    diff --git a/gentoobrowse/xslt/login.xslt b/gentoobrowse/xslt/login.xslt deleted file mode 100644 index d599761..0000000 --- a/gentoobrowse/xslt/login.xslt +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - -

    Your Gentoo Browse

    -

    Customise what you like and what you want to hear about.

    -
    - - -
    - -
    -
    - -
    -
    - - - - - - - -
    - - - -
    -
    -
    - -
    diff --git a/gentoobrowse/xslt/news-atom.xslt b/gentoobrowse/xslt/news-atom.xslt new file mode 100644 index 0000000..bf4350d --- /dev/null +++ b/gentoobrowse/xslt/news-atom.xslt @@ -0,0 +1,78 @@ + + + + + http://gentoobrowse.randomdan.homeip.net/ + + + + Recent updates · Gentoo Browse + News + + + + news + + + + + news + + + + + + + + + + + + + + + + <xsl:value-of select="title" /> + + + + + news/ + + + + + + news/ + + + + + + + + + + + +
    +

    + +

    + +

    +
    +
    +
    + + + + + + + + +
    +
    +
    diff --git a/gentoobrowse/xslt/news.xslt b/gentoobrowse/xslt/news.xslt new file mode 100644 index 0000000..76b5a3a --- /dev/null +++ b/gentoobrowse/xslt/news.xslt @@ -0,0 +1,83 @@ + + + + + + + News · Gentoo Browse + + Recent news + + + + + +

    Recent news

    +
    + + +
    + +
    +
    + + +
    + +

    + +

    +
    +
    Posted
    +
    + + + +
    +
    Author
    +
    + + + mailto: + + + +
    + +
    Applies to
    +
    +
      + +
    • +
      +
    +
    +
    +
    Details
    +
    + + + /news/ + + + +
    +
    +
    +
    +
    +
    +
    + diff --git a/gentoobrowse/xslt/newsitem.xslt b/gentoobrowse/xslt/newsitem.xslt new file mode 100644 index 0000000..6dcc613 --- /dev/null +++ b/gentoobrowse/xslt/newsitem.xslt @@ -0,0 +1,78 @@ + + + + + + + <xsl:value-of select="article/title" /> · Gentoo Browse + + + + + + + + +

    News article

    +
    + + + +
    + +
    + +

    + +

    +
    + +

    Applies to

    +
      + +
    • + +
    • +
      +
    +
    + +

    Also see

    + +
    +
    +
    +
    +
    + diff --git a/gentoobrowse/xslt/package.xslt b/gentoobrowse/xslt/package.xslt index 09155d7..f435ea3 100644 --- a/gentoobrowse/xslt/package.xslt +++ b/gentoobrowse/xslt/package.xslt @@ -1,15 +1,15 @@ - + + - <xsl:value-of select="/gentoo/package/catname" />/<xsl:value-of select="/gentoo/package/pkgname" /> Package Details · Gentoo Browse + <xsl:value-of select="$category/name" />/<xsl:value-of select="/gentoo/package/name" /> Package Details · Gentoo Browse - Gentoo Linux package details for /: + Gentoo Linux package details for /: - +