summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2017-07-24 15:02:13 -0500
committerTodd Gamblin <tgamblin@llnl.gov>2017-07-24 13:02:13 -0700
commit250ee413e9f37e36e91ccc5ffec8fb294faf1620 (patch)
tree3bdb6824643306aa2ce9301d5526c7eb1f710719 /var
parentdf2fc25ddfeef564ae10bc8dc7f8c394591eed0c (diff)
downloadspack-250ee413e9f37e36e91ccc5ffec8fb294faf1620.tar.gz
spack-250ee413e9f37e36e91ccc5ffec8fb294faf1620.tar.bz2
spack-250ee413e9f37e36e91ccc5ffec8fb294faf1620.tar.xz
spack-250ee413e9f37e36e91ccc5ffec8fb294faf1620.zip
Change Version formatting properties and functions to return Version objects (#4834)
* Change version.up_to() to return Version() object * Add unit tests for Version.up_to() * Fix packages that expected up_to() to return a string * Ensure that up_to() preserves separator characters * Use version indexing instead of up_to * Make all Version formatting properties return Version objects * Update docs * Tests need to test string representation
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/lua/package.py4
-rw-r--r--var/spack/repos/builtin/packages/magics/package.py2
-rw-r--r--var/spack/repos/builtin/packages/qt/package.py4
-rw-r--r--var/spack/repos/builtin/packages/sublime-text/package.py2
4 files changed, 6 insertions, 6 deletions
diff --git a/var/spack/repos/builtin/packages/lua/package.py b/var/spack/repos/builtin/packages/lua/package.py
index 0680e1a3b5..ecb2a8b543 100644
--- a/var/spack/repos/builtin/packages/lua/package.py
+++ b/var/spack/repos/builtin/packages/lua/package.py
@@ -145,11 +145,11 @@ class Lua(Package):
@property
def lua_lib_dir(self):
- return os.path.join('lib', 'lua', self.version.up_to(2))
+ return os.path.join('lib', 'lua', str(self.version.up_to(2)))
@property
def lua_share_dir(self):
- return os.path.join('share', 'lua', self.version.up_to(2))
+ return os.path.join('share', 'lua', str(self.version.up_to(2)))
def setup_dependent_package(self, module, dependent_spec):
"""
diff --git a/var/spack/repos/builtin/packages/magics/package.py b/var/spack/repos/builtin/packages/magics/package.py
index d69dedf3ea..33a6bb5640 100644
--- a/var/spack/repos/builtin/packages/magics/package.py
+++ b/var/spack/repos/builtin/packages/magics/package.py
@@ -109,7 +109,7 @@ class Magics(Package):
if '+metview' in spec:
if '+qt' in spec:
options.append('-DENABLE_METVIEW=ON')
- if spec['qt'].version.up_to(1) == '5':
+ if spec['qt'].version[0] == 5:
options.append('-DENABLE_QT5=ON')
else:
options.append('-DENABLE_METVIEW_NO_QT=ON')
diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py
index 551f87b5d7..89e821b68f 100644
--- a/var/spack/repos/builtin/packages/qt/package.py
+++ b/var/spack/repos/builtin/packages/qt/package.py
@@ -131,9 +131,9 @@ class Qt(Package):
url = self.list_url
if version >= Version('4.0'):
- url += version.up_to(2) + '/'
+ url += str(version.up_to(2)) + '/'
else:
- url += version.up_to(1) + '/'
+ url += str(version.up_to(1)) + '/'
if version >= Version('4.8'):
url += str(version) + '/'
diff --git a/var/spack/repos/builtin/packages/sublime-text/package.py b/var/spack/repos/builtin/packages/sublime-text/package.py
index 3d7fb65005..e7605b40be 100644
--- a/var/spack/repos/builtin/packages/sublime-text/package.py
+++ b/var/spack/repos/builtin/packages/sublime-text/package.py
@@ -49,7 +49,7 @@ class SublimeText(Package):
depends_on('libxau', type='run')
def url_for_version(self, version):
- if version.up_to(1) == '2':
+ if version[0] == 2:
return "https://download.sublimetext.com/Sublime%20Text%20{0}%20x64.tar.bz2".format(version)
else:
return "https://download.sublimetext.com/sublime_text_3_build_{0}_x64.tar.bz2".format(version)