summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2010-06-11 17:59:55 +0000
committerrandomdan <randomdan@localhost>2010-06-11 17:59:55 +0000
commiteaab5e9b44a0b26727d7a1b6ec21f3b002626995 (patch)
tree8a97ab24e7aaad906481161bbcfa39d12edc5869
parentFix age field of new ebuilds (diff)
downloadgentoobrowse-eaab5e9b44a0b26727d7a1b6ec21f3b002626995.tar.bz2
gentoobrowse-eaab5e9b44a0b26727d7a1b6ec21f3b002626995.tar.xz
gentoobrowse-eaab5e9b44a0b26727d7a1b6ec21f3b002626995.zip
Use last seen ebuild time instead of NOW() in newebuilds query
-rw-r--r--gentoobrowse/views/newebuilds.xml6
1 files changed, 3 insertions, 3 deletions
diff --git a/gentoobrowse/views/newebuilds.xml b/gentoobrowse/views/newebuilds.xml
index 0ba5886..46a64f9 100644
--- a/gentoobrowse/views/newebuilds.xml
+++ b/gentoobrowse/views/newebuilds.xml
@@ -3,13 +3,13 @@
<xi:include href="../datasources/postgres.xml" />
<sqlview name="newebuilds" recordname="ebuild" datasource="postgres">
<sql>
- SELECT filename, EXTRACT('day' FROM NOW()) - EXTRACT('day' FROM f.firstseen) AS age, description,
- moddate, p.name AS pkgname, c.name AS catname
+ SELECT filename, description, moddate, p.name AS pkgname, c.name AS catname,
+ EXTRACT('day' FROM (SELECT MAX(fm.firstseen) FROM files fm)) - EXTRACT('day' FROM f.firstseen) AS age
FROM ebuilds e, files f, packages p, categories c
WHERE e.ebuildid = f.fileid
AND e.packageid = p.packageid
AND p.categoryid = c.categoryid
- AND f.firstseen &gt; DATE_TRUNC('day', NOW()) - INTERVAL '3 days'
+ AND f.firstseen &gt; (SELECT MAX(fm.firstseen) - INTERVAL '2.1 days' FROM files fm)
ORDER BY c.name, p.name, e.versioninst
</sql>
</sqlview>