From df0e85a04a12017006222d750e1a8f92dc1abc67 Mon Sep 17 00:00:00 2001 From: randomdan Date: Sun, 12 Sep 2010 13:47:47 +0000 Subject: Import the masks Fix filecache updating Make things seperate files --- gentoobrowse/console/fileimport.xml | 56 +++++++++++++++++++++++++++++ gentoobrowse/console/packagefileimport.xml | 58 ++---------------------------- gentoobrowse/console/packagemasks.xml | 45 +++++++++++++++++++++++ 3 files changed, 103 insertions(+), 56 deletions(-) create mode 100644 gentoobrowse/console/fileimport.xml create mode 100644 gentoobrowse/console/packagemasks.xml diff --git a/gentoobrowse/console/fileimport.xml b/gentoobrowse/console/fileimport.xml new file mode 100644 index 0000000..5d326e9 --- /dev/null +++ b/gentoobrowse/console/fileimport.xml @@ -0,0 +1,56 @@ + + + + + + + SELECT filetypeid, searchroot, LENGTH(searchroot) + 1 || '-' AS rootlen, searchspec + FROM filetypes + ORDER BY filetypeid DESC + + + + filetypeid + filename + moddate + + + + + filename + moddate + filetypeid + + + + + + + SELECT f.fileid, ft.searchroot || f.filename AS filename, f.cachedat, f.moddate + FROM files f, filetypes ft + WHERE (f.cachedat IS NULL OR f.cachedat != f.moddate) + AND f.filetypeid = ft.filetypeid + ORDER BY f.fileid; + + + + fileid + line + content + + + + + fileid + line + content + + + + UPDATE files SET cachedat = moddate WHERE cachedat != moddate OR cachedat IS NULL + + diff --git a/gentoobrowse/console/packagefileimport.xml b/gentoobrowse/console/packagefileimport.xml index 422655f..99cd60a 100644 --- a/gentoobrowse/console/packagefileimport.xml +++ b/gentoobrowse/console/packagefileimport.xml @@ -2,61 +2,7 @@ - - - - - SELECT filetypeid, searchroot, LENGTH(searchroot) + 1 || '-' AS rootlen, searchspec - FROM filetypes - ORDER BY filetypeid DESC - - - - filetypeid - filename - moddate - - - - - filename - moddate - filetypeid - - - - - - - SELECT f.fileid, ft.searchroot || f.filename AS filename, f.cachedat, f.moddate - FROM files f, filetypes ft - WHERE (f.cachedat IS NULL OR f.cachedat != f.moddate) - AND f.filetypeid = ft.filetypeid - ORDER BY f.fileid; - - - - fileid - line - content - - - - UPDATE files SET cachedat = moddate WHERE fileid = ? - - - - - - - fileid - line - content - - - + + diff --git a/gentoobrowse/console/packagemasks.xml b/gentoobrowse/console/packagemasks.xml new file mode 100644 index 0000000..20fd8fd --- /dev/null +++ b/gentoobrowse/console/packagemasks.xml @@ -0,0 +1,45 @@ + + + + + + SELECT d.setno, + MIN(field[1]) AS person, + MIN(field[2]) AS email, + CAST((REGEXP_MATCHES(MIN(field[3]), '(\\d+ *(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec) \\d+)', 'i'))[1] AS DATE) AS dateadded, + TRIM(STRING_AGG(REGEXP_REPLACE(content, '^#+', ''), ' ' ORDER BY m.line)) AS message + FROM (SELECT setno, line AS line, REGEXP_MATCHES(content, '^# *(.+) +< *(.+) *> \\( *(.+) *\\)$') AS field + FROM file_masks_withset + WHERE line IN(SELECT min(line) + FROM file_masks_withset + GROUP BY setno)) AS d, + (SELECT c.line, c.content, c.setno + FROM file_masks_withset c + WHERE c.content LIKE '#%') AS m + WHERE m.setno = d.setno + AND m.line > d.line + GROUP BY d.setno + + + setno + person + email + dateadded + message + + + + + SELECT line, setno, ebuildfilter(content) AS ebuildid + FROM file_masks_withset + WHERE content NOT LIKE '#%' + + + line + setno + ebuildid + + + + -- cgit v1.2.3