From 515b4045e940b44ffe1295c483a78074abeae96c Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sat, 29 Jun 2019 15:07:07 -0700 Subject: 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. --- .../packages/when-directives-false/package.py | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 var/spack/repos/builtin.mock/packages/when-directives-false/package.py (limited to 'var/spack/repos/builtin.mock/packages/when-directives-false/package.py') 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 -- cgit v1.2.3-60-g2f50