diff options
author | Matthew LeGendre <legendre1@llnl.gov> | 2016-03-09 16:11:33 -0800 |
---|---|---|
committer | Matthew LeGendre <legendre1@llnl.gov> | 2016-03-09 16:11:33 -0800 |
commit | a384ad5b1270140d71110e46d39144a0f0e9081e (patch) | |
tree | 83172e4340afeffb3b9ddd14f1098b9c15171272 | |
parent | 87db69478d021d16cc4770d804e7ccf94161d85b (diff) | |
download | spack-a384ad5b1270140d71110e46d39144a0f0e9081e.tar.gz spack-a384ad5b1270140d71110e46d39144a0f0e9081e.tar.bz2 spack-a384ad5b1270140d71110e46d39144a0f0e9081e.tar.xz spack-a384ad5b1270140d71110e46d39144a0f0e9081e.zip |
Fix problem with pure integer arguments in preferred versions list (e.g, 2 instead of 2.7.3)
-rw-r--r-- | lib/spack/spack/config.py | 5 | ||||
-rw-r--r-- | lib/spack/spack/preferred_packages.py | 6 |
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/spack/spack/config.py b/lib/spack/spack/config.py index 807a898644..95a988f7ff 100644 --- a/lib/spack/spack/config.py +++ b/lib/spack/spack/config.py @@ -214,7 +214,8 @@ section_schemas = { 'version': { 'type' : 'array', 'default' : [], - 'items' : { 'type' : 'string' } }, #version strings + 'items' : { 'anyOf' : [ { 'type' : 'string' }, + { 'type' : 'number'}]}}, #version strings 'compiler': { 'type' : 'array', 'default' : [], @@ -573,7 +574,7 @@ class ConfigFormatError(ConfigError): # Try to get line number from erroneous instance and its parent instance_mark = getattr(validation_error.instance, '_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 # set) This digs it out of the validated structure if it's not diff --git a/lib/spack/spack/preferred_packages.py b/lib/spack/spack/preferred_packages.py index 2b0ba791b6..eaea016a85 100644 --- a/lib/spack/spack/preferred_packages.py +++ b/lib/spack/spack/preferred_packages.py @@ -45,7 +45,7 @@ class PreferredPackages(object): order = order.get(second_key, {}) if not order: continue - return [s.strip() for s in order] + return [str(s).strip() for s in order] return [] @@ -98,11 +98,11 @@ class PreferredPackages(object): b_index = None reverse = -1 if reverse_natural_compare else 1 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 if b_index: break - if b_index == None and cspec.satisfies(b): + if b_index == None and (cspec.satisfies(b) or b.satisfies(cspec)): b_index = i if a_index: break |