summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-06-16 00:54:59 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2016-06-16 00:54:59 -0700
commitc90cc465f581514d18fc4fc95649f015cb178079 (patch)
treef18d0187bc744574442910ef569d1a3ac7ff6858 /lib
parent3fcd54203c7e327f8ae9c08f0df91b033d63a459 (diff)
downloadspack-c90cc465f581514d18fc4fc95649f015cb178079.tar.gz
spack-c90cc465f581514d18fc4fc95649f015cb178079.tar.bz2
spack-c90cc465f581514d18fc4fc95649f015cb178079.tar.xz
spack-c90cc465f581514d18fc4fc95649f015cb178079.zip
Add `__contains__` to arch to satsify old packages.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/architecture.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/spack/spack/architecture.py b/lib/spack/spack/architecture.py
index 1f25bc14ea..df0ab5c14d 100644
--- a/lib/spack/spack/architecture.py
+++ b/lib/spack/spack/architecture.py
@@ -195,7 +195,7 @@ class Platform(object):
name = self.back_os
return self.operating_sys.get(name, None)
-
+
@classmethod
def detect(self):
@@ -206,12 +206,15 @@ class Platform(object):
"""
raise NotImplementedError()
+
def __repr__(self):
return self.__str__()
+
def __str__(self):
return self.name
+
def _cmp_key(self):
t_keys = ''.join(str(t._cmp_key()) for t in
sorted(self.targets.values()))
@@ -338,7 +341,6 @@ class OperatingSystem(object):
d = {}
d['name'] = self.name
d['version'] = self.version
-
return d
@key_ordering
@@ -378,6 +380,11 @@ class Arch(object):
else:
return ''
+
+ def __contains__(self, string):
+ return string in str(self)
+
+
def _cmp_key(self):
if isinstance(self.platform, Platform):
platform = self.platform.name