From 5fe10ab10e2d00d2bb22c08cd496a0d38cc37e69 Mon Sep 17 00:00:00 2001 From: randomdan Date: Fri, 29 Oct 2010 10:36:10 +0000 Subject: Tidy up bugimport as xsltproc can do the remote get itself and disable DTD check Add Google tracking doobry Connect to DB as user apache for web stuff --- gentoobrowse/base.xslt | 11 +++++++++++ gentoobrowse/console/bugimport.xml | 8 ++++---- gentoobrowse/datasources/postgres-web.xml | 10 ++++++++++ gentoobrowse/present/accountTracked.xml | 4 ++-- gentoobrowse/request/doconfirm.xml | 8 ++++---- gentoobrowse/request/dologin.xml | 8 ++++---- gentoobrowse/request/dosignup.xml | 8 ++++---- gentoobrowse/request/track.xml | 6 +++--- gentoobrowse/request/untrack.xml | 4 ++-- gentoobrowse/views/categories.xml | 4 ++-- gentoobrowse/views/category.xml | 4 ++-- gentoobrowse/views/newebuilds.xml | 6 +++--- gentoobrowse/views/newebuildsatom.xml | 4 ++-- gentoobrowse/views/package.xml | 28 ++++++++++++++-------------- gentoobrowse/views/search.xml | 4 ++-- 15 files changed, 69 insertions(+), 48 deletions(-) create mode 100644 gentoobrowse/datasources/postgres-web.xml diff --git a/gentoobrowse/base.xslt b/gentoobrowse/base.xslt index 47e6612..c37f079 100644 --- a/gentoobrowse/base.xslt +++ b/gentoobrowse/base.xslt @@ -11,6 +11,17 @@ +

Gentoo Browse

