Fix problem with pure integer arguments in preferred versions list (e.g, 2 instead of 2.7.3)
This commit is contained in:
parent
87db69478d
commit
a384ad5b12
@ -214,7 +214,8 @@
|
|||||||
'version': {
|
'version': {
|
||||||
'type' : 'array',
|
'type' : 'array',
|
||||||
'default' : [],
|
'default' : [],
|
||||||
'items' : { 'type' : 'string' } }, #version strings
|
'items' : { 'anyOf' : [ { 'type' : 'string' },
|
||||||
|
{ 'type' : 'number'}]}}, #version strings
|
||||||
'compiler': {
|
'compiler': {
|
||||||
'type' : 'array',
|
'type' : 'array',
|
||||||
'default' : [],
|
'default' : [],
|
||||||
@ -573,7 +574,7 @@ def __init__(self, validation_error, data):
|
|||||||
# Try to get line number from erroneous instance and its parent
|
# Try to get line number from erroneous instance and its parent
|
||||||
instance_mark = getattr(validation_error.instance, '_start_mark', None)
|
instance_mark = getattr(validation_error.instance, '_start_mark', None)
|
||||||
parent_mark = getattr(validation_error.parent, '_start_mark', None)
|
parent_mark = getattr(validation_error.parent, '_start_mark', None)
|
||||||
path = getattr(validation_error, 'path', None)
|
path = [str(s) for s in getattr(validation_error, 'path', None)]
|
||||||
|
|
||||||
# Try really hard to get the parent (which sometimes is not
|
# Try really hard to get the parent (which sometimes is not
|
||||||
# set) This digs it out of the validated structure if it's not
|
# set) This digs it out of the validated structure if it's not
|
||||||
|
@ -45,7 +45,7 @@ def _order_for_package(self, pkgname, component, second_key, test_all=True):
|
|||||||
order = order.get(second_key, {})
|
order = order.get(second_key, {})
|
||||||
if not order:
|
if not order:
|
||||||
continue
|
continue
|
||||||
return [s.strip() for s in order]
|
return [str(s).strip() for s in order]
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
@ -98,11 +98,11 @@ def _spec_compare(self, pkgname, component, a, b, reverse_natural_compare, secon
|
|||||||
b_index = None
|
b_index = None
|
||||||
reverse = -1 if reverse_natural_compare else 1
|
reverse = -1 if reverse_natural_compare else 1
|
||||||
for i, cspec in enumerate(specs):
|
for i, cspec in enumerate(specs):
|
||||||
if a_index == None and cspec.satisfies(a):
|
if a_index == None and (cspec.satisfies(a) or a.satisfies(cspec)):
|
||||||
a_index = i
|
a_index = i
|
||||||
if b_index:
|
if b_index:
|
||||||
break
|
break
|
||||||
if b_index == None and cspec.satisfies(b):
|
if b_index == None and (cspec.satisfies(b) or b.satisfies(cspec)):
|
||||||
b_index = i
|
b_index = i
|
||||||
if a_index:
|
if a_index:
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user