Skip to content

Commit d450a2f

Browse files
becker33tgamblin
authored andcommitted
stacks: initial implementation of stacks on environments
- stack syntax in env schema - switch environment specs over to SpecList object - add stack functionality to environments - handle definition extensions through stack.yaml and SpecList - implement conditional definitions - tests
1 parent 5be1ff8 commit d450a2f

File tree

9 files changed

+875
-61
lines changed

9 files changed

+875
-61
lines changed

lib/spack/spack/cmd/add.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818

1919
def setup_parser(subparser):
20+
subparser.add_argument('-l', '--list-name',
21+
dest='list_name', default='specs',
22+
help="name of the list to add specs to")
2023
subparser.add_argument(
2124
'specs', nargs=argparse.REMAINDER, help="specs of packages to add")
2225

@@ -25,7 +28,7 @@ def add(parser, args):
2528
env = ev.get_env(args, 'add', required=True)
2629

2730
for spec in spack.cmd.parse_specs(args.specs):
28-
if not env.add(spec):
31+
if not env.add(spec, args.list_name):
2932
tty.msg("Package {0} was already added to {1}"
3033
.format(spec.name, env.name))
3134
else:

lib/spack/spack/cmd/find.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ def find(parser, args):
175175
tty.msg('No root specs')
176176
else:
177177
tty.msg('Root specs')
178+
# TODO: Change this to not print extraneous deps and variants
178179
display_specs(
179180
env.user_specs, args,
180181
decorator=lambda s, f: color.colorize('@*{%s}' % f))

lib/spack/spack/cmd/remove.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ def setup_parser(subparser):
2020
subparser.add_argument(
2121
'-a', '--all', action='store_true',
2222
help="remove all specs from (clear) the environment")
23+
subparser.add_argument('-l', '--list-name',
24+
dest='list_name', default='specs',
25+
help="name of the list to remove specs from")
2326
subparser.add_argument(
2427
'-f', '--force', action='store_true',
2528
help="remove concretized spec (if any) immediately")
@@ -35,5 +38,5 @@ def remove(parser, args):
3538
else:
3639
for spec in spack.cmd.parse_specs(args.specs):
3740
tty.msg('Removing %s from environment %s' % (spec, env.name))
38-
env.remove(spec, force=args.force)
41+
env.remove(spec, args.list_name, force=args.force)
3942
env.write()

0 commit comments

Comments
 (0)