[Blends-commit] [SCM] website branch, master, updated. 77950e3eb7326e2fa4d67d78f055d2f54e40116d

Andreas Tille tille at debian.org
Fri Jun 7 17:06:36 UTC 2013


The following commit has been merged in the master branch:
commit 77950e3eb7326e2fa4d67d78f055d2f54e40116d
Author: Andreas Tille <tille at debian.org>
Date:   Fri Jun 7 19:02:46 2013 +0200

    Avoid duplicated entries for those packages that might have changed their homepage over time

diff --git a/misc/sql/gis-thermometer.sh b/misc/sql/gis-thermometer.sh
index 05927a8..80aff36 100755
--- a/misc/sql/gis-thermometer.sh
+++ b/misc/sql/gis-thermometer.sh
@@ -26,20 +26,40 @@ SELECT b.source,
        homepage,
        wnpp
  FROM (
-  SELECT DISTINCT p.source, p.homepage, '' AS wnpp FROM packages p
+  SELECT DISTINCT p.source, '' AS wnpp FROM packages p
   JOIN blends_dependencies bd ON bd.package = p.package
   JOIN releases r ON p.release = r.release
   WHERE bd.blend = '$1' AND
         (r.sort >= (SELECT sort FROM releases WHERE role = 'stable') OR r.sort = 0) -- forget older releases than stable but allow experimental
   UNION
-  SELECT DISTINCT u.source, u.homepage, '' AS wnpp FROM ubuntu_packages u
+  SELECT DISTINCT u.source, '' AS wnpp FROM ubuntu_packages u
   JOIN blends_dependencies bd ON bd.package = u.package
   WHERE bd.blend = '$1' AND bd.distribution = 'ubuntu'
   UNION
-  SELECT DISTINCT pr.source, pr.homepage, CASE WHEN wnpp!=0 THEN CAST(pr.wnpp AS text) ELSE '' END AS wnpp FROM blends_prospectivepackages pr
+  SELECT DISTINCT pr.source, CASE WHEN wnpp!=0 THEN CAST(pr.wnpp AS text) ELSE '' END AS wnpp FROM blends_prospectivepackages pr
   JOIN blends_dependencies bd ON bd.package = pr.package
   WHERE bd.blend = '$1' AND bd.distribution = 'prospective'
  ) b
+ LEFT OUTER JOIN ( SELECT source, homepage FROM (
+  SELECT source, homepage, row_number() OVER (PARTITION BY source ORDER BY version DESC) FROM (
+   SELECT DISTINCT p.source, p.homepage, p.version FROM packages p
+     JOIN blends_dependencies bd ON bd.package = p.package
+     JOIN releases r ON p.release = r.release
+     WHERE bd.blend = '$1' AND
+        (r.sort >= (SELECT sort FROM releases WHERE role = 'stable') OR r.sort = 0) -- forget older releases than stable but allow experimental
+   UNION
+   SELECT DISTINCT u.source, u.homepage, u.version FROM ubuntu_packages u
+     JOIN blends_dependencies bd ON bd.package = u.package
+     WHERE bd.blend = '$1' AND bd.distribution = 'ubuntu'
+     UNION
+   SELECT DISTINCT pr.source, pr.homepage,  pr.chlog_version as version FROM blends_prospectivepackages pr
+     JOIN blends_dependencies bd ON bd.package = pr.package
+     WHERE bd.blend = '$1' AND bd.distribution = 'prospective'
+   ) hpversion
+  GROUP BY source, homepage, version
+  ) tmp
+  WHERE row_number = 1
+ ) homepage ON b.source = homepage.source
  LEFT OUTER JOIN (
   SELECT DISTINCT p.source, strip_binary_upload(MAX(s.version)) AS version
     FROM packages p

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list