- l_section_names = aProd.keys()
- l_section_ranges = []
- tagged = []
- for name in l_section_names:
- # DBG.write("name", name,True)
- aRange = VMMP.getRange_majorMinorPatch(name)
- if aRange is not None:
- DBG.write("found version range for section '%s'" % name, aRange, verbose)
- l_section_ranges.append((name, aRange))
-
- if versionMMP is not None and len(l_section_ranges) > 0:
- for name, (vmin, vmax) in l_section_ranges:
- if versionMMP >= vmin and versionMMP <= vmax:
- tagged.append((name, [vmin, vmax]))
-
- if len(tagged) > 1:
- DBG.write("multiple version ranges tagged for '%s', fix it" % version,
- PP.pformat(tagged), True)
- return None
- if len(tagged) == 1: # ok
- DBG.write("one version range tagged for '%s'" % version,
- PP.pformat(tagged), verbose)
- name, (vmin, vmax) = tagged[0]
- prod_info = aProd[name]
- prod_info.section = name
- prod_info.from_file = aProd.from_file
- return prod_info
-
- # Else, get the standard informations
- if "default" in aProd:
- # returns the generic information (given version not found)
- prod_info = aProd.default
- DBG.write("default tagged for '%s'" % version, prod_info, verbose)
- prod_info.section = "default"
+ else:
+ l_section_names = aProd.keys()
+ l_section_ranges = []
+ tagged = []
+ for name in l_section_names:
+ # DBG.write("name", name,True)
+ aRange = VMMP.getRange_majorMinorPatch(name)
+ if aRange is not None:
+ DBG.write("found version range for section '%s'" % name, aRange, verbose)
+ l_section_ranges.append((name, aRange))
+
+ if versionMMP is not None and len(l_section_ranges) > 0:
+ for name, (vmin, vmax) in l_section_ranges:
+ if versionMMP >= vmin and versionMMP <= vmax:
+ tagged.append((name, [vmin, vmax]))
+
+ if len(tagged) > 1:
+ DBG.write("multiple version ranges tagged for '%s', fix it" % version,
+ PP.pformat(tagged), True)
+ pi=None
+ elif len(tagged) == 1: # ok
+ DBG.write("one version range tagged for '%s'" % version,
+ PP.pformat(tagged), verbose)
+ name, (vmin, vmax) = tagged[0]
+ pi = aProd[name]
+ pi.section = name
+ pi.from_file = aProd.from_file
+
+ # Else, get the standard informations
+ elif "default" in aProd:
+ # returns the generic information (given version not found)
+ pi = aProd.default
+ DBG.write("default tagged for '%s'" % version, pi, verbose)
+ pi.section = "default"
+ pi.from_file = aProd.from_file
+ else:
+ pi=None
+
+ if is_incr:
+ # If the definition is incremental, we take the default section
+ # and then complete it with other sections :
+ # - default_win
+ # - the selected section (pi)
+ # - the selected _win section
+ prod_info=aProd["default"]