Remove TODOs for full DAG information.
- specs on disk now include full DAG info - no need for normalize() kludges() anymore.
This commit is contained in:
parent
29e833dfef
commit
5d2ee893c4
@ -54,6 +54,7 @@ def find_conflict(self, dest_root, **kwargs):
|
|||||||
"""Returns the first file in dest that conflicts with src"""
|
"""Returns the first file in dest that conflicts with src"""
|
||||||
kwargs['follow_nonexisting'] = False
|
kwargs['follow_nonexisting'] = False
|
||||||
for src, dest in traverse_tree(self._root, dest_root, **kwargs):
|
for src, dest in traverse_tree(self._root, dest_root, **kwargs):
|
||||||
|
print src, dest
|
||||||
if os.path.isdir(src):
|
if os.path.isdir(src):
|
||||||
if os.path.exists(dest) and not os.path.isdir(dest):
|
if os.path.exists(dest) and not os.path.isdir(dest):
|
||||||
return dest
|
return dest
|
||||||
|
@ -38,17 +38,11 @@ def setup_parser(subparser):
|
|||||||
|
|
||||||
|
|
||||||
def activate(parser, args):
|
def activate(parser, args):
|
||||||
# TODO: shouldn't have to concretize here. Fix DAG issues.
|
specs = spack.cmd.parse_specs(args.spec)
|
||||||
specs = spack.cmd.parse_specs(args.spec, concretize=True)
|
|
||||||
if len(specs) != 1:
|
if len(specs) != 1:
|
||||||
tty.die("activate requires one spec. %d given." % len(specs))
|
tty.die("activate requires one spec. %d given." % len(specs))
|
||||||
|
|
||||||
# TODO: remove this hack when DAG info is stored in dir layout.
|
|
||||||
# This ensures the ext spec is always normalized properly.
|
|
||||||
spack.db.get(specs[0])
|
|
||||||
|
|
||||||
spec = spack.cmd.disambiguate_spec(specs[0])
|
spec = spack.cmd.disambiguate_spec(specs[0])
|
||||||
|
|
||||||
if not spec.package.is_extension:
|
if not spec.package.is_extension:
|
||||||
tty.die("%s is not an extension." % spec.name)
|
tty.die("%s is not an extension." % spec.name)
|
||||||
|
|
||||||
|
@ -44,15 +44,10 @@ def setup_parser(subparser):
|
|||||||
|
|
||||||
|
|
||||||
def deactivate(parser, args):
|
def deactivate(parser, args):
|
||||||
# TODO: shouldn't have to concretize here. Fix DAG issues.
|
specs = spack.cmd.parse_specs(args.spec)
|
||||||
specs = spack.cmd.parse_specs(args.spec, concretize=True)
|
|
||||||
if len(specs) != 1:
|
if len(specs) != 1:
|
||||||
tty.die("deactivate requires one spec. %d given." % len(specs))
|
tty.die("deactivate requires one spec. %d given." % len(specs))
|
||||||
|
|
||||||
# TODO: remove this hack when DAG info is stored properly.
|
|
||||||
# This ensures the ext spec is always normalized properly.
|
|
||||||
spack.db.get(specs[0])
|
|
||||||
|
|
||||||
spec = spack.cmd.disambiguate_spec(specs[0])
|
spec = spack.cmd.disambiguate_spec(specs[0])
|
||||||
pkg = spec.package
|
pkg = spec.package
|
||||||
|
|
||||||
@ -67,9 +62,6 @@ def deactivate(parser, args):
|
|||||||
ext_pkg.do_deactivate(force=True)
|
ext_pkg.do_deactivate(force=True)
|
||||||
|
|
||||||
elif pkg.is_extension:
|
elif pkg.is_extension:
|
||||||
# TODO: store DAG info properly (see above)
|
|
||||||
spec.normalize()
|
|
||||||
|
|
||||||
if not args.force and not spec.package.activated:
|
if not args.force and not spec.package.activated:
|
||||||
tty.die("%s is not activated." % pkg.spec.short_spec)
|
tty.die("%s is not activated." % pkg.spec.short_spec)
|
||||||
|
|
||||||
@ -81,10 +73,6 @@ def deactivate(parser, args):
|
|||||||
for name in topo_order:
|
for name in topo_order:
|
||||||
espec = index[name]
|
espec = index[name]
|
||||||
epkg = espec.package
|
epkg = espec.package
|
||||||
|
|
||||||
# TODO: store DAG info properly (see above)
|
|
||||||
epkg.spec.normalize()
|
|
||||||
|
|
||||||
if epkg.extends(pkg.extendee_spec):
|
if epkg.extends(pkg.extendee_spec):
|
||||||
if epkg.activated or args.force:
|
if epkg.activated or args.force:
|
||||||
|
|
||||||
|
@ -984,16 +984,11 @@ def do_activate(self, **kwargs):
|
|||||||
self._sanity_check_extension()
|
self._sanity_check_extension()
|
||||||
force = kwargs.get('force', False)
|
force = kwargs.get('force', False)
|
||||||
|
|
||||||
# TODO: get rid of this normalize - DAG handling.
|
|
||||||
self.spec.normalize()
|
|
||||||
|
|
||||||
spack.install_layout.check_extension_conflict(self.extendee_spec, self.spec)
|
spack.install_layout.check_extension_conflict(self.extendee_spec, self.spec)
|
||||||
|
|
||||||
if not force:
|
if not force:
|
||||||
for spec in self.spec.traverse(root=False):
|
for spec in self.spec.traverse(root=False):
|
||||||
if spec.package.extends(self.extendee_spec):
|
if spec.package.extends(self.extendee_spec):
|
||||||
# TODO: fix this normalize() requirement -- revisit DAG handling.
|
|
||||||
spec.package.spec.normalize()
|
|
||||||
if not spec.package.activated:
|
if not spec.package.activated:
|
||||||
spec.package.do_activate(**kwargs)
|
spec.package.do_activate(**kwargs)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user