Index: trunk/ippTools/share/disttool_toadvance.sql
===================================================================
--- trunk/ippTools/share/disttool_toadvance.sql	(revision 23742)
+++ trunk/ippTools/share/disttool_toadvance.sql	(revision 23777)
@@ -3,10 +3,10 @@
     stage,
     stage_id,
-    outroot,
+    CONCAT_WS('.', outroot, CONVERT(dist_id, CHAR)) as outdir,
     label,
     clean
 FROM
     (
--- raw stage
+-- raw stage not clean
 SELECT
     distRun.dist_id,
@@ -23,4 +23,5 @@
     WHERE
         distRun.state = 'new'
+        AND distRun.clean = 0
         AND distRun.fault = 0
         AND distRun.stage = 'raw'
@@ -31,4 +32,23 @@
         COUNT(rawImfile.class_id) = COUNT(distComponent.component)
         AND SUM(distComponent.fault) = 0
+UNION
+-- clean distribution of raw files (dbinfo only) only 1 component
+SELECT
+    distRun.dist_id,
+    stage,
+    stage_id,
+    outroot,
+    label,
+    clean
+    FROM distRun
+    LEFT JOIN distComponent
+        ON distRun.dist_id = distComponent.dist_id
+    WHERE
+        distRun.state = 'new'
+        AND distRun.clean
+        AND distRun.fault = 0
+        AND distRun.stage = 'raw'
+        AND distComponent.component IS NOT NULL
+        AND distComponent.fault = 0
 UNION
 -- chip stage
