spack stage: add missing --fresh and --reuse (#31626)
This commit is contained in:
parent
e3aca44601
commit
e7be8dbbcf
@ -24,6 +24,7 @@ def setup_parser(subparser):
|
|||||||
subparser.add_argument(
|
subparser.add_argument(
|
||||||
'-p', '--path', dest='path',
|
'-p', '--path', dest='path',
|
||||||
help="path to stage package, does not add to spack tree")
|
help="path to stage package, does not add to spack tree")
|
||||||
|
arguments.add_concretizer_args(subparser)
|
||||||
|
|
||||||
|
|
||||||
def stage(parser, args):
|
def stage(parser, args):
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
import spack.config
|
||||||
import spack.environment as ev
|
import spack.environment as ev
|
||||||
import spack.repo
|
import spack.repo
|
||||||
from spack.main import SpackCommand
|
from spack.main import SpackCommand
|
||||||
@ -122,3 +123,13 @@ def fake_stage(pkg, mirror_only=False):
|
|||||||
|
|
||||||
# assert that all were staged
|
# assert that all were staged
|
||||||
assert len(expected) == 0
|
assert len(expected) == 0
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.disable_clean_stage_check
|
||||||
|
def test_concretizer_arguments(mock_packages, mock_fetch):
|
||||||
|
"""Make sure stage also has --reuse and --fresh flags."""
|
||||||
|
stage("--reuse", "trivial-install-test-package")
|
||||||
|
assert spack.config.get("concretizer:reuse", None) is True
|
||||||
|
|
||||||
|
stage("--fresh", "trivial-install-test-package")
|
||||||
|
assert spack.config.get("concretizer:reuse", None) is False
|
||||||
|
@ -1688,7 +1688,7 @@ _spack_spec() {
|
|||||||
_spack_stage() {
|
_spack_stage() {
|
||||||
if $list_options
|
if $list_options
|
||||||
then
|
then
|
||||||
SPACK_COMPREPLY="-h --help -n --no-checksum --deprecated -p --path"
|
SPACK_COMPREPLY="-h --help -n --no-checksum --deprecated -p --path -U --fresh --reuse"
|
||||||
else
|
else
|
||||||
_all_packages
|
_all_packages
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user