From 7ad7fde09cc62a5edfc44dea5fbc5324d07d4c37 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Wed, 19 Oct 2022 19:25:20 +0200 Subject: Add a command to bootstrap Spack right now (#33407) --- lib/spack/spack/cmd/bootstrap.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib') diff --git a/lib/spack/spack/cmd/bootstrap.py b/lib/spack/spack/cmd/bootstrap.py index 9a782b64ea..fc1ab8e92d 100644 --- a/lib/spack/spack/cmd/bootstrap.py +++ b/lib/spack/spack/cmd/bootstrap.py @@ -5,6 +5,7 @@ from __future__ import print_function import os.path +import platform import shutil import tempfile @@ -73,6 +74,8 @@ def _add_scope_option(parser): def setup_parser(subparser): sp = subparser.add_subparsers(dest="subcommand") + sp.add_parser("now", help="Spack ready, right now!") + status = sp.add_parser("status", help="get the status of Spack") status.add_argument( "--optional", @@ -404,6 +407,14 @@ def _mirror(args): print(instructions) +def _now(args): + with spack.bootstrap.ensure_bootstrap_configuration(): + spack.bootstrap.ensure_clingo_importable_or_raise() + spack.bootstrap.ensure_gpg_in_path_or_raise() + if platform.system().lower() == "linux": + spack.bootstrap.ensure_patchelf_in_path_or_raise() + + def bootstrap(parser, args): callbacks = { "status": _status, @@ -417,5 +428,6 @@ def bootstrap(parser, args): "add": _add, "remove": _remove, "mirror": _mirror, + "now": _now, } callbacks[args.subcommand](args) -- cgit v1.2.3-70-g09d2