[Blends-commit] [SCM] blends-gsoc branch, master, updated. f98835fa959dc6c1dd0da5d6e83c2aed9e28501c

Emmanouil Kiagias e.kiagias at gmail.com
Thu Jun 27 23:08:22 UTC 2013


The following commit has been merged in the master branch:
commit f98835fa959dc6c1dd0da5d6e83c2aed9e28501c
Author: Emmanouil Kiagias <e.kiagias at gmail.com>
Date:   Fri Jun 28 01:07:44 2013 +0200

    argument -c or -t is now required, fixed 'Key' field in generated task-description files, task fields Priority : extra , Section : misc have now default values. Let step is to change the sql statements to read info from new/updated UDD blends' tables

diff --git a/blend-gen-control b/blend-gen-control
index 0a82d54..1a81aa1 100755
--- a/blend-gen-control
+++ b/blend-gen-control
@@ -135,12 +135,10 @@ class UDD_connector:
         blends_dependencies = {}
 
         query="""
-            SELECT distinct t.task, t.description, t.metapackage, t.long_description,
-              p.priority as "Priority", p.section as "Section", p.enhances as "Enhances"
-                FROM blends_tasks t LEFT OUTER JOIN packages p ON  '{2}-' || t.task  = p.package 
-                    LEFT OUTER JOIN releases r ON p.release = r.release
-            WHERE t.blend='{0}' and (r.role = '{1}' or r.role is NULL )
-            """.format(blendname, release, tasksprefix)
+            SELECT distinct t.task, t.description, t.metapackage, t.long_description
+                FROM blends_tasks t
+            WHERE t.blend='{0}'
+            """.format(blendname)
 
         self.__execute_query(query)
 
@@ -164,14 +162,17 @@ class UDD_connector:
                 #results[i+1] cause we start from index 1 (desc[1:]) and not from 0
                 blends_dependencies[task][column[0]] = result[i+1]
 
-
-            ##TODO: comment out
-            #self.logger.debug(blends_dependencies[task])
+            #FIXME for the moment just initialize these headers with default values, later
+            #they will be taken from the new blends_tasks table
+            blends_dependencies[task]["Section"] = "misc"
+            blends_dependencies[task]["Priority"] = "extra"
+            blends_dependencies[task]["Enhances"] = None
 
             #also initialize empty lists for the following keys:
             for key in ["Depends", "Recommends", "Suggests", "Ignores"]:
                 blends_dependencies[task][key] = []
-                
+            
+
             result = self.cursor.fetchone()
         
         return blends_dependencies
@@ -360,7 +361,7 @@ def gen_task_desc(**kwargs):
             if blend_dependencies[task]["metapackage"]:
                 #No use listing a metapackage as a key package, if no metapackage exist.
                 fout.write("Key: \n");
-                fout.write(" {0}\n".format(tasksprefix, task))
+                fout.write(" {0}-{1}\n".format(tasksprefix, task))
 
             fout.write("Packages: list\n ")
             for header in ["Depends", "Recommends"]:
@@ -401,6 +402,11 @@ def main():
     logger = logging.getLogger(__name__)
     #----------------------------end of argparse and setup logging--------------------------------------#
 
+    #at least a -c or -t argument must be provided
+    if not args.taskdesc and not args.gencontrol:
+        logger.error("Argument -c(generate control file) or -t(generate task description file) is required.")
+        sys.exit(-1)
+
     hasconfig = False
     config_file = "config/control"
 
diff --git a/sql/tasksinfo b/sql/tasksinfo
index ed69941..4f1495d 100755
--- a/sql/tasksinfo
+++ b/sql/tasksinfo
@@ -1,10 +1,11 @@
 #!/bin/bash
 
-#example of sql used in blend-gen-control
 #arguments: blends, tasksprefix, release-role
 #example of usage ./taskinfo debian-med med testing
 
-#TODO need to check again if this is the proper sql to get this output
+#this sql is no more used in blend-gen-control because of "circular dependency" and
+#also these fields(Section, Enhances etc) will be included in blends_tasks
+#relevant discussion : http://lists.debian.org/debian-blends/2013/06/msg00025.html
 psql udd << EOT
 SELECT  distinct t.task, t.description, p.priority as "Priority", p.section as "Section", p.enhances as "Enhances"
     FROM blends_tasks t LEFT OUTER JOIN packages p ON  '$2-' || t.task  = p.package 

-- 
Git repository for blends-gsoc code



More information about the Blends-commit mailing list