summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKyle Knoepfel <knoepfel@fnal.gov>2024-09-13 08:08:58 -0500
committerGitHub <noreply@github.com>2024-09-13 08:08:58 -0500
commit4fe417b6203b9d31d2d52085aa10eaead0eaf23a (patch)
tree077b43c3d5ba88597e9e17c603aea0f2f4dcdf0c /lib
parente3c5d5817b02d91cdfacf0c2e939851956f5179a (diff)
downloadspack-4fe417b6203b9d31d2d52085aa10eaead0eaf23a.tar.gz
spack-4fe417b6203b9d31d2d52085aa10eaead0eaf23a.tar.bz2
spack-4fe417b6203b9d31d2d52085aa10eaead0eaf23a.tar.xz
spack-4fe417b6203b9d31d2d52085aa10eaead0eaf23a.zip
Optionally output package namespace (#46359)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/info.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/spack/spack/cmd/info.py b/lib/spack/spack/cmd/info.py
index c5d776212b..a576677052 100644
--- a/lib/spack/spack/cmd/info.py
+++ b/lib/spack/spack/cmd/info.py
@@ -48,6 +48,7 @@ def setup_parser(subparser):
options = [
("--detectable", print_detectable.__doc__),
("--maintainers", print_maintainers.__doc__),
+ ("--namespace", print_namespace.__doc__),
("--no-dependencies", "do not " + print_dependencies.__doc__),
("--no-variants", "do not " + print_variants.__doc__),
("--no-versions", "do not " + print_versions.__doc__),
@@ -189,6 +190,15 @@ def print_maintainers(pkg, args):
color.cprint(section_title("Maintainers: ") + mnt)
+def print_namespace(pkg, args):
+ """output package namespace"""
+
+ repo = spack.repo.PATH.get_repo(pkg.namespace)
+ color.cprint("")
+ color.cprint(section_title("Namespace:"))
+ color.cprint(f" @c{{{repo.namespace}}} at {repo.root}")
+
+
def print_phases(pkg, args):
"""output installation phases"""
@@ -522,6 +532,7 @@ def info(parser, args):
# Now output optional information in expected order
sections = [
(args.all or args.maintainers, print_maintainers),
+ (args.all or args.namespace, print_namespace),
(args.all or args.detectable, print_detectable),
(args.all or args.tags, print_tags),
(args.all or not args.no_versions, print_versions),