diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2019-06-29 15:07:07 -0700 |
---|---|---|
committer | Peter Scheibel <scheibel1@llnl.gov> | 2019-07-01 18:45:44 -0700 |
commit | 515b4045e940b44ffe1295c483a78074abeae96c (patch) | |
tree | b50b359b3fe60a1b5df1ace37941a3fb87931b8b /var | |
parent | 12b9fad7b6bf578cf7d0c942e585e311cc9b4cb7 (diff) | |
download | spack-515b4045e940b44ffe1295c483a78074abeae96c.tar.gz spack-515b4045e940b44ffe1295c483a78074abeae96c.tar.bz2 spack-515b4045e940b44ffe1295c483a78074abeae96c.tar.xz spack-515b4045e940b44ffe1295c483a78074abeae96c.zip |
specs: remove parse_anonymous_spec(); use Spec() instead
- `parse_anonymous_spec()` is a vestige of the days when Spack didn't
support nameless specs. We don't need it anymore because now we can
write Spec() for a spec that will match anything, and satisfies()
semantics work properly for anonymous specs.
- Delete `parse_anonymous_spec()` and replace its uses with simple calls
to the Spec() constructor.
- make then handling of when='...' specs in directives more consistent.
- clean up Spec.__contains__()
- refactor directives and tests slightly to accommodate the change.
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin.mock/packages/when-directives-false/package.py | 28 | ||||
-rw-r--r-- | var/spack/repos/builtin.mock/packages/when-directives-true/package.py | 28 |
2 files changed, 56 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/when-directives-false/package.py b/var/spack/repos/builtin.mock/packages/when-directives-false/package.py new file mode 100644 index 0000000000..bdb24cac79 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/when-directives-false/package.py @@ -0,0 +1,28 @@ +# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class WhenDirectivesFalse(Package): + """Package that tests False when specs on directives.""" + + homepage = "http://www.example.com" + url = "http://www.example.com/example-1.0.tar.gz" + + version('1.0', '0123456789abcdef0123456789abcdef') + + patch('https://example.com/foo.patch', + sha256='abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234', + when=False) + extends('extendee', when=False) + depends_on('b', when=False) + conflicts('@1.0', when=False) + resource(url="http://www.example.com/example-1.0-resource.tar.gz", + md5='0123456789abcdef0123456789abcdef', + when=False) + + def install(self, spec, prefix): + pass diff --git a/var/spack/repos/builtin.mock/packages/when-directives-true/package.py b/var/spack/repos/builtin.mock/packages/when-directives-true/package.py new file mode 100644 index 0000000000..69c90128b2 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/when-directives-true/package.py @@ -0,0 +1,28 @@ +# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class WhenDirectivesTrue(Package): + """Package that tests True when specs on directives.""" + + homepage = "http://www.example.com" + url = "http://www.example.com/example-1.0.tar.gz" + + version('1.0', '0123456789abcdef0123456789abcdef') + + patch('https://example.com/foo.patch', + sha256='abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234', + when=True) + extends('extendee', when=True) + depends_on('b', when=True) + conflicts('@1.0', when=True) + resource(url="http://www.example.com/example-1.0-resource.tar.gz", + md5='0123456789abcdef0123456789abcdef', + when=True) + + def install(self, spec, prefix): + pass |