Changeset 6df4b11
- Timestamp:
- May 17, 2010 10:44:46 AM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- 4b6909e
- Parents:
- baf19c6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/compose.py
rbaf19c6 r6df4b11 46 46 self.add_option('--format', dest='format', default="xml", 47 47 help='Output file format') 48 self.add_option('--lax', dest='lax', default=False, 49 action='store_true', 50 help='allow solutions where unrequired constraints fail') 48 51 49 52 @staticmethod … … 151 154 for c in candidates: 152 155 if not c.match: 153 match = None 156 rmatch = None # Match to a required constraint 157 umatch = None # Match to an unrequired constraint 154 158 for a in c.accepts: 155 159 for can in provides.get(a,[]): … … 159 163 if can.name != c.name and can.name[2] != c.name[2] and \ 160 164 not can.match: 161 match = can 165 # Now check that the candidate also accepts c 166 for ca in can.accepts: 167 if ca in c.provides: 168 if can.required: rmatch = can 169 else: umatch = can 170 break 171 162 172 # Within providers, prefer matches against required 163 # composition points 164 if can.required:173 # composition points. 174 if rmatch: 165 175 break 166 176 # Within acceptance categories, prefer matches against required 167 177 # composition points 168 if match and match.required:178 if rmatch: 169 179 break 170 180 171 # Done checking all possible matches. 181 # Move the better match over to the match variable 182 if rmatch: match = rmatch 183 elif umatch: match = umatch 184 else: match = None 185 186 # Done checking all possible matches. Record the match or note an 187 # unmatched candidate. 172 188 if match: 173 189 match.match = c … … 540 556 if not meet_constraints([c for c in constraints if c.required], 541 557 provides, accepts): 542 sys.exit("Could not meet all required constraints") 558 if opts.lax: 559 warn("warning: could not meet all required constraints") 560 else: 561 sys.exit("Failed: could not meet all required constraints") 543 562 544 563 meet_constraints([ c for c in constraints if not c.match ],
Note: See TracChangeset
for help on using the changeset viewer.