Index: tbroadcast/v2/python/tbroadcast.py
===================================================================
--- tbroadcast/v2/python/tbroadcast.py	(revision 236)
+++ tbroadcast/v2/python/tbroadcast.py	(revision 237)
@@ -29,4 +29,5 @@
     def instanciate_packages(self):
         # We create the schedule of the work units
+        print '# first, we initialize the DAG (takes a long time... huk should be improved asap) '
         cmd = 'cmt show uses'
         status, output = commands.getstatusoutput (cmd)
@@ -37,4 +38,5 @@
         current_package = self.get_current_package()
         self.packages [current_package] = {'version': '*', 'dependencies': list(), 'status': 'waiting', 'path':os.getcwd()}
+        indice  = 1
         for line in lines:
             if line [0] == '#' and line[:5] != "#CMT>" and line not in ['# Selection :','#']:
@@ -43,8 +45,10 @@
                 if name not in self.packages[current_package]['dependencies']:
                    self.packages[current_package]['dependencies'].append (name)                
+                   print '\n#', indice,':: add package', name
+                   indice = indice + 1
                 if not self.packages.has_key (name):
-                   self.packages [name] = {'version': version, 'dependencies': list(), 'status': 'waiting', 'path':self.get_package_path(name)}               
-                found = False
-                for ligne in lines:
+                   self.packages [name] = {'version': version, 'dependencies': list(), 'status': 'waiting', 'path': None}               
+                   found = False
+                   for ligne in lines:
                     if ligne [0] == '#' and ligne[:5] != "#CMT>" and ligne not in ['# Selection :','#']:                
                        if found:
@@ -52,4 +56,5 @@
                                if string.split (ligne)[2] not in self.packages[name]['dependencies']:
                                    self.packages[name]['dependencies'].append (string.split (ligne)[2])
+                                   print "# add dependency", string.split (ligne)[2], ' to package ',name
                            else:
                                 found = False                                                                                                   
@@ -57,4 +62,40 @@
                            level = string.find(ligne, 'use')
                            found = True   
+            if line[:4] == "use ":              
+                result  = string.split (line[4:len(line)], ' ')
+                if  self.packages.has_key(result[0]):
+                    if len(result)==4:
+                        name, version, offset, path = string.split (line[4:len(line)], " ")
+                        if os.path.exists(path[1:-1] + '/' + offset + '/' +name + '/' + version + '/cmt'):
+                            full_path = path[1:-1] + '/' + offset + '/' +name + '/' + version + '/cmt'
+                        elif os.path.exists(path[1:-1] + '/' + offset + '/' +name + '/cmt'):    
+                            full_path = path[1:-1] + '/' + offset + '/' +name + '/cmt'
+                        else:
+                            print '# error path not found for', name
+                            sys.exit(-1)   
+                    elif len(result)==5:
+                        name, version, offset, path, importation = string.split (line[4:len(line)], " ")                                        
+                        if os.path.exists(path[1:-1] + '/' + offset + '/' +name + '/' + version + '/cmt'):
+                            full_path = path[1:-1] + '/' + offset + '/' +name + '/' + version + '/cmt'
+                        elif os.path.exists(path[1:-1] + '/' + offset + '/' +name + '/cmt'):    
+                            full_path = path[1:-1] + '/' + offset + '/' +name + '/cmt'
+                        else:
+                            print '# error path not found for', name
+                            sys.exit(-1)                                                                                                   
+                    elif len(result)==3:
+                        name, version, path = string.split (line[4:len(line)], " ")
+                        if os.path.exists(path[1:-1] + '/' +name + '/' + version + '/cmt'):
+                            full_path = path[1:-1] + '/' +name + '/' + version + '/cmt'
+                        elif os.path.exists(path[1:-1] + '/' +name + + '/cmt'):    
+                            full_path = path[1:-1] + '/' +name + + '/cmt'
+                        else:
+                            print '# error path not found for', name
+                            sys.exit(-1)
+                    else:
+                        print "error:",line
+                        print str(result)
+                        sys.exit(-1) 
+                    self.packages[result[0]]['path'] = full_path
+        print '# really takes a long time... '
 
     def get_current_package(self):    
@@ -75,4 +116,5 @@
         
     def get_package_path (self, name):    
+        #return os.getcwd ()
         cmd = 'cmt -use='+name+' run pwd'
         status, output = commands.getstatusoutput (cmd)
@@ -82,5 +124,6 @@
         lines = string.split(output, '\n')
         for line in lines:
-            if line [0] != '#':
+            if line [0] != '#' and line[:5] != "#CMT>":
+                print line
                 return line 
  
Index: tbroadcast/v2/scripts/tbroadcast
===================================================================
--- tbroadcast/v2/scripts/tbroadcast	(revision 236)
+++ tbroadcast/v2/scripts/tbroadcast	(revision 237)
@@ -27,5 +27,5 @@
                       
     # we create a pool of num_worker worker threads
-    print 'num_worker', num_worker , command
+    #print 'num_worker', num_worker , command
     master = Scheduler (num_workers=num_worker)        
     master.execute_all (command)
