[Blends-commit] [SCM] website branch, master, updated. 9bdd13d35d2f3e19a49cb18572f66766e25619ca

Andreas Tille tille at debian.org
Mon Sep 9 11:14:23 UTC 2013


The following commit has been merged in the master branch:
commit 9bdd13d35d2f3e19a49cb18572f66766e25619ca
Author: Andreas Tille <tille at debian.org>
Date:   Mon Sep 9 13:17:22 2013 +0200

    Need to revise the aggregation od packages into different tasks (in an array) and the dependency relation.  The current way is wrong because a package can have different dependency relation in different tasks.

diff --git a/misc/sql/bugs.sh b/misc/sql/bugs.sh
index 1da0817..413bf92 100755
--- a/misc/sql/bugs.sh
+++ b/misc/sql/bugs.sh
@@ -8,48 +8,44 @@ if [ $# -lt 1 ] ; then
 fi
 
 psql udd > $1_buggy_packages.out <<EOT
-SELECT distinct sources.source, tasks.tasks, CASE WHEN dependency = 'd' AND component = 'main' THEN 'depends' ELSE 'suggests' END AS status, version, homepage, vcs_browser, maintainer
-  FROM (
-  SELECT s.source, b.dependency, b.component, s.homepage, s.vcs_browser, s.maintainer, s.version, row_number() OVER (PARTITION BY s.source ORDER BY s.version DESC)
-    FROM blends_dependencies b
-    JOIN packages p ON p.package = b.package
-    JOIN bugs bu    ON bu.source = p.source
-    JOIN sources s  ON s.source  = p.source
-    WHERE (blend = '$1' AND b.distribution = 'debian')
-       OR bu.source IN (SELECT metapackage_name FROM blends_tasks WHERE blend = '$1' AND metapackage)
-  GROUP BY s.source, b.dependency, b.component, s.homepage, s.vcs_browser, s.maintainer, s.version
-  ) sources
-  LEFT OUTER JOIN (
-   SELECT * FROM (
-    SELECT source, array_agg(task) AS tasks FROM (
-     SELECT DISTINCT p.source, b.task
-      FROM packages p
-      JOIN releases r ON p.release = r.release
-      JOIN blends_dependencies b ON b.package = p.package
-      JOIN sources s ON p.source = s.source AND p.release = s.release
-      WHERE b.blend = '$1'
-    ) tmp1
-    GROUP BY source
-   ) tmp2
-    UNION
-    SELECT metapackage_name AS source, ARRAY[task] AS tasks FROM blends_tasks WHERE blend = '$1' AND metapackage
-  ) tasks ON sources.source = tasks.source
-  WHERE row_number = 1
-  ORDER BY source;
+      SELECT distinct sources.source, tasks.tasks, CASE WHEN dependency = 'd' AND component = 'main' THEN 'depends' ELSE 'suggests' END AS status, homepage, vcs_browser, maintainer
+        FROM (
+          SELECT s.source, b.dependency, b.component, s.homepage, s.vcs_browser, s.maintainer, s.version, row_number() OVER (PARTITION BY s.source ORDER BY s.version DESC)
+            FROM blends_dependencies b
+            JOIN packages p ON p.package = b.package
+            JOIN bugs bu    ON bu.source = p.source
+            JOIN sources s  ON s.source  = p.source
+            WHERE blend = '$1' AND b.distribution = 'debian'
+            GROUP BY s.source, b.dependency, b.component, s.homepage, s.vcs_browser, s.maintainer, s.version
+        ) sources
+        LEFT OUTER JOIN (
+          SELECT source, array_agg(task) AS tasks FROM (
+            SELECT DISTINCT p.source, b.task
+              FROM packages p
+              JOIN releases r ON p.release = r.release
+              JOIN blends_dependencies b ON b.package = p.package
+              JOIN sources s ON p.source = s.source AND p.release = s.release
+              WHERE b.blend = '$1'
+          ) tmp
+          GROUP BY source
+        ) tasks ON sources.source = tasks.source
+        WHERE row_number = 1
+        ORDER BY source;
 EOT
 
-psql udd > $1_bugs_packages.out <<EOT
-SELECT source, bu.id, title, status, done_by, tags FROM (
-  SELECT distinct bu.source, bu.id, bu.title, bu.status, bu.done AS done_by
-    FROM blends_dependencies b
-    JOIN packages p ON p.package = b.package
-    JOIN bugs bu    ON bu.source = p.source
-    WHERE (blend = '$1' AND b.distribution = 'debian')
-       OR bu.source IN (SELECT metapackage_name FROM blends_tasks WHERE blend = '$1' AND metapackage)
-  ) bu
-  LEFT OUTER JOIN (
-    SELECT id, array_agg(tag) AS tags FROM bugs_tags GROUP BY id
-  ) bt ON bu.id = bt.id
-  ORDER BY source, bu.id;
+exit
+
+psql udd >> $1_buggy_packages.out <<EOT
+      SELECT source, bu.id, title, severity, status, done_by, tags FROM (
+        SELECT distinct bu.source, bu.id, bu.title, bu.severity, bu.status, bu.done AS done_by
+          FROM blends_dependencies b
+          JOIN packages p ON p.package = b.package
+          JOIN bugs bu    ON bu.source = p.source
+          WHERE blend = '$1' AND b.distribution = 'debian'
+        ) bu
+        LEFT OUTER JOIN (
+          SELECT id, array_agg(tag) AS tags FROM bugs_tags GROUP BY id
+        ) bt ON bu.id = bt.id
+        ORDER BY source, bu.id;
 EOT
 

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list