cwctl.py
branchstable
changeset 4798 d5bd706e9005
parent 4721 8f63691ccb7f
child 5021 58e89f3dfbae
child 5042 cc062bb09abb
equal deleted inserted replaced
4794:81075b09ebf1 4798:d5bd706e9005
   202         for cube, versions in sorted(self.constraints.items()):
   202         for cube, versions in sorted(self.constraints.items()):
   203             oper, version = None, None
   203             oper, version = None, None
   204             # simplify constraints
   204             # simplify constraints
   205             if versions:
   205             if versions:
   206                 for constraint in versions:
   206                 for constraint in versions:
   207                     op, ver = constraint.split()
   207                     op, ver = constraint
   208                     if oper is None:
   208                     if oper is None:
   209                         oper = op
   209                         oper = op
   210                         version = ver
   210                         version = ver
   211                     elif op == '>=' and oper == '>=':
   211                     elif op == '>=' and oper == '>=':
   212                         version = max_version(ver, version)
   212                         version = max_version(ver, version)
   236                 self.warnings.append('cube %s should define __depends_cubes__' % cube)
   236                 self.warnings.append('cube %s should define __depends_cubes__' % cube)
   237                 use = dict((key, None) for key in info.__use__)
   237                 use = dict((key, None) for key in info.__use__)
   238             for name, constraint in use.items():
   238             for name, constraint in use.items():
   239                 self.constraints.setdefault(name,set())
   239                 self.constraints.setdefault(name,set())
   240                 if constraint:
   240                 if constraint:
   241                     self.constraints[name].add(constraint)
   241                     try:
       
   242                         oper, version = constraint.split()
       
   243                         self.constraints[name].add( (oper, version) )
       
   244                     except:
       
   245                         self.warnings.append('cube %s depends on %s but constraint badly formatted: %s'
       
   246                                              % (cube, name, constraint))
   242                 self.reverse_constraints.setdefault(name, set()).add(cube)
   247                 self.reverse_constraints.setdefault(name, set()).add(cube)
   243 
   248 
   244 class ListCommand(Command):
   249 class ListCommand(Command):
   245     """List configurations, cubes and instances.
   250     """List configurations, cubes and instances.
   246 
   251