spack deprecate: deprecate --link-type flag (#46202)

This commit is contained in:
Harmen Stoppels
2024-09-05 11:06:46 +02:00
committed by GitHub
parent 1a4b07e730
commit 2107a88514
2 changed files with 6 additions and 11 deletions

View File

@@ -14,7 +14,6 @@
installation and its deprecator.
"""
import argparse
import os
import llnl.util.tty as tty
from llnl.util.symlink import symlink
@@ -76,12 +75,7 @@ def setup_parser(sp):
)
sp.add_argument(
"-l",
"--link-type",
type=str,
default="soft",
choices=["soft", "hard"],
help="type of filesystem link to use for deprecation (default soft)",
"-l", "--link-type", type=str, default=None, choices=["soft", "hard"], help="(deprecated)"
)
sp.add_argument(
@@ -91,6 +85,9 @@ def setup_parser(sp):
def deprecate(parser, args):
"""Deprecate one spec in favor of another"""
if args.link_type is not None:
tty.warn("The --link-type option is deprecated and will be removed in a future release.")
env = ev.active_environment()
specs = spack.cmd.parse_specs(args.specs)
@@ -144,7 +141,5 @@ def deprecate(parser, args):
if not answer:
tty.die("Will not deprecate any packages.")
link_fn = os.link if args.link_type == "hard" else symlink
for dcate, dcator in zip(all_deprecate, all_deprecators):
dcate.package.do_deprecate(dcator, link_fn)
dcate.package.do_deprecate(dcator, symlink)