summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2014-02-07 09:28:50 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2014-02-07 09:28:50 -0800
commit42610be2e5f7e4c6761c2ca96b304753c6ecc030 (patch)
treebf5b7fe5d22e8f0df657a7578961d3c959bead2d /lib
parent19df908cb6331e494368cd9f669cdc0e51d3d333 (diff)
downloadspack-42610be2e5f7e4c6761c2ca96b304753c6ecc030.tar.gz
spack-42610be2e5f7e4c6761c2ca96b304753c6ecc030.tar.bz2
spack-42610be2e5f7e4c6761c2ca96b304753c6ecc030.tar.xz
spack-42610be2e5f7e4c6761c2ca96b304753c6ecc030.zip
Fix bugs that crept into spack clean when stage was refactored.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/clean.py3
-rw-r--r--lib/spack/spack/package.py4
-rw-r--r--lib/spack/spack/stage.py11
-rw-r--r--lib/spack/spack/test/stage.py1
4 files changed, 9 insertions, 10 deletions
diff --git a/lib/spack/spack/cmd/clean.py b/lib/spack/spack/cmd/clean.py
index 8c8d90fe21..b86c3e502f 100644
--- a/lib/spack/spack/cmd/clean.py
+++ b/lib/spack/spack/cmd/clean.py
@@ -48,8 +48,7 @@ def clean(parser, args):
specs = spack.cmd.parse_specs(args.packages, concretize=True)
for spec in specs:
- tty.msg("Cleaning for spec:", spec)
- package = packages.get(spec.name)
+ package = packages.get(spec)
if args.dist:
package.do_clean_dist()
elif args.work:
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 8675435492..ce4a98d99b 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -386,6 +386,8 @@ class Package(object):
@property
def stage(self):
if not self.spec.concrete:
+ print self.spec
+ print self.spec.concrete
raise ValueError("Can only get a stage for a concrete package.")
if self._stage is None:
@@ -564,8 +566,6 @@ class Package(object):
"""Creates a stage directory and downloads the taball for this package.
Working directory will be set to the stage directory.
"""
- self.stage.setup()
-
if spack.do_checksum and not self.version in self.versions:
tty.die("Cannot fetch %s@%s safely; there is no checksum on file for this "
"version." % (self.name, self.version),
diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py
index a4a5b93929..a278950546 100644
--- a/lib/spack/spack/stage.py
+++ b/lib/spack/spack/stage.py
@@ -42,8 +42,8 @@ class Stage(object):
expanded, and built before being installed. It also handles downloading
the archive. A stage's lifecycle looks like this:
- setup()
- Create the stage directory.
+ Stage()
+ Constructor creates the stage directory.
fetch()
Fetch a source archive into the stage.
expand_archive()
@@ -80,7 +80,9 @@ class Stage(object):
self.tmp_root = find_tmp_root()
self.url = url
- self.path = None # This will be set after setup is called.
+
+ self.path = None
+ self._setup()
def _cleanup_dead_links(self):
@@ -131,7 +133,7 @@ class Stage(object):
return False
- def setup(self):
+ def _setup(self):
"""Creates the stage directory.
If spack.use_tmp_stage is False, the stage directory is created
directly under spack.stage_path.
@@ -206,7 +208,6 @@ class Stage(object):
def chdir(self):
"""Changes directory to the stage path. Or dies if it is not set up."""
- self.setup()
if os.path.isdir(self.path):
os.chdir(self.path)
else:
diff --git a/lib/spack/spack/test/stage.py b/lib/spack/spack/test/stage.py
index 942baf6d46..102a692ca2 100644
--- a/lib/spack/spack/test/stage.py
+++ b/lib/spack/spack/test/stage.py
@@ -190,7 +190,6 @@ class StageTest(unittest.TestCase):
def checkSetupAndDestroy(self, stage_name=None):
stage = Stage(archive_url, name=stage_name)
- stage.setup()
self.check_setup(stage, stage_name)
stage.destroy()