From bf3990039009d65213beaebea50054276ca93a16 Mon Sep 17 00:00:00 2001 From: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> Date: Tue, 9 Jan 2024 11:04:38 -0800 Subject: [PATCH] Move in vs. satisfies to a note and mention special cases of in (#41727) * Move in vs. satisfies to a note and mention special cases of in * Address feedback: oveoverlap -> intersect * Re-word the satisfies versus in note. --------- Co-authored-by: Massimiliano Culpo --- lib/spack/docs/packaging_guide.rst | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/spack/docs/packaging_guide.rst b/lib/spack/docs/packaging_guide.rst index 585276739c..54ad132e10 100644 --- a/lib/spack/docs/packaging_guide.rst +++ b/lib/spack/docs/packaging_guide.rst @@ -4379,10 +4379,16 @@ implementation was selected for this build: elif "mvapich" in spec: configure_args.append("--with-mvapich") -It's also a bit more concise than satisfies. The difference between -the two functions is that ``satisfies()`` tests whether spec -constraints overlap at all, while ``in`` tests whether a spec or any -of its dependencies satisfy the provided spec. +It's also a bit more concise than satisfies. + +.. note:: + + The ``satisfies()`` method tests whether this spec has, at least, all the constraints of the argument spec, + while ``in`` tests whether a spec or any of its dependencies satisfy the provided spec. + + If the provided spec is anonymous (e.g., ":1.2:", "+shared") or has the + same name as the spec being checked, then ``in`` works the same as + ``satisfies()``; however, use of ``satisfies()`` is more intuitive. ^^^^^^^^^^^^^^^^^^^^^^^ Architecture specifiers