diff options
author | Denis Davydov <davydden@gmail.com> | 2016-07-07 19:18:10 +0200 |
---|---|---|
committer | Denis Davydov <davydden@gmail.com> | 2016-07-10 14:21:52 +0200 |
commit | b29d5e603209fe869dc5737d7d403c6f9536597f (patch) | |
tree | 3c633a7590b8efe6a441ab9ba20276f0233ff976 /lib | |
parent | b0f4052bd8aee7d77bb6dd8bb022553cd0a4593d (diff) | |
download | spack-b29d5e603209fe869dc5737d7d403c6f9536597f.tar.gz spack-b29d5e603209fe869dc5737d7d403c6f9536597f.tar.bz2 spack-b29d5e603209fe869dc5737d7d403c6f9536597f.tar.xz spack-b29d5e603209fe869dc5737d7d403c6f9536597f.zip |
add special treatment of develop version
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/concretize.py | 6 | ||||
-rw-r--r-- | lib/spack/spack/test/versions.py | 3 | ||||
-rw-r--r-- | lib/spack/spack/version.py | 8 |
3 files changed, 16 insertions, 1 deletions
diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py index f792008c49..d9992a5680 100644 --- a/lib/spack/spack/concretize.py +++ b/lib/spack/spack/concretize.py @@ -166,7 +166,11 @@ class DefaultConcretizer(object): valid_versions.sort(key=prefer_key, reverse=True) if valid_versions: - spec.versions = ver([valid_versions[0]]) + # Disregard @develop and take the next valid version + if ver(valid_versions[0]) == ver('develop') and len(valid_versions) > 1: + spec.versions = ver([valid_versions[1]]) + else: + spec.versions = ver([valid_versions[0]]) else: # We don't know of any SAFE versions that match the given # spec. Grab the spec's versions and grab the highest diff --git a/lib/spack/spack/test/versions.py b/lib/spack/spack/test/versions.py index a3a328fb14..41d72e7c34 100644 --- a/lib/spack/spack/test/versions.py +++ b/lib/spack/spack/test/versions.py @@ -92,6 +92,9 @@ class VersionsTest(unittest.TestCase): self.assert_ver_eq('1.0', '1.0') self.assert_ver_lt('1.0', '2.0') self.assert_ver_gt('2.0', '1.0') + self.assert_ver_eq('develop', 'develop') + self.assert_ver_lt('1.0', 'develop') + self.assert_ver_gt('develop', '1.0') def test_three_segments(self): self.assert_ver_eq('2.0.1', '2.0.1') diff --git a/lib/spack/spack/version.py b/lib/spack/spack/version.py index 6839643941..6f6c83b3d8 100644 --- a/lib/spack/spack/version.py +++ b/lib/spack/spack/version.py @@ -236,6 +236,14 @@ class Version(object): if self.version == other.version: return False + # dev is __gt__ than anything but itself. + if other.string == 'develop': + return True + + # If lhs is dev then it can't be < than anything + if self.string == 'develop': + return False + for a, b in zip(self.version, other.version): if a == b: continue |