From 6d956f372fe01331ec38834e39a248fe258c9a23 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sun, 26 Jan 2014 02:15:31 -0800 Subject: Fix bug in staging. - Stage needs to account for symlinks in self.tmp_dir - Use os.realpath on self.tmp_dir when checking to see if a stage needs to be rebuilt --- lib/spack/spack/stage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py index b4f9c21184..a4a5b93929 100644 --- a/lib/spack/spack/stage.py +++ b/lib/spack/spack/stage.py @@ -110,11 +110,12 @@ class Stage(object): # Path looks ok, but need to check the target of the link. if os.path.islink(self.path): real_path = os.path.realpath(self.path) + real_tmp = os.path.realpath(self.tmp_root) if spack.use_tmp_stage: # If we're using a tmp dir, it's a link, and it points at the right spot, # then keep it. - if (os.path.commonprefix((real_path, self.tmp_root)) == self.tmp_root + if (os.path.commonprefix((real_path, real_tmp)) == real_tmp and os.path.exists(real_path)): return False else: @@ -266,7 +267,6 @@ class Stage(object): downloaded. """ self.chdir() - if not self.archive_file: tty.die("Attempt to expand archive before fetching.") -- cgit v1.2.3-70-g09d2