diff --git a/gentoobrowse/console/bugimport.xml b/gentoobrowse/console/bugimport.xml index 6c43f40..090caba 100644 --- a/gentoobrowse/console/bugimport.xml +++ b/gentoobrowse/console/bugimport.xml @@ -4,13 +4,13 @@ + path="xsltproc -novalid console/bugs.xslt http://bugs.gentoo.org/data/cached/buglist-UNCONFIRMED.htmlgz" /> + path="xsltproc -novalid console/bugs.xslt http://bugs.gentoo.org/data/cached/buglist-ASSIGNED.htmlgz" /> + path="xsltproc -novalid console/bugs.xslt http://bugs.gentoo.org/data/cached/buglist-REOPENED.htmlgz" /> + path="xsltproc -novalid console/bugs.xslt http://bugs.gentoo.org/data/cached/buglist-NEW.htmlgz" /> bugid severity diff --git a/gentoobrowse/datasources/postgres-web.xml b/gentoobrowse/datasources/postgres-web.xml new file mode 100644 index 0000000..0825e30 --- /dev/null +++ b/gentoobrowse/datasources/postgres-web.xml @@ -0,0 +1,10 @@ + + + + Driver=postgresql;ServerName=firebrand.random.lan;Username=apache;Database=gentoo;Password=gentoo; + Driver=postgresql;ServerName=defiant.random.lan;Username=apache;Database=gentoo;Password=gentoo; + Driver=postgresql;ServerName=akira.random.lan;Username=apache;Database=gentoo;Password=gentoo; + Driver=postgresql;ServerName=riogrande.random.lan;Username=apache;Database=gentoo;Password=gentoo; + + Driver=postgresql;ServerName=postgresql.random.lan;Username=apache;Database=gentoo;Password=gentoo; + diff --git a/gentoobrowse/present/accountTracked.xml b/gentoobrowse/present/accountTracked.xml index 89e8da8..590a8db 100644 --- a/gentoobrowse/present/accountTracked.xml +++ b/gentoobrowse/present/accountTracked.xml @@ -1,9 +1,9 @@ - + - + SELECT c.name AS catname, p.name AS pkgname, ( SELECT e.version diff --git a/gentoobrowse/request/doconfirm.xml b/gentoobrowse/request/doconfirm.xml index 70a1128..71f5d34 100644 --- a/gentoobrowse/request/doconfirm.xml +++ b/gentoobrowse/request/doconfirm.xml @@ -1,8 +1,8 @@ - - + + Invalid username or password SELECT COUNT(*) @@ -13,7 +13,7 @@ - + SELECT userid FROM users @@ -26,7 +26,7 @@ - + UPDATE users SET verifyguid = NULL WHERE verifyguid = ? diff --git a/gentoobrowse/request/dologin.xml b/gentoobrowse/request/dologin.xml index dde399f..672050d 100644 --- a/gentoobrowse/request/dologin.xml +++ b/gentoobrowse/request/dologin.xml @@ -1,7 +1,7 @@ - + .+ User name required @@ -10,7 +10,7 @@ .{6,} Password too short - + Invalid username or password SELECT COUNT(*) @@ -23,7 +23,7 @@ - + Confirmation code required SELECT COUNT(*) @@ -35,7 +35,7 @@ - + SELECT userid FROM users diff --git a/gentoobrowse/request/dosignup.xml b/gentoobrowse/request/dosignup.xml index 158853d..d1fbe2e 100644 --- a/gentoobrowse/request/dosignup.xml +++ b/gentoobrowse/request/dosignup.xml @@ -1,7 +1,7 @@ - + .+ User name required @@ -10,7 +10,7 @@ .{6,} Password too short - + Username already used SELECT COUNT(*) @@ -21,7 +21,7 @@ - + Email address already used SELECT COUNT(*) @@ -32,7 +32,7 @@ - + INSERT INTO users(username, userrealname, userpassword, useremail, verifyguid) VALUES(?, ?, ?, ?, uuid_generate_v4()) diff --git a/gentoobrowse/request/track.xml b/gentoobrowse/request/track.xml index c5e62e4..f1d3c3f 100644 --- a/gentoobrowse/request/track.xml +++ b/gentoobrowse/request/track.xml @@ -1,8 +1,8 @@ - - + + Package already tracked SELECT COUNT(*) @@ -15,7 +15,7 @@ - + INSERT INTO user_packages(packageid, userid, trackedsince) VALUES(?, ?, NOW()) diff --git a/gentoobrowse/request/untrack.xml b/gentoobrowse/request/untrack.xml index 93c5108..4394278 100644 --- a/gentoobrowse/request/untrack.xml +++ b/gentoobrowse/request/untrack.xml @@ -1,8 +1,8 @@ - - + + DELETE FROM user_packages WHERE packageid = ? diff --git a/gentoobrowse/views/categories.xml b/gentoobrowse/views/categories.xml index aeceb43..9e05f71 100644 --- a/gentoobrowse/views/categories.xml +++ b/gentoobrowse/views/categories.xml @@ -1,8 +1,8 @@ - - + + SELECT c.categoryid, MIN(c.name) AS catname, COUNT(*) AS packages FROM categories c, packages p diff --git a/gentoobrowse/views/category.xml b/gentoobrowse/views/category.xml index 1ba0fb5..cb810a9 100644 --- a/gentoobrowse/views/category.xml +++ b/gentoobrowse/views/category.xml @@ -1,8 +1,8 @@ - - + + SELECT c.name AS catname, p.name AS pkgname, p.description FROM categories c, packages p diff --git a/gentoobrowse/views/newebuilds.xml b/gentoobrowse/views/newebuilds.xml index 8f1b544..92d5fbd 100644 --- a/gentoobrowse/views/newebuilds.xml +++ b/gentoobrowse/views/newebuilds.xml @@ -1,7 +1,7 @@ - - + + SELECT filename, description, moddate, p.name AS pkgname, c.name AS catname, f.firstseen sync, up.trackedsince IS NOT NULL AS tracked @@ -23,7 +23,7 @@ - + SELECT DISTINCT f.firstseen AS synctime FROM files f diff --git a/gentoobrowse/views/newebuildsatom.xml b/gentoobrowse/views/newebuildsatom.xml index 93ae207..e758330 100644 --- a/gentoobrowse/views/newebuildsatom.xml +++ b/gentoobrowse/views/newebuildsatom.xml @@ -1,7 +1,7 @@ - - + + SELECT filename, description, moddate, p.name AS pkgname, c.name AS catname, f.firstseen sync FROM ebuilds e, files f, categories c, packages p, user_packages up, users u diff --git a/gentoobrowse/views/package.xml b/gentoobrowse/views/package.xml index 68ab0f6..5b0daab 100644 --- a/gentoobrowse/views/package.xml +++ b/gentoobrowse/views/package.xml @@ -1,8 +1,8 @@ - - + + SELECT p.packageid, p.name AS pkgname, p.description, p.firstseen, c.name AS catname FROM packages p, categories c @@ -14,7 +14,7 @@ - + SELECT trackedsince FROM user_packages up @@ -26,7 +26,7 @@ - + SELECT e.ebuildid, e.version, f.moddate, e.slot, e.license FROM ebuilds e, files f @@ -38,7 +38,7 @@ - + SELECT pu.url FROM package_urls pu @@ -49,7 +49,7 @@ - + SELECT u.* FROM ebuilds e, ebuild_uses u @@ -61,7 +61,7 @@ - + SELECT a.* FROM ebuilds e, ebuild_archs a @@ -73,7 +73,7 @@ - + SELECT b.bugid, b.summary FROM bugs b, package_bugs pb @@ -85,7 +85,7 @@ - + SELECT DISTINCT cd.name AS catname, pd.name AS pkgname, pd.description FROM ebuilds e, ebuild_deps d, packages pd, categories cd @@ -99,7 +99,7 @@ - + SELECT DISTINCT cd.name AS catname, pd.name AS pkgname, pd.description FROM ebuilds e, ebuild_rdeps d, packages pd, categories cd @@ -113,7 +113,7 @@ - + SELECT DISTINCT cd.name AS catname, pd.name AS pkgname, pd.description FROM ebuilds e, ( @@ -134,7 +134,7 @@ - + SELECT em.ebuildid, DENSE_RANK() OVER(ORDER BY em.setno) AS setno FROM ebuild_masks em, ebuilds e @@ -145,7 +145,7 @@ - + SELECT DISTINCT DENSE_RANK() OVER(ORDER BY em.setno), ms.person, ms.message, ms.dateadded FROM ebuild_masks em, ebuilds e, masksets ms @@ -158,7 +158,7 @@ - + SELECT line, content FROM files f, filecache fc, packages p, categories c diff --git a/gentoobrowse/views/search.xml b/gentoobrowse/views/search.xml index 3d6a72d..1b7a177 100644 --- a/gentoobrowse/views/search.xml +++ b/gentoobrowse/views/search.xml @@ -1,8 +1,8 @@ - - + + select c.name as catname, p.name as pkgname, description, ts_rank((setweight(to_tsvector('english', p.name), 'A') || setweight(to_tsvector('english', p.description), 'B')), -- cgit v1.2.3