From e6346eb0338cb09ec16e9ceb35f994f8706d609c Mon Sep 17 00:00:00 2001 From: Greg Becker Date: Wed, 4 May 2022 23:59:44 -0700 Subject: spack external find: add search path customization (#30479) --- lib/spack/spack/cmd/external.py | 9 +++++++-- share/spack/spack-completion.bash | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/spack/spack/cmd/external.py b/lib/spack/spack/cmd/external.py index 50d77890fd..8b9c845c3e 100644 --- a/lib/spack/spack/cmd/external.py +++ b/lib/spack/spack/cmd/external.py @@ -37,6 +37,9 @@ def setup_parser(subparser): find_parser.add_argument( '--not-buildable', action='store_true', default=False, help="packages with detected externals won't be built with Spack") + find_parser.add_argument( + '-p', '--path', default=None, action='append', + help="Alternative search paths for finding externals. May be repeated") find_parser.add_argument( '--scope', choices=scopes, metavar=scopes_metavar, default=spack.config.default_modify_scope('packages'), @@ -124,8 +127,10 @@ def external_find(args): if not args.tags and not packages_to_check: packages_to_check = spack.repo.path.all_packages() - detected_packages = spack.detection.by_executable(packages_to_check) - detected_packages.update(spack.detection.by_library(packages_to_check)) + detected_packages = spack.detection.by_executable( + packages_to_check, path_hints=args.path) + detected_packages.update(spack.detection.by_library( + packages_to_check, path_hints=args.path)) new_entries = spack.detection.update_configuration( detected_packages, scope=args.scope, buildable=not args.not_buildable diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index 8f529a140c..5a114ef340 100755 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash @@ -1024,7 +1024,7 @@ _spack_external() { _spack_external_find() { if $list_options then - SPACK_COMPREPLY="-h --help --not-buildable --scope --all -t --tag" + SPACK_COMPREPLY="-h --help --not-buildable -p --path --scope --all -t --tag" else _all_packages fi -- cgit v1.2.3-60-g2f50