From ade9525879ecd84233011cd9702053622ecd597f Mon Sep 17 00:00:00 2001 From: randomdan Date: Wed, 11 Aug 2010 22:38:30 +0000 Subject: Migrate package import to project2 sqlmerge Show bug summary on package page --- gentoobrowse/browse.xslt | 26 +++++++ gentoobrowse/console/bugassociate.xml | 18 +++++ gentoobrowse/console/bugimport.xml | 13 +--- gentoobrowse/console/packagefileimport.xml | 37 +++++++++ gentoobrowse/console/packageimport.xml | 121 +++++++++++++++++++++++++++++ gentoobrowse/views/package.xml | 12 +++ 6 files changed, 215 insertions(+), 12 deletions(-) create mode 100644 gentoobrowse/console/bugassociate.xml create mode 100644 gentoobrowse/console/packagefileimport.xml create mode 100644 gentoobrowse/console/packageimport.xml diff --git a/gentoobrowse/browse.xslt b/gentoobrowse/browse.xslt index db3f4f6..c356828 100644 --- a/gentoobrowse/browse.xslt +++ b/gentoobrowse/browse.xslt @@ -105,7 +105,10 @@ + + +
@@ -119,14 +122,37 @@ + + + +

Open bugs

+
    + +
+
+ +
  • + + http://bugs.gentoo.org/ + + + () +
  • +
    + + + + + +

    Dependencies

      diff --git a/gentoobrowse/console/bugassociate.xml b/gentoobrowse/console/bugassociate.xml new file mode 100644 index 0000000..b026205 --- /dev/null +++ b/gentoobrowse/console/bugassociate.xml @@ -0,0 +1,18 @@ + + + + + + SELECT b.bugid, p.packageid + FROM bugs b, packages p, categories c + WHERE p.categoryid = c.categoryid + AND TO_TSVECTOR('english', b.summary) @@ PLAINTO_TSQUERY('english', c.name || '/' || p.name) + + + bugid + packageid + + + + diff --git a/gentoobrowse/console/bugimport.xml b/gentoobrowse/console/bugimport.xml index 90b73ee..4e32e56 100644 --- a/gentoobrowse/console/bugimport.xml +++ b/gentoobrowse/console/bugimport.xml @@ -18,16 +18,5 @@ summary - - - SELECT b.bugid, p.packageid - FROM bugs b, packages p, categories c - WHERE p.categoryid = c.categoryid - AND TO_TSVECTOR('english', b.summary) @@ PLAINTO_TSQUERY('english', c.name || '/' || p.name) - - - bugid - packageid - - + diff --git a/gentoobrowse/console/packagefileimport.xml b/gentoobrowse/console/packagefileimport.xml new file mode 100644 index 0000000..270ef8b --- /dev/null +++ b/gentoobrowse/console/packagefileimport.xml @@ -0,0 +1,37 @@ + + + + + + + + filename + moddate + + + + filename + moddate + + + + + + + fileid + line + content + + + + fileid + line + content + + + + + diff --git a/gentoobrowse/console/packageimport.xml b/gentoobrowse/console/packageimport.xml new file mode 100644 index 0000000..6f8d39d --- /dev/null +++ b/gentoobrowse/console/packageimport.xml @@ -0,0 +1,121 @@ + + + + + + SELECT DISTINCT (REGEXP_MATCHES(filename, '^[^/]+'))[1] AS name FROM files + + name + + + + + + SELECT c.categoryid, f.name, fc.content AS description FROM ( + SELECT MAX(fileid) AS fileid, + (REGEXP_MATCHES(filename, '^[^/]+'))[1] AS cat, + (REGEXP_MATCHES(filename, '/(.+)-[0-9]'))[1] AS name + FROM files f + GROUP BY cat, name) f LEFT OUTER JOIN filecache fc + ON fc.fileid = f.fileid AND fc.line = 8, + categories c + WHERE c.name = f.cat + + + categoryid + name + description + + + + + + SELECT packageid, version, fileid AS ebuildid, ebuildversion_constructor(version) AS versioninst + FROM ( SELECT f.fileid, + (REGEXP_MATCHES(filename, '^[^/]+'))[1] AS cat, + (REGEXP_MATCHES(filename, '/(.+)-[0-9]'))[1] AS name, + (REGEXP_MATCHES(filename, '/.+-([0-9].*)$'))[1] AS version + FROM files f) f, categories c, packages p + WHERE f.cat = c.name + AND c.categoryid = p.categoryid + AND p.name = f.name + + + ebuildid + packageid + version + versioninst + + + + + + SELECT DISTINCT f.fileid AS ebuildid, REGEXP_SPLIT_TO_TABLE(f.content, ' ') AS arch + FROM filecache f + WHERE f.line = 9 + + + ebuildid + arch + + + + + + SELECT DISTINCT f.fileid AS ebuildid, REGEXP_SPLIT_TO_TABLE(f.content, ' ') AS use + FROM filecache f + WHERE f.line = 11 + + + ebuildid + use + + + + + + SELECT DISTINCT e.packageid, REGEXP_SPLIT_TO_TABLE(f.content, ' ') AS url + FROM filecache f, ebuilds e + WHERE f.line = 6 + AND f.fileid = e.ebuildid + + + packageid + url + + + + + + 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, + '([^a-z0-9]*)([a-z0-9-]+)/([a-z0-9-]+?)(-([0-9][^:]*))?(:([0-9.]+))?(\\[([^]]+)\\])?') as field + FROM ( + SELECT f.fileid, REGEXP_SPLIT_TO_TABLE(f.content, ' ') AS dep + FROM filecache f + WHERE line = 1 + ) src + ) AS src2 + ) AS src3, categories c, packages p + WHERE p.categoryid = c.categoryid + AND p.name = pkg + AND c.name = cat + + + ebuildid + packageid + slot + op + versionspec + flags + + + + + diff --git a/gentoobrowse/views/package.xml b/gentoobrowse/views/package.xml index 6ec12ec..ba5041b 100644 --- a/gentoobrowse/views/package.xml +++ b/gentoobrowse/views/package.xml @@ -72,6 +72,18 @@ + + + SELECT b.bugid, b.summary + FROM bugs b, package_bugs pb + WHERE b.bugid = pb.bugid + AND pb.packageid = ? + ORDER BY b.bugid + + + + + SELECT distinct cd.name AS catname, pd.name AS pkgname, pd.description -- cgit v1.2.3