Move tty output commands out of package and into clean command.
This commit is contained in:
parent
4bde771970
commit
1801a85966
@ -52,7 +52,15 @@ def clean(parser, args):
|
||||
package = spack.db.get(spec)
|
||||
if args.dist:
|
||||
package.do_clean_dist()
|
||||
tty.msg("Cleaned %s" % package.name)
|
||||
|
||||
elif args.work:
|
||||
package.do_clean_work()
|
||||
tty.msg("Restaged %s" % package.name)
|
||||
|
||||
else:
|
||||
package.do_clean()
|
||||
try:
|
||||
package.do_clean()
|
||||
except subprocess.CalledProcessError, e:
|
||||
tty.warn("Warning: 'make clean' didn't work. Consider 'spack clean --work'.")
|
||||
tty.msg("Made clean for %s" % package.name)
|
||||
|
@ -427,7 +427,7 @@ def has_url(self):
|
||||
return self.url or self.version_urls()
|
||||
|
||||
|
||||
# TODO: move this out of here and into some URL extrapolation module.
|
||||
# TODO: move this out of here and into some URL extrapolation module?
|
||||
def url_for_version(self, version):
|
||||
"""Returns a URL that you can download a new version of this package from."""
|
||||
if not isinstance(version, Version):
|
||||
@ -598,7 +598,7 @@ def url_version(self, version):
|
||||
|
||||
@property
|
||||
def default_url(self):
|
||||
if self.concrete:
|
||||
if self.spec.version.concrete:
|
||||
return self.url_for_version(self.version)
|
||||
else:
|
||||
url = getattr(self, 'url', None)
|
||||
@ -841,13 +841,9 @@ def do_clean(self):
|
||||
|
||||
def clean(self):
|
||||
"""By default just runs make clean. Override if this isn't good."""
|
||||
try:
|
||||
# TODO: should we really call make clean, ro just blow away the directory?
|
||||
make = build_env.MakeExecutable('make', self.parallel)
|
||||
make('clean')
|
||||
tty.msg("Successfully cleaned %s" % self.name)
|
||||
except subprocess.CalledProcessError, e:
|
||||
tty.warn("Warning: 'make clean' didn't work. Consider 'spack clean --work'.")
|
||||
# TODO: should we really call make clean, ro just blow away the directory?
|
||||
make = build_env.MakeExecutable('make', self.parallel)
|
||||
make('clean')
|
||||
|
||||
|
||||
def do_clean_work(self):
|
||||
@ -859,7 +855,6 @@ def do_clean_dist(self):
|
||||
"""Removes the stage directory where this package was built."""
|
||||
if os.path.exists(self.stage.path):
|
||||
self.stage.destroy()
|
||||
tty.msg("Successfully cleaned %s" % self.name)
|
||||
|
||||
|
||||
def fetch_available_versions(self):
|
||||
|
Loading…
Reference in New Issue
Block a